From ec2084a8a8ae1adf8754149d01229d09b0a07b0e Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Tue, 8 May 2018 11:05:44 -0700 Subject: [PATCH] HV: correct the handling of MU_MEM_ATTR_READ MMU flag Currently config_page_table_attr() treats MMU_MEM_ATTR_READ exactly as MMU_MEM_ATTR_BIT_READ_WRITE for PTT_HOST, so even when MMU_MEM_ATTR_WRITE is not used, the R/W bit in PTE is still being set Signed-off-by: Zide Chen --- arch/x86/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mmu.c b/arch/x86/mmu.c index 0d7300aaf..feff904ff 100644 --- a/arch/x86/mmu.c +++ b/arch/x86/mmu.c @@ -587,7 +587,7 @@ uint64_t config_page_table_attr(struct map_params *map_params, uint32_t flags) if (flags & MMU_MEM_ATTR_READ) { /* Configure for read access */ attr |= ((table_type == PTT_EPT) - ? IA32E_EPT_R_BIT : MMU_MEM_ATTR_BIT_READ_WRITE); + ? IA32E_EPT_R_BIT : 0); } /* Check for write access */