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 <zide.chen@intel.com>
This commit is contained in:
Zide Chen 2018-05-08 11:05:44 -07:00 committed by lijinxia
parent ff34975d1f
commit ec2084a8a8

View File

@ -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 */