/
0302-x86-mm-shadow-do-not-open-code-PAGE_CACHE_ATTRS.patch
49 lines (43 loc) · 1.82 KB
/
0302-x86-mm-shadow-do-not-open-code-PAGE_CACHE_ATTRS.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From a6da84524ceaf24ff997d03407b93f60c12857f3 Mon Sep 17 00:00:00 2001
From: Demi Marie Obenour <demi@invisiblethingslab.com>
Date: Tue, 6 Dec 2022 13:55:07 +0100
Subject: [PATCH 2/9] x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS
To: xen-devel@lists.xenproject.org
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
Wei Liu <wl@xen.org>,
Jun Nakajima <jun.nakajima@intel.com>,
Kevin Tian <kevin.tian@intel.com>,
George Dunlap <george.dunlap@citrix.com>,
Tim Deegan <tim@xen.org>
This makes the code easier to understand.
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
xen/arch/x86/mm/shadow/multi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 4e94fec3d50cde0e5a26ecb62ff4d00dd00f759d..6bb564b0145285afc93b72a60b7797fcfe8696dc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -535,7 +535,7 @@ _sh_propagate(struct vcpu *v,
if ( guest_nx_enabled(v) )
pass_thru_flags |= _PAGE_NX_BIT;
if ( level == 1 && !shadow_mode_refcounts(d) && mmio_mfn )
- pass_thru_flags |= _PAGE_PAT | _PAGE_PCD | _PAGE_PWT;
+ pass_thru_flags |= PAGE_CACHE_ATTRS;
sflags = gflags & pass_thru_flags;
/*
@@ -548,7 +548,7 @@ _sh_propagate(struct vcpu *v,
{
int type;
- ASSERT(!(sflags & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)));
+ ASSERT(!(sflags & PAGE_CACHE_ATTRS));
/* compute the PAT index for shadow page entry when VT-d is enabled
* and device assigned.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab