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

[Xen-changelog] [xen master] xen/p2m: Fix p2m_flush_table for non-nested cases



commit 6192e6378e094094906950120470a621d5b2977c
Author:     George Dunlap <george.dunlap@xxxxxxxxxx>
AuthorDate: Wed Feb 15 17:13:22 2017 +0000
Commit:     George Dunlap <george.dunlap@xxxxxxxxxx>
CommitDate: Wed Feb 15 17:15:56 2017 +0000

    xen/p2m: Fix p2m_flush_table for non-nested cases
    
    Commit 71bb7304e7a7a35ea6df4b0cedebc35028e4c159 added flushing of
    nested p2m tables whenever the host p2m table changed.  Unfortunately
    in the process, it added a filter to p2m_flush_table() function so
    that the p2m would only be flushed if it was being used as a nested
    p2m.  This meant that the p2m was not being flushed at all for altp2m
    callers.
    
    Only check np2m_base if p2m_class for nested p2m's.
    
    NB that this is not a security issue: The only time this codepath is
    called is in cases where either nestedp2m or altp2m is enabled, and
    neither of them are in security support.
    
    Reported-by: Matt Leinhos <matt@xxxxxxxxxx>
    Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Reviewed-by: Tim Deegan <tim@xxxxxxx>
    Tested-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index db33153..0c1820e 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1618,7 +1618,8 @@ p2m_flush_table(struct p2m_domain *p2m)
     ASSERT(page_list_empty(&p2m->pod.super));
     ASSERT(page_list_empty(&p2m->pod.single));
 
-    if ( p2m->np2m_base == P2M_BASE_EADDR )
+    /* No need to flush if it's already empty */
+    if ( p2m_is_nestedp2m(p2m) && p2m->np2m_base == P2M_BASE_EADDR )
     {
         p2m_unlock(p2m);
         return;
--
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®.