[PATCH 0/2] x86/ept: batch PML type-changes into single locked region

Roger Pau Monne posted 2 patches 3 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250715074559.73197-1-roger.pau@citrix.com
xen/arch/x86/hvm/vmx/vmcs.c             | 59 +---------------------
xen/arch/x86/hvm/vmx/vmx.c              |  2 +-
xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  1 -
xen/arch/x86/include/asm/hvm/vmx/vmx.h  |  1 +
xen/arch/x86/mm/p2m-ept.c               | 65 +++++++++++++++++++++++++
5 files changed, 69 insertions(+), 59 deletions(-)
[PATCH 0/2] x86/ept: batch PML type-changes into single locked region
Posted by Roger Pau Monne 3 months, 2 weeks ago
Hello,

Following series attempts to batch PML related type-changes into a
single locked region, so that the lock is not individually taken for
each gfn that requires changing, and to also defer the EPT flush until
all type-changes are done.  Doing an EPT flush for each gfn changed is
extremely wasteful

First patch moves the implementation of vmx_domain_flush_pml_buffers()
into the EPT file, so it has access to the mm locking primitives.  Patch
2 introduces p2m locking around the type change loop.

PML related code is already split between EPT and VMX, it could
certainly do with some cleanup.  The patch here doesn't make things
better, but I don't think it makes them any worse either.

Thanks, Roger.

Roger Pau Monne (2):
  x86/ept: move vmx_domain_flush_pml_buffers() to p2m-ept.c
  x86/ept: batch PML p2m type-changes into single locked region

 xen/arch/x86/hvm/vmx/vmcs.c             | 59 +---------------------
 xen/arch/x86/hvm/vmx/vmx.c              |  2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  1 -
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  |  1 +
 xen/arch/x86/mm/p2m-ept.c               | 65 +++++++++++++++++++++++++
 5 files changed, 69 insertions(+), 59 deletions(-)

-- 
2.49.0