All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Anderson <chuck.anderson@oracle.com>
To: xen-devel@lists.xensource.com
Subject: __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers
Date: Thu, 20 Aug 2009 08:30:26 -0700	[thread overview]
Message-ID: <4A8D6C12.90802@oracle.com> (raw)

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

             reply	other threads:[~2009-08-20 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20 15:30 Chuck Anderson [this message]
2009-08-20 16:27 ` __HYPERVISOR_COMPAT_VIRT_START for HVM guest with PV drivers Keir Fraser
2009-08-20 17:37   ` Keir Fraser
2009-08-20 20:48     ` Chuck Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8D6C12.90802@oracle.com \
    --to=chuck.anderson@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.