From 1ca8af08dfa46a8b3c376e0bd1b74ccde579f48d Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Thu, 15 Dec 2022 17:03:45 +0100 Subject: [PATCH] p2m-pt: avoid hard-coding Xen's PAT 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 Acked-by: Jan Beulich --- 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 eaba2b0fb4..cd1af33b67 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -99,13 +99,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; } }