nova: fix memory leaks / invariant TSCs

- free up kernel memory of empty slabs (if already one empty slab is in
  place)
- free up more page table entries
- handle CPUs with invariant TSCs gracefully

  Genode/Nova running on CPUs without the invariant TSC feature may seem
  to 'hang'. The referenced commit of the nova branch fixes the issue
  for some older Intel CPUs.

Fixes #1615
This commit is contained in:
Alexander Boettcher 2015-07-02 13:12:10 +02:00 committed by Christian Helmuth
parent cb1e0711ec
commit 9506c89f88
3 changed files with 16 additions and 4 deletions

View File

@ -1 +1 @@
2b256e6b852999be88a940c2dd211e40558213ed
abcaff7f0e4a24e8a8fc7b8b023a82a544094767

View File

@ -4,7 +4,7 @@ DOWNLOADS := nova.git
URL(nova) := https://github.com/alex-ab/NOVA.git
# r9 branch
REV(nova) := 27a42d2124a6631f58e7d925170b6b3bac36e2f8
REV(nova) := e56cf80c88cac7d709dd2685e4966ddebb0feed5
DIR(nova) := src/kernel/nova
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)

View File

@ -206,6 +206,14 @@ static void init_core_page_fault_handler()
}
static bool cpuid_invariant_tsc()
{
unsigned long cpuid = 0x80000007, edx = 0;
asm volatile ("cpuid" : "+a" (cpuid), "=d" (edx) : : "ebx", "ecx");
return edx & 0x100;
}
/**************
** Platform **
**************/
@ -315,10 +323,14 @@ Platform::Platform() :
init_core_page_fault_handler();
if (verbose_boot_info) {
printf("Hypervisor %s VMX\n", hip->has_feature_vmx() ? "features" : "does not feature");
printf("Hypervisor %s SVM\n", hip->has_feature_svm() ? "features" : "does not feature");
if (hip->has_feature_vmx())
printf("Hypervisor features VMX\n");
if (hip->has_feature_svm())
printf("Hypervisor features SVM\n");
printf("Hypervisor reports %ux%u CPU%c - boot CPU is %lu\n",
_cpus.width(), _cpus.height(), _cpus.total() > 1 ? 's' : ' ', boot_cpu());
if (!cpuid_invariant_tsc())
PWRN("CPU has no invariant TSC.");
}
/* initialize core allocators */