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

[Xen-changelog] [xen staging-4.11] p2m/ept: pass correct level to atomic_write_ept_entry in ept_invalidate_emt



commit 802f9940fe9ba80253a3e8b652ae9f6f21703993
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Sep 23 14:39:37 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 23 14:39:37 2019 +0200

    p2m/ept: pass correct level to atomic_write_ept_entry in ept_invalidate_emt
    
    The level passed to ept_invalidate_emt corresponds to the EPT entry
    passed as the mfn parameter, which is a pointer to an EPT page table,
    hence the entries in that page table will have one level less than the
    parent.
    
    Fix the call to atomic_write_ept_entry to pass the correct level, ie:
    one level less than the parent.
    
    Fixes: 50fe6e73705 ('pvh dom0: add and remove foreign pages')
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>.
    master commit: b806c91275fb1ab7696ebf033b56631693056c90
    master date: 2019-08-28 16:57:36 +0200
---
 xen/arch/x86/mm/p2m-ept.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 14b593923b..ce46201d45 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -389,7 +389,8 @@ static int ept_next_level(struct p2m_domain *p2m, bool_t 
read_only,
  * present entries in the given page table, optionally marking the entries
  * also for their subtrees needing P2M type re-calculation.
  */
-static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc, int level)
+static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc,
+                                 unsigned int parent_level)
 {
     int rc;
     ept_entry_t *epte = map_domain_page(mfn);
@@ -407,7 +408,7 @@ static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc, 
int level)
         e.emt = MTRR_NUM_TYPES;
         if ( recalc )
             e.recalc = 1;
-        rc = atomic_write_ept_entry(&epte[i], e, level);
+        rc = atomic_write_ept_entry(&epte[i], e, parent_level - 1);
         ASSERT(rc == 0);
         changed = 1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.11

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
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®.