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

[Xen-devel] [PATCH 2 of 2] x86/mm: Disable paging_prep


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
  • Date: Mon, 09 Jan 2012 16:41:27 -0500
  • Cc: andres@xxxxxxxxxxxxxx, tim@xxxxxxx, olaf@xxxxxxxxx, adin@xxxxxxxxxxxxxx
  • Delivery-date: Mon, 09 Jan 2012 21:38:14 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=content-type :mime-version:content-transfer-encoding:subject:message-id :in-reply-to:references:date:from:to:cc; q=dns; s= lagarcavilla.org; b=c09R37n+OGSVjL9f9ln4RsJpR9I2ugUezKQqpV3/P6Be qd6WGq9x7YaIaVXvfHvBOaCqbvTPEPoUx3bAGobV8FFnXM8F+5OGGjZohWtFoJZI xyNqZ6HCRXiVFEijf10n37vwgppZC4evkr8ismFQMVuWkAIaaUDMy6+kOUVIzJ4=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

 xen/arch/x86/mm/p2m.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>

diff -r f7c330d5b4b5 -r d5e830891ee2 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -989,6 +989,10 @@ int p2m_mem_paging_prep(struct domain *d
     /* Allocate a page if the gfn does not have one yet */
     if ( !mfn_valid(mfn) )
     {
+        /* If the user did not provide a buffer, we disallow */
+        ret = -EINVAL;
+        if ( unlikely(user_ptr == NULL) )
+            goto out;
         /* Get a free page */
         ret = -ENOMEM;
         page = alloc_domheap_page(p2m->domain, 0);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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