forked from QubesOS/qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch-0003-p2m-pt-Avoid-hard-coding-Xen-s-PAT.patch
45 lines (40 loc) · 1.71 KB
/
patch-0003-p2m-pt-Avoid-hard-coding-Xen-s-PAT.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
From 4e615cf660d98b70728ccb2954f208dff4362beb Mon Sep 17 00:00:00 2001
Message-Id: <4e615cf660d98b70728ccb2954f208dff4362beb.1671771766.git.demi@invisiblethingslab.com>
In-Reply-To: <[email protected]>
References: <[email protected]>
From: Demi Marie Obenour <[email protected]>
Date: Thu, 15 Dec 2022 17:03:45 +0100
Subject: [PATCH 03/10] p2m-pt: Avoid hard-coding Xen's PAT
Cc: Marek Marczykowski-Górecki <[email protected]>
This makes the code much easier to understand. No functional change
intended. As per Andrew Cooper, the existing logic is questionable, but
this does not make it any worse.
Signed-off-by: Demi Marie Obenour <[email protected]>
Acked-by: Jan Beulich <[email protected]>
---
xen/arch/x86/mm/p2m-pt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index 28d18758204503ca624b4352ef49351a2efff71f..c0edd8d99d05bf5cab0627cad1142c074f002df1 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -98,13 +98,13 @@ static unsigned long p2m_type_to_flags(const struct p2m_domain *p2m,
return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT;
case p2m_mmio_direct:
if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) )
- flags |= _PAGE_RW;
+ flags |= _PAGE_RW | _PAGE_UCM;
else
{
- flags |= _PAGE_PWT;
+ flags |= _PAGE_UC;
ASSERT(!level);
}
- return flags | P2M_BASE_FLAGS | _PAGE_PCD;
+ return flags | P2M_BASE_FLAGS;
}
}
--
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab