[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/mem_sharing: Rectify test for "empty" physmap entry in sharing_add_to_physmap


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
  • Date: Wed, 18 Apr 2012 09:06:40 -0400
  • Cc: andres@xxxxxxxxxxxxxx, tim@xxxxxxx
  • Delivery-date: Wed, 18 Apr 2012 13:01:44 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=content-type :mime-version:content-transfer-encoding:subject:message-id:date :from:to:cc; q=dns; s=lagarcavilla.org; b=HWhKLeDprlC99MPFEVKgZv BuFXI/j+QcKYev0fd2HYfa7ZPVKhLnan4gvGsCtp4xkxEQH+z8fAd7yOsaGzJIFw P2M45+DoP/FcF24KBDccyFE9dTSmGZrOzhibtIrFAFRZBiEniIgBtcXFxQaFHMHT Lou1lJhHSF60Y+jV6z1BA=
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

 xen/arch/x86/mm/mem_sharing.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

diff -r 8609bbbba141 -r 495d3df95c1d xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1073,9 +1073,11 @@ int mem_sharing_add_to_physmap(struct do
     if ( spage->sharing->handle != sh )
         goto err_unlock;
 
-    /* Make sure the target page is a hole in the physmap */
+    /* Make sure the target page is a hole in the physmap. This is not as
+     * simple a test as we'd like it to be. Non-existent p2m entries return
+     * invalid mfn and p2m_mmio_dm type when queried. */
     if ( mfn_valid(cmfn) ||
-         (!(p2m_is_ram(cmfn_type))) )
+         ( (!(p2m_is_ram(cmfn_type))) && (cmfn_type != p2m_mmio_dm) ) )
     {
         ret = XENMEM_SHARING_OP_C_HANDLE_INVALID;
         goto err_unlock;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.