mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: x86: Replace magic number with readable macro
@ 2022-03-29  3:01 SU Hang
  2022-03-29  3:01 ` [PATCH v2 1/2] KVM: VMX: replace 0x180 with EPT_VIOLATION_* definition SU Hang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: SU Hang @ 2022-03-29  3:01 UTC (permalink / raw)
  To: seanjc, kvm
  Cc: Lai Jiangshan, SU Hang, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, x86, Paolo Bonzini,
	Radim Krčmář,
	linux-kernel

Replace magic number 0x180 with `EPT_VIOLATION_GVA_IS_VALID | EPT_VIOLATION_GVA_TRANSLATED`
in arch/x86/kvm/mmu/paging_tmpl.h
Similarly, replace `(pte_access & 0x7) << 3` with
`(pte_access & VMX_EPT_RWX_MASK) << EPT_VIOLATION_RWX_SHIFT`.

v1 -> v2: https://lore.kernel.org/kvm/20220321094203.109546-1-darcy.sh@antgroup.com/
- Rename `EPT_VIOLATION_GVA_VALIDATION` to `EPT_VIOLATION_GVA_IS_VALID`. [Sean]
- Using new added `VMX_EPT_RWX_MASK` to replace magic number 0x7 and so on,
  to avoid using branch statement in hotpath. [Sean]

SU Hang (1):
  KVM: VMX:  replace 0x180 with EPT_VIOLATION_* definition

Sean Christopherson (1):
  KVM: x86/mmu: Derive EPT violation RWX bits from EPTE RWX bits

 arch/x86/include/asm/vmx.h     |  9 +++------
 arch/x86/kvm/mmu/paging_tmpl.h | 11 +++++++++--
 arch/x86/kvm/vmx/vmx.c         |  4 +---
 3 files changed, 13 insertions(+), 11 deletions(-)

--
2.32.0.3.g01195cf9f


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-08 21:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29  3:01 [PATCH v2 0/2] KVM: x86: Replace magic number with readable macro SU Hang
2022-03-29  3:01 ` [PATCH v2 1/2] KVM: VMX: replace 0x180 with EPT_VIOLATION_* definition SU Hang
2022-03-29 16:00   ` Sean Christopherson
2022-03-29  3:01 ` [PATCH v2 2/2] KVM: x86/mmu: Derive EPT violation RWX bits from EPTE RWX bits SU Hang
2022-04-08 21:11   ` Isaku Yamahata
2022-04-08 21:32     ` Sean Christopherson
2022-04-08 16:48 ` [PATCH v2 0/2] KVM: x86: Replace magic number with readable macro Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®