Skip to contentSkip to conversation

KVM: VMX: Fix base_ptes for EPT

PATCH In review Sheng Yang 2 participants 3 messages Nov 19, 2008

Subsystems (3)
lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

PATCH 1/1 KVM: VMX: Fix base_ptes for EPT

After support MTRR for EPT, memory type WB shouldn't take as default in base_ptes. (Something wrong during the merging...)

---
 arch/x86/kvm/vmx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +0 -1
index 6619242..ebf5406 100644
@@ -3693,7 +3693,6 @@ static int __init vmx_init(void)
 		bypass_guest_pf = 0;
 		kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK |
 			VMX_EPT_WRITABLE_MASK |
-			VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT |
 			VMX_EPT_IGMT_BIT);
 		kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull,
 				VMX_EPT_EXECUTABLE_MASK,
Signature · 1 line
1.5.4.5
#1 lore raw
Quoted 4 lines · Sheng Yang

After support MTRR for EPT, memory type WB shouldn't take as default in base_ptes. (Something wrong during the merging...)

Yes, my fault.

But don't we still have a big hole here? The guest can set RAM to various attributes, even without device assignment, and create inconsistencies with the qemu and host kernel mapping.

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#2 lore raw
Quoted 9 lines · On Wednesday 19 November 2008 18:25:32 Avi Kivity wrote:
Quoted 2 lines · Sheng Yang

After support MTRR for EPT, memory type WB shouldn't take as default in base_ptes. (Something wrong during the merging...)

Yes, my fault.

But don't we still have a big hole here? The guest can set RAM to various attributes, even without device assignment, and create inconsistencies with the qemu and host kernel mapping.

The current reply from hardware guys is: the only situation that cause MCE is to access MMIO with cacheable memory type, and at least for EPT, they say using different memory type for same memory region don't have problem as far as we know... But for now, the hardware guys suggest to use host MTRR as the base for EPT memory type rather than using guest MTRR, at least it would protect us from MCE. And guest can operate it's PAT then promote UC to WC for performance and use UC for DMA. We are still in discussion to get more details now.

For now, I may try to using host MTRR for EPT as suggested.

Signature · 2 lines
regards
Yang, Sheng