e4ae845
From: Jan Beulich <jbeulich@suse.com>
e4ae845
Subject: memory: don't implicitly unpin for decrease-reservation
e4ae845
e4ae845
It very likely was a mistake (copy-and-paste from domain cleanup code)
e4ae845
to implicitly unpin here: The caller should really unpin itself before
e4ae845
(or after, if they so wish) requesting the page to be removed.
e4ae845
e4ae845
This is XSA-252.
e4ae845
e4ae845
Reported-by: Jann Horn <jannh@google.com>
e4ae845
Signed-off-by: Jan Beulich <jbeulich@suse.com>
e4ae845
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
e4ae845
e4ae845
--- a/xen/common/memory.c
e4ae845
+++ b/xen/common/memory.c
e4ae845
@@ -341,9 +341,6 @@ int guest_remove_page(struct domain *d,
e4ae845
 
e4ae845
     rc = guest_physmap_remove_page(d, _gfn(gmfn), mfn, 0);
e4ae845
 
e4ae845
-    if ( !rc && test_and_clear_bit(_PGT_pinned, &page->u.inuse.type_info) )
e4ae845
-        put_page_and_type(page);
e4ae845
-
e4ae845
     /*
e4ae845
      * With the lack of an IOMMU on some platforms, domains with DMA-capable
e4ae845
      * device must retrieve the same pfn when the hypercall populate_physmap