Chuck Anderson
2009-Aug-20 15:30 UTC
[Xen-devel] __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers
Do the guest virtual addresses passed by a hypervisor call on a 32-bit HVM with PV drivers guest to a 64-bit hypervisor need to lie below __HYPERVISOR_COMPAT_VIRT_START? Both HVM and PVM domains have their hv_compat_vstart set to __HYPERVISOR_COMPAT_VIRT_START. The hypervisor''s compat layer is causing the balloon driver''s HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation) hypervisor call to error out in xen/common/compat/memory.c compat_memory_op(), compat_handle_ok(), because the PVHVM guest''s extent_start lies above __HYPERVISOR_COMPAT_VIRT_START. The following patch appears to fix the problem but I want to make sure it is fixing the real bug: diff -up xen-3.4.0/xen/arch/x86/domain.c.orig xen-3.4.0/xen/arch/x86/domain.c --- xen-3.4.0/xen/arch/x86/domain.c.orig 2009-08-18 13:09:30.000000000 -0700 +++ xen-3.4.0/xen/arch/x86/domain.c 2009-08-18 14:55:08.000000000 -0700 @@ -428,7 +428,12 @@ int arch_domain_create(struct domain *d, #endif /* __x86_64__ */ #ifdef CONFIG_COMPAT - HYPERVISOR_COMPAT_VIRT_START(d) = __HYPERVISOR_COMPAT_VIRT_START; + if (is_hvm_domain(d)) { + HYPERVISOR_COMPAT_VIRT_START(d) = __HYPERVISOR_COMPAT_VIRT_START_NONE; + } + else { + HYPERVISOR_COMPAT_VIRT_START(d) = __HYPERVISOR_COMPAT_VIRT_START; + } #endif if ( (rc = paging_domain_init(d)) != 0 ) diff -up xen-3.4.0/xen/include/asm-x86/config.h.orig xen-3.4.0/xen/include/asm-x86/config.h --- xen-3.4.0/xen/include/asm-x86/config.h.orig 2009-08-18 13:22:16.000000000 -0700 +++ xen-3.4.0/xen/include/asm-x86/config.h 2009-08-18 14:54:40.000000000 -0700 @@ -228,6 +228,7 @@ extern unsigned int video_mode, video_fl #ifndef __ASSEMBLY__ +#define __HYPERVISOR_COMPAT_VIRT_START_NONE 0xFFFFFFFF /* This is not a fixed value, just a lower limit. */ #define __HYPERVISOR_COMPAT_VIRT_START 0xF5800000 #define HYPERVISOR_COMPAT_VIRT_START(d) ((d)->arch.hv_compat_vstart) Thanks, Chuck _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Aug-20 16:27 UTC
Re: [Xen-devel] __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers
On 20/08/2009 16:30, "Chuck Anderson" <chuck.anderson@oracle.com> wrote:> Do the guest virtual addresses passed by a hypervisor call on a 32-bit > HVM with PV drivers guest to a 64-bit hypervisor need to lie below > __HYPERVISOR_COMPAT_VIRT_START? Both HVM and PVM domains have their > hv_compat_vstart set to __HYPERVISOR_COMPAT_VIRT_START. The > hypervisor''s compat layer is causing the balloon driver''s > HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation) > hypervisor call to error out in xen/common/compat/memory.c > compat_memory_op(), compat_handle_ok(), because the PVHVM guest''s > extent_start lies above __HYPERVISOR_COMPAT_VIRT_START. The following > patch appears to fix the problem but I want to make sure it is fixing > the real bug:Yeah, you pretty much have it figured. I may just clean up for style (I think an extra macro for this is a bit pointless), but the patch is fundamentally good. Thanks, Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Aug-20 17:37 UTC
Re: [Xen-devel] __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers
On 20/08/2009 17:27, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:>> Do the guest virtual addresses passed by a hypervisor call on a 32-bit >> HVM with PV drivers guest to a 64-bit hypervisor need to lie below >> __HYPERVISOR_COMPAT_VIRT_START? Both HVM and PVM domains have their >> hv_compat_vstart set to __HYPERVISOR_COMPAT_VIRT_START. The >> hypervisor''s compat layer is causing the balloon driver''s >> HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation) >> hypervisor call to error out in xen/common/compat/memory.c >> compat_memory_op(), compat_handle_ok(), because the PVHVM guest''s >> extent_start lies above __HYPERVISOR_COMPAT_VIRT_START. The following >> patch appears to fix the problem but I want to make sure it is fixing >> the real bug: > > Yeah, you pretty much have it figured. I may just clean up for style (I > think an extra macro for this is a bit pointless), but the patch is > fundamentally good.Take a look at xen-unstable.hg:20101 -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Chuck Anderson
2009-Aug-20 20:48 UTC
Re: [Xen-devel] __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers
Signed-off-by: Chuck Anderson I booted a 3.4.0 based hypervisor with changeset 20101 applied and verified that it resolved the problem. Chuck Keir Fraser wrote: On 20/08/2009 17:27, "Keir Fraser" wrote: Do the guest virtual addresses passed by a hypervisor call on a 32-bit HVM with PV drivers guest to a 64-bit hypervisor need to lie below __HYPERVISOR_COMPAT_VIRT_START? Both HVM and PVM domains have their hv_compat_vstart set to __HYPERVISOR_COMPAT_VIRT_START. The hypervisor''s compat layer is causing the balloon driver''s HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation) hypervisor call to error out in xen/common/compat/memory.c compat_memory_op(), compat_handle_ok(), because the PVHVM guest''s extent_start lies above __HYPERVISOR_COMPAT_VIRT_START. The following patch appears to fix the problem but I want to make sure it is fixing the real bug: Yeah, you pretty much have it figured. I may just clean up for style (I think an extra macro for this is a bit pointless), but the patch is fundamentally good. Take a look at xen-unstable.hg:20101 -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel