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

[Xen-changelog] [xen master] common/vcpu: Fix unintended breakage from cleanup



commit cc6d98d5454b9d289a9e80d71c215da148a09b38
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Feb 17 11:53:44 2017 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Feb 17 13:01:56 2017 +0000

    common/vcpu: Fix unintended breakage from cleanup
    
    c/s 3044a2a "common/vcpu: Switch v->vcpu_info_mfn to mfn_t" was intended to 
be
    no functional change.
    
    Unfortunately, because vcpu_info_reset() clobbers v->vcpu_info_mfn, the 
change
    ended up calling put_page_and_type() on MFN_INVALID.
    
    Reintroduce the local variable, and leave a comment behind.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/domain.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0c52831..4492c9c 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1211,15 +1211,17 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, 
unsigned offset)
  */
 void unmap_vcpu_info(struct vcpu *v)
 {
-    if ( mfn_eq(v->vcpu_info_mfn, INVALID_MFN) )
+    mfn_t mfn = v->vcpu_info_mfn;
+
+    if ( mfn_eq(mfn, INVALID_MFN) )
         return;
 
     unmap_domain_page_global((void *)
                              ((unsigned long)v->vcpu_info & PAGE_MASK));
 
-    vcpu_info_reset(v);
+    vcpu_info_reset(v); /* NB: Clobbers v->vcpu_info_mfn */
 
-    put_page_and_type(mfn_to_page(mfn_x(v->vcpu_info_mfn)));
+    put_page_and_type(mfn_to_page(mfn_x(mfn)));
 }
 
 int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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