[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-3.1-testing] x86: physaddr_bitsize must always be initialised for 32-on-64 dom0.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1203344450 0 # Node ID 5ce512d4d33806d5f5602f8c4026ede17bba0bb2 # Parent 3d90e974d2718346317df41c6cd8a4fe565d37b1 x86: physaddr_bitsize must always be initialised for 32-on-64 dom0. Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx> xen-unstable changeset: 16993:eef22fa42f44cf4f8d971a37dd265fc56eb35417 xen-unstable date: Thu Feb 07 13:20:15 2008 +0000 --- xen/arch/x86/domain_build.c | 44 ++++++++++++++++++-------------------------- 1 files changed, 18 insertions(+), 26 deletions(-) diff -r 3d90e974d271 -r 5ce512d4d338 xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Mon Feb 18 14:19:42 2008 +0000 +++ b/xen/arch/x86/domain_build.c Mon Feb 18 14:20:50 2008 +0000 @@ -291,9 +291,6 @@ int __init construct_dom0( compatible = 1; break; case 4: /* x86_64 */ -#ifndef CONFIG_COMPAT - printk(" Xen kernel: 64-bit, lsb\n"); -#else printk(" Xen kernel: 64-bit, lsb, compat32\n"); if (elf_32bit(&elf) && parms.pae == PAEKERN_bimodal) parms.pae = PAEKERN_extended_cr3; @@ -302,7 +299,6 @@ int __init construct_dom0( compat32 = 1; compatible = 1; } -#endif if (elf_64bit(&elf) && machine == EM_X86_64) compatible = 1; break; @@ -319,7 +315,7 @@ int __init construct_dom0( return -EINVAL; } -#ifdef CONFIG_COMPAT +#if defined(__x86_64__) if ( compat32 ) { l1_pgentry_t gdt_l1e; @@ -342,34 +338,32 @@ int __init construct_dom0( local_flush_tlb_one(GDT_LDT_VIRT_START + FIRST_RESERVED_GDT_BYTE); } #endif + if ( parms.pae == PAEKERN_extended_cr3 ) set_bit(VMASST_TYPE_pae_extended_cr3, &d->vm_assist); - if ( UNSET_ADDR != parms.virt_hv_start_low && elf_32bit(&elf) ) - { -#if CONFIG_PAGING_LEVELS < 4 + if ( (parms.virt_hv_start_low != UNSET_ADDR) && elf_32bit(&elf) ) + { unsigned long mask = (1UL << L2_PAGETABLE_SHIFT) - 1; + value = (parms.virt_hv_start_low + mask) & ~mask; + BUG_ON(!is_pv_32bit_domain(d)); +#if defined(__i386__) + if ( value > HYPERVISOR_VIRT_START ) + panic("Domain 0 expects too high a hypervisor start address.\n"); #else - unsigned long mask = is_pv_32bit_domain(d) - ? (1UL << L2_PAGETABLE_SHIFT) - 1 - : (1UL << L4_PAGETABLE_SHIFT) - 1; -#endif - - value = (parms.virt_hv_start_low + mask) & ~mask; -#ifdef CONFIG_COMPAT + if ( value > __HYPERVISOR_COMPAT_VIRT_START ) + panic("Domain 0 expects too high a hypervisor start address.\n"); HYPERVISOR_COMPAT_VIRT_START(d) = max_t(unsigned int, m2p_compat_vstart, value); +#endif + } + +#if defined(__x86_64__) + if ( is_pv_32on64_domain(d) ) d->arch.physaddr_bitsize = fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 1 + (PAGE_SIZE - 2); - if ( value > (!is_pv_32on64_domain(d) ? - HYPERVISOR_VIRT_START : - __HYPERVISOR_COMPAT_VIRT_START) ) -#else - if ( value > HYPERVISOR_VIRT_START ) -#endif - panic("Domain 0 expects too high a hypervisor start address.\n"); - } +#endif /* * Why do we need this? The number of page-table frames depends on the @@ -698,7 +692,6 @@ int __init construct_dom0( mfn++; } -#ifdef CONFIG_COMPAT if ( is_pv_32on64_domain(d) ) { /* Ensure the first four L3 entries are all populated. */ @@ -720,7 +713,6 @@ int __init construct_dom0( &compat_idle_pg_table_l2[l2_table_offset(HIRO_COMPAT_MPT_VIRT_START)], COMPAT_L2_PAGETABLE_XEN_SLOTS(d) * sizeof(*l2tab)); } -#endif /* Pages that are part of page tables must be read only. */ l4tab = l4start + l4_table_offset(vpt_start); @@ -881,7 +873,7 @@ int __init construct_dom0( si->console.dom0.info_size = sizeof(struct dom0_vga_console_info); } -#ifdef CONFIG_COMPAT +#if defined(__x86_64__) if ( is_pv_32on64_domain(d) ) xlat_start_info(si, XLAT_start_info_console_dom0); #endif _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |