[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] domheap: Allocate vm buffer before boot allocator
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1200596743 25200 # Node ID a739d3edc185f0ddd5c3eaba97916c3ab3476ff0 # Parent af3550f5387484738f67ede0192a514eaebb2993 [IA64] domheap: Allocate vm buffer before boot allocator Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- xen/arch/ia64/linux-xen/setup.c | 12 +----------- xen/arch/ia64/vmx/vmx_init.c | 37 +++++++++++++++++++++++++++---------- xen/arch/ia64/xen/xensetup.c | 11 +++++++++++ xen/include/asm-ia64/vmx.h | 2 +- 4 files changed, 40 insertions(+), 22 deletions(-) diff -r af3550f53874 -r a739d3edc185 xen/arch/ia64/linux-xen/setup.c --- a/xen/arch/ia64/linux-xen/setup.c Thu Jan 17 12:05:43 2008 -0700 +++ b/xen/arch/ia64/linux-xen/setup.c Thu Jan 17 12:05:43 2008 -0700 @@ -561,10 +561,10 @@ late_setup_arch (char **cmdline_p) #endif #ifndef XEN find_memory(); -#endif /* process SAL system table: */ ia64_sal_init(efi.sal_systab); +#endif #ifdef CONFIG_SMP #ifdef XEN @@ -585,10 +585,6 @@ late_setup_arch (char **cmdline_p) printk(KERN_INFO "cpu package is Multi-Threading capable: number of siblings=%d\n", smp_num_siblings); -#endif - -#ifdef XEN - identify_vmx_feature(); #endif cpu_init(); /* initialize the bootstrap CPU */ @@ -803,12 +799,6 @@ identify_cpu (struct cpuinfo_ia64 *c) } c->unimpl_va_mask = ~((7L<<61) | ((1L << (impl_va_msb + 1)) - 1)); c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1)); - -#ifdef XEN - /* If vmx feature is on, do necessary initialization for vmx */ - if (vmx_enabled) - vmx_init_env(); -#endif } void diff -r af3550f53874 -r a739d3edc185 xen/arch/ia64/vmx/vmx_init.c --- a/xen/arch/ia64/vmx/vmx_init.c Thu Jan 17 12:05:43 2008 -0700 +++ b/xen/arch/ia64/vmx/vmx_init.c Thu Jan 17 12:05:43 2008 -0700 @@ -56,7 +56,6 @@ /* Global flag to identify whether Intel vmx feature is on */ u32 vmx_enabled = 0; -static u32 vm_order; static u64 buffer_size; static u64 vp_env_info; static u64 vm_buffer = 0; /* Buffer required to bring up VMX feature */ @@ -97,8 +96,7 @@ identify_vmx_feature(void) /* Does xen has ability to decode itself? */ if (!(vp_env_info & VP_OPCODE)) printk("WARNING: no opcode provided from hardware(%lx)!!!\n", vp_env_info); - vm_order = get_order(buffer_size); - printk("vm buffer size: %ld, order: %d\n", buffer_size, vm_order); + printk("vm buffer size: %ld\n", buffer_size); vmx_enabled = 1; no_vti: @@ -110,16 +108,33 @@ no_vti: * vsa_base is the indicator whether it's first LP to be initialized * for current domain. */ -void -vmx_init_env(void) +void* +vmx_init_env(void *start, unsigned long end_in_pa) { u64 status, tmp_base; if (!vm_buffer) { - vm_buffer = (unsigned long)alloc_xenheap_pages(vm_order); - ASSERT(vm_buffer); - vm_buffer = virt_to_xenva((vm_buffer)); - printk("vm_buffer: 0x%lx\n", vm_buffer); + /* VM buffer must must be 4K aligned and + * must be pinned by both itr and dtr. */ +#define VM_BUFFER_ALIGN (4 * 1024) +#define VM_BUFFER_ALIGN_UP(x) (((x) + (VM_BUFFER_ALIGN - 1)) & \ + ~(VM_BUFFER_ALIGN - 1)) + unsigned long s_vm_buffer = + VM_BUFFER_ALIGN_UP((unsigned long)start); + unsigned long e_vm_buffer = s_vm_buffer + buffer_size; + if (__pa(e_vm_buffer) < end_in_pa) { + init_xenheap_pages(__pa(start), __pa(s_vm_buffer)); + start = (void*)e_vm_buffer; + vm_buffer = virt_to_xenva(s_vm_buffer); + printk("vm_buffer: 0x%lx\n", vm_buffer); + } else { + printk("Can't allocate vm_buffer " + "start 0x%p end_in_pa 0x%lx " + "buffer_size 0x%lx\n", + start, end_in_pa, buffer_size); + vmx_enabled = 0; + return start; + } } status=ia64_pal_vp_init_env(__vsa_base ? VP_INIT_ENV : VP_INIT_ENV_INITALIZE, @@ -129,7 +144,8 @@ vmx_init_env(void) if (status != PAL_STATUS_SUCCESS) { printk("ia64_pal_vp_init_env failed.\n"); - return ; + vmx_enabled = 0; + return start; } if (!__vsa_base) @@ -137,6 +153,7 @@ vmx_init_env(void) else ASSERT(tmp_base == __vsa_base); + return start; } typedef union { diff -r af3550f53874 -r a739d3edc185 xen/arch/ia64/xen/xensetup.c --- a/xen/arch/ia64/xen/xensetup.c Thu Jan 17 12:05:43 2008 -0700 +++ b/xen/arch/ia64/xen/xensetup.c Thu Jan 17 12:05:43 2008 -0700 @@ -30,6 +30,7 @@ #include <xen/rcupdate.h> #include <xsm/acm/acm_hooks.h> #include <asm/sn/simulator.h> +#include <linux/asm/sal.h> unsigned long xenheap_phys_end, total_pages; @@ -456,6 +457,16 @@ void __init start_kernel(void) trap_init(); + /* process SAL system table */ + /* must be before any pal/sal call */ + ia64_sal_init(efi.sal_systab); + + /* early_setup_arch() maps PAL code. */ + identify_vmx_feature(); + /* If vmx feature is on, do necessary initialization for vmx */ + if (vmx_enabled) + xen_heap_start = vmx_init_env(xen_heap_start, xenheap_phys_end); + init_xenheap_pages(__pa(xen_heap_start), xenheap_phys_end); printk("Xen heap: %luMB (%lukB)\n", (xenheap_phys_end-__pa(xen_heap_start)) >> 20, diff -r af3550f53874 -r a739d3edc185 xen/include/asm-ia64/vmx.h --- a/xen/include/asm-ia64/vmx.h Thu Jan 17 12:05:43 2008 -0700 +++ b/xen/include/asm-ia64/vmx.h Thu Jan 17 12:05:43 2008 -0700 @@ -29,7 +29,7 @@ extern void identify_vmx_feature(void); extern unsigned int vmx_enabled; -extern void vmx_init_env(void); +extern void *vmx_init_env(void *start, unsigned long end_in_pa); extern int vmx_final_setup_guest(struct vcpu *v); extern void vmx_save_state(struct vcpu *v); extern void vmx_load_state(struct vcpu *v); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |