mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
Nested p2m: flush only one p2m table when reallocating.
It's unhelpful to flush all of them when we only need one. Reported-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com>
This commit is contained in:
1 parent
7fb0a22e68
commit
625df8ad2f
1 file changed
+3
-7
@@ -1120,7 +1120,6 @@ p2m_get_nestedp2m(struct vcpu *v, uint64_t cr3)
|
||||
volatile struct nestedvcpu *nv = &vcpu_nestedhvm(v);
|
||||
struct domain *d;
|
||||
struct p2m_domain *p2m;
|
||||
int i;
|
||||
|
||||
/* Mask out low bits; this avoids collisions with CR3_EADDR */
|
||||
cr3 &= ~(0xfffull);
|
||||
@@ -1146,12 +1145,9 @@ p2m_get_nestedp2m(struct vcpu *v, uint64_t cr3)
|
||||
}
|
||||
|
||||
/* All p2m's are or were in use. Take the least recent used one,
|
||||
* flush it and reuse.
|
||||
*/
|
||||
for (i = 0; i < MAX_NESTEDP2M; i++) {
|
||||
p2m = p2m_getlru_nestedp2m(d, NULL);
|
||||
p2m_flush_locked(p2m);
|
||||
}
|
||||
* flush it and reuse. */
|
||||
p2m = p2m_getlru_nestedp2m(d, NULL);
|
||||
p2m_flush_locked(p2m);
|
||||
nv->nv_p2m = p2m;
|
||||
p2m->cr3 = cr3;
|
||||
nv->nv_flushp2m = 0;
|
||||
|
||||