# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1175755484 -32400 # Node ID 87bbc448daccd04dfe6d4b7c6e9052165fbd847b # Parent f378c424e0ced4cbc584e5c6125d065f1cc05d0c fix xm dump-core . Share privregs with domain and assign it to pseudo physical address space as para virtualized domain. PATCHNAME: fix_xm_dump_core_domvti Signed-off-by: Isaku Yamahata diff -r f378c424e0ce -r 87bbc448dacc tools/libxc/xc_core_ia64.c --- a/tools/libxc/xc_core_ia64.c Tue Apr 03 13:04:51 2007 -0600 +++ b/tools/libxc/xc_core_ia64.c Thu Apr 05 15:44:44 2007 +0900 @@ -93,6 +93,7 @@ memory_map_get_old_hvm(int xc_handle, xc {IO_PAGE_START, IO_PAGE_SIZE}, {STORE_PAGE_START, STORE_PAGE_SIZE}, {BUFFER_IO_PAGE_START, BUFFER_IO_PAGE_SIZE}, + {BUFFER_PIO_PAGE_START, BUFFER_PIO_PAGE_SIZE}, {GFW_START, GFW_SIZE}, }; const unsigned int nr_gfw_map = sizeof(gfw_map)/sizeof(gfw_map[0]); diff -r f378c424e0ce -r 87bbc448dacc xen/arch/ia64/vmx/vmx_init.c --- a/xen/arch/ia64/vmx/vmx_init.c Tue Apr 03 13:04:51 2007 -0600 +++ b/xen/arch/ia64/vmx/vmx_init.c Thu Apr 05 15:44:44 2007 +0900 @@ -301,6 +301,7 @@ vmx_final_setup_guest(struct vcpu *v) ASSERT(vpd); v->arch.privregs = (mapped_regs_t *)vpd; + vcpu_share_privregs_with_guest(v); vpd->vpd_low.virt_env_vaddr = vm_buffer; /* Per-domain vTLB and vhpt implementation. Now vmx domain will stick diff -r f378c424e0ce -r 87bbc448dacc xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Tue Apr 03 13:04:51 2007 -0600 +++ b/xen/arch/ia64/xen/domain.c Thu Apr 05 15:44:44 2007 +0900 @@ -446,22 +446,12 @@ int vcpu_initialise(struct vcpu *v) return 0; } -int vcpu_late_initialise(struct vcpu *v) +void vcpu_share_privregs_with_guest(struct vcpu *v) { struct domain *d = v->domain; - int rc, order, i; - - if (HAS_PERVCPU_VHPT(d)) { - rc = pervcpu_vhpt_alloc(v); - if (rc != 0) - return rc; - } - - /* Create privregs page. */ - order = get_order_from_shift(XMAPPEDREGS_SHIFT); - v->arch.privregs = alloc_xenheap_pages(order); - BUG_ON(v->arch.privregs == NULL); - memset(v->arch.privregs, 0, 1 << XMAPPEDREGS_SHIFT); + int i; + int order = get_order_from_shift(XMAPPEDREGS_SHIFT); + for (i = 0; i < (1 << order); i++) share_xen_page_with_guest(virt_to_page(v->arch.privregs) + i, d, XENSHARE_writable); @@ -474,6 +464,25 @@ int vcpu_late_initialise(struct vcpu *v) for (i = 0; i < XMAPPEDREGS_SIZE; i += PAGE_SIZE) assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i, virt_to_maddr(v->arch.privregs + i)); +} + +int vcpu_late_initialise(struct vcpu *v) +{ + struct domain *d = v->domain; + int rc, order; + + if (HAS_PERVCPU_VHPT(d)) { + rc = pervcpu_vhpt_alloc(v); + if (rc != 0) + return rc; + } + + /* Create privregs page. */ + order = get_order_from_shift(XMAPPEDREGS_SHIFT); + v->arch.privregs = alloc_xenheap_pages(order); + BUG_ON(v->arch.privregs == NULL); + memset(v->arch.privregs, 0, 1 << XMAPPEDREGS_SHIFT); + vcpu_share_privregs_with_guest(v); return 0; } diff -r f378c424e0ce -r 87bbc448dacc xen/include/asm-ia64/domain.h --- a/xen/include/asm-ia64/domain.h Tue Apr 03 13:04:51 2007 -0600 +++ b/xen/include/asm-ia64/domain.h Thu Apr 05 15:44:44 2007 +0900 @@ -21,6 +21,7 @@ extern void domain_relinquish_resources( extern void domain_relinquish_resources(struct domain *); struct vcpu; extern void relinquish_vcpu_resources(struct vcpu *v); +extern void vcpu_share_privregs_with_guest(struct vcpu *v); extern int vcpu_late_initialise(struct vcpu *v); /* given a current domain metaphysical address, return the physical address */