From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Haseeb Ashraf <haseeb.ashraf@siemens.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
Dan Driscoll <dan.driscoll@siemens.com>,
Noor Ahsan Khawaja <noor.ahsan@siemens.com>,
Fahad Arslan <fahad.arslan@siemens.com>,
Andrew Bachtel <andrew.bachtel@siemens.com>
Subject: [PATCH 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is
Date: Mon, 8 Dec 2025 18:55:13 +0500 [thread overview]
Message-ID: <cover.1765197209.git.haseeb.ashraf@siemens.com> (raw)
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
WARNING: multiple messages have this Message-ID (diff)
From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Haseeb Ashraf <haseeb.ashraf@siemens.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Michal Orzel <michal.orzel@amd.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN PATCH v3 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is known
Date: Sun, 18 Jan 2026 18:33:26 +0500 [thread overview]
Message-ID: <cover.1765197209.git.haseeb.ashraf@siemens.com> (raw)
Message-ID: <20260118133326.ssx04LcGo2FJpvGDDQwBHacJ1FvuSE4J97n7Y-RiyUM@z> (raw)
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
next reply other threads:[~2025-12-08 13:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 13:55 Haseeb Ashraf [this message]
2026-01-18 13:33 ` [XEN PATCH v3 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is known 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1765197209.git.haseeb.ashraf@siemens.com \
--to=haseebashraf091@gmail.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.bachtel@siemens.com \
--cc=bertrand.marquis@arm.com \
--cc=dan.driscoll@siemens.com \
--cc=fahad.arslan@siemens.com \
--cc=haseeb.ashraf@siemens.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=noor.ahsan@siemens.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.