nova: abandon hypervisor_info_page ROM
replace by platform_info ROM supposed to exist on all supported kernels. Fixes #2710
This commit is contained in:
committed by
Christian Helmuth
parent
0fbd892b5c
commit
80e1dce1b0
@@ -673,6 +673,16 @@ Platform::Platform() :
|
||||
xml.attribute("pitch", boot_fb->aux);
|
||||
});
|
||||
});
|
||||
xml.node("hardware", [&] () {
|
||||
xml.node("features", [&] () {
|
||||
xml.attribute("svm", hip->has_feature_svm());
|
||||
xml.attribute("vmx", hip->has_feature_vmx());
|
||||
});
|
||||
xml.node("tsc", [&] () {
|
||||
xml.attribute("invariant", cpuid_invariant_tsc());
|
||||
xml.attribute("freq_khz" , hip->tsc_freq);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
unmap_local(__main_thread_utcb, core_local_addr, pages);
|
||||
@@ -683,24 +693,6 @@ Platform::Platform() :
|
||||
"platform_info"));
|
||||
}
|
||||
|
||||
/* export hypervisor info page as ROM module */
|
||||
{
|
||||
void * phys_ptr = nullptr;
|
||||
ram_alloc()->alloc_aligned(get_page_size(), &phys_ptr, get_page_size_log2());
|
||||
|
||||
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
|
||||
addr_t const core_local_addr = _map_pages(phys_addr, 1);
|
||||
|
||||
memcpy(reinterpret_cast<void *>(core_local_addr), hip, get_page_size());
|
||||
|
||||
unmap_local(__main_thread_utcb, core_local_addr, 1);
|
||||
region_alloc()->free(reinterpret_cast<void *>(core_local_addr), get_page_size());
|
||||
|
||||
_rom_fs.insert(new (core_mem_alloc())
|
||||
Rom_module(phys_addr, get_page_size(),
|
||||
"hypervisor_info_page"));
|
||||
}
|
||||
|
||||
/* core log as ROM module */
|
||||
{
|
||||
void * phys_ptr = nullptr;
|
||||
|
||||
@@ -269,8 +269,9 @@ void test_revoke(Genode::Env &env)
|
||||
void test_pat(Genode::Env &env)
|
||||
{
|
||||
/* read out the tsc frequenzy once */
|
||||
Genode::Attached_rom_dataspace _ds(env, "hypervisor_info_page");
|
||||
Nova::Hip * const hip = _ds.local_addr<Nova::Hip>();
|
||||
Attached_rom_dataspace const platform_info (env, "platform_info");
|
||||
Xml_node const hardware = platform_info.xml().sub_node("hardware");
|
||||
uint64_t const tsc_freq = hardware.sub_node("tsc").attribute_value("freq_khz", 1ULL);
|
||||
|
||||
enum { DS_ORDER = 12, PAGE_4K = 12 };
|
||||
|
||||
@@ -348,12 +349,12 @@ void test_pat(Genode::Env &env)
|
||||
|
||||
Trace::Timestamp diff_run = map_run > remap_run ? map_run - remap_run : remap_run - map_run;
|
||||
|
||||
if (check_pat && diff_run * 100 / hip->tsc_freq) {
|
||||
if (check_pat && diff_run * 100 / tsc_freq) {
|
||||
failed ++;
|
||||
|
||||
error("map=", Hex(map_run), " remap=", Hex(remap_run), " --> "
|
||||
"diff=", Hex(diff_run), " freq_tsc=", hip->tsc_freq, " ",
|
||||
diff_run * 1000 / hip->tsc_freq, " us");
|
||||
"diff=", Hex(diff_run), " freq_tsc=", tsc_freq, " ",
|
||||
diff_run * 1000 / tsc_freq, " us");
|
||||
}
|
||||
|
||||
Nova::revoke(Nova::Mem_crd(remap_addr >> PAGE_4K, DS_ORDER, all));
|
||||
|
||||
Reference in New Issue
Block a user