diff options
Diffstat (limited to 'xen/arch/x86/tboot.c')
-rw-r--r-- | xen/arch/x86/tboot.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index dbc9b8e407..697ca9f461 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -43,16 +43,43 @@ void __init tboot_probe(void) printk(" s3_tb_wakeup_entry: 0x%08x\n", tboot_shared->s3_tb_wakeup_entry); printk(" s3_k_wakeup_entry: 0x%08x\n", tboot_shared->s3_k_wakeup_entry); printk(" &acpi_sinfo: 0x%p\n", &tboot_shared->acpi_sinfo); + if ( tboot_shared->version >= 0x02 ) + { + printk(" tboot_base: 0x%08x\n", tboot_shared->tboot_base); + printk(" tboot_size: 0x%x\n", tboot_shared->tboot_size); + } } void tboot_shutdown(uint32_t shutdown_type) { + uint32_t map_base, map_size; + int err; + g_tboot_shared->shutdown_type = shutdown_type; local_irq_disable(); - /* Create identity map for 0-640k to include tboot code. */ - map_pages_to_xen(0, 0, PFN_UP(0xa0000), __PAGE_HYPERVISOR); + /* Create identity map for tboot shutdown code. */ + if ( g_tboot_shared->version >= 0x02 ) + { + map_base = PFN_DOWN(g_tboot_shared->tboot_base); + map_size = PFN_UP(g_tboot_shared->tboot_size); + } + else + { + map_base = 0; + map_size = PFN_UP(0xa0000); + } + + err = map_pages_to_xen(map_base << PAGE_SHIFT, map_base, map_size, + __PAGE_HYPERVISOR); + if ( err != 0 ) + { + printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err, + map_base, map_size); + return; + } + write_ptbase(idle_vcpu[0]); #ifdef __x86_64__ @@ -68,3 +95,13 @@ int tboot_in_measured_env(void) { return (g_tboot_shared != NULL); } + +/* + * Local variables: + * mode: C + * c-set-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ |