All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is
@ 2026-01-18 13:33 ` Haseeb Ashraf
  0 siblings, 0 replies; 25+ messages in thread
From: Haseeb Ashraf @ 2025-12-08 13:55 UTC (permalink / raw)
  To: xen-devel
  Cc: Haseeb Ashraf, Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Michal Orzel, Volodymyr Babchuk, Dan Driscoll, Noor Ahsan Khawaja,
	Fahad Arslan, Andrew Bachtel

From: Haseeb Ashraf <haseeb.ashraf@siemens.com>

This patch series addresses a major issue for running Xen on KVM i.e.
costly emulation of VMALLS12E1IS which becomes worse when this TLBI
is invoked too many times. There are mainly two places where this is
problematic:
(a) When vCPUs switch on a pCPU or pCPUs
(b) When domu mapped pages onto dom0, are to be unmapped, then each
    page being removed by XENMEM_remove_from_physmap has its TLBs
    invalidated by the TLBI variant that flushes the whole range.

This patch series prefers usage of IPA-based TLBIs wherever possible
instead of complete flushing of TLBs every time.

It consists of three patches where the first one address the issue
being discussed for Arm64. Second patch further optimizes the
combined stage-1,2 TLB flushes by leveraging FEAT_nTLBPA. Third patch
introduces IPA-based TLBI for Arm32 in presence of FEAT_nTLBPA.

Haseeb Ashraf (3):
  xen/arm/p2m: perform IPA-based TLBI when IPA is known
  xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA
  xen/arm32: add CPU capability for IPA-based TLBI

Changes in v3:
- Mainly the handling of repeat TLBI workaround with IPA-based TLBI,
  so that the extra TLBI and DSB are repeated only for the final TLBI
  and DSB of the whole sequence.
- Updated code comments as per feedback. Further details are
  available in each commit's changelog.
- Minor updates to code as per feedback. Further details are
  available in each commit's changelog.

Changes in v2:
- Split up the commit in 3 commits. First commit implements the
  baseline implementation without any addition of new CPU
  capabilities. Implemented new CPU caps in separate features to
  emphasize how each of it optimizes the TLB invalidation.
- Moved ARM32 and ARM64 specific implementations of TLBIs to
  architecture specific flushtlb.h.
- Added references of ARM ARM in code comments.
- Evaluated and added a threshold to select between IPA-based TLB
  invalidation vs fallback to full stage TLB invalidation above
  the threshold.
- Introduced ARM_HAS_NTLBPA CPU capability which leverages
  FEAT_nTLBPA for arm32 as well as arm64.
- Introduced ARM_HAS_TLB_IPA CPU capability for IPA-based TLBI
  for arm32.

Haseeb Ashraf (3):
  xen/arm/p2m: perform IPA-based TLBI when IPA is known
  xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA
  xen/arm32: add CPU capability for IPA-based TLBI

 xen/arch/arm/cpufeature.c                 | 31 ++++++++
 xen/arch/arm/include/asm/arm32/flushtlb.h | 87 +++++++++++++++++++++
 xen/arch/arm/include/asm/arm64/flushtlb.h | 77 +++++++++++++++++++
 xen/arch/arm/include/asm/cpregs.h         |  4 +
 xen/arch/arm/include/asm/cpufeature.h     | 27 ++++++-
 xen/arch/arm/include/asm/mmu/p2m.h        |  2 +
 xen/arch/arm/include/asm/processor.h      | 10 +++
 xen/arch/arm/mmu/p2m.c                    | 92 +++++++++++++++++------
 8 files changed, 302 insertions(+), 28 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-12-01 17:20 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 13:55 [PATCH 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is Haseeb Ashraf
2026-07-21  7:54 ` [XEN][RESEND][PATCH v4 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is known Haseeb Ashraf
2026-01-18 13:33 ` [XEN PATCH v3 " Haseeb Ashraf
2025-12-08 13:55 ` [PATCH 1/3] xen/arm/p2m: " Haseeb Ashraf
2026-01-18 13:33   ` [XEN PATCH v3 " Haseeb Ashraf
2025-12-08 13:55 ` [PATCH 2/3] xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA Haseeb Ashraf
2026-01-18 13:33   ` [XEN PATCH v3 " Haseeb Ashraf
2025-12-08 13:55 ` [PATCH 3/3] xen/arm32: add CPU capability for IPA-based TLBI Haseeb Ashraf
2026-01-18 13:33   ` [XEN PATCH v3 " Haseeb Ashraf
2025-12-16 12:08 ` [PATCH 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is Ashraf, Haseeb
2026-01-06  6:40   ` Ashraf, Haseeb
2026-07-21  7:54 ` [XEN][RESEND][PATCH 1/3] xen/arm/p2m: perform IPA-based TLBI when IPA is known Haseeb Ashraf
2026-07-21  7:54   ` [XEN][RESEND][PATCH 2/3] xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA Haseeb Ashraf
2026-07-21  7:54   ` [XEN][RESEND][PATCH 3/3] xen/arm32: use IPA-based TLBI when supported with FEAT_nTLBPA Haseeb Ashraf
2026-11-22  9:54 ` [XEN][PATCH v5 0/8] xen/arm: narrow stage-2 TLB invalidation and batch physmap updates Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 1/8] xen/arm/p2m: perform IPA-based TLBI when IPA is known Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 2/8] xen/arm: skip the stage-1 TLBI after IPA flush with FEAT_nTLBPA Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 3/8] xen/arm32: use IPA-based TLBI when supported " Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 4/8] xen/arm64: use range TLBI for IPA flush with FEAT_TLBIRANGE Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 5/8] xen/arm: do not flush the TLBs when resolving a translation fault Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 6/8] xen/arm: batch stage-2 removal with range flushes Haseeb Ashraf
2026-11-22  9:54   ` [XEN][PATCH v5 7/8] xen/memory: add XENMEM_remove_from_physmap_batch Haseeb Ashraf
2026-12-01 15:59     ` Jan Beulich
2026-11-22  9:54   ` [XEN][PATCH v5 8/8] xen/memory: copy add_to_physmap batch entries in bulk Haseeb Ashraf
2026-12-01 17:20     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.