mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tian Zheng <zhengtian10@huawei.com>
To: Leonardo Bras <leo.bras@arm.com>
Cc: <maz@kernel.org>, <oupton@kernel.org>, <catalin.marinas@arm.com>,
	<corbet@lwn.net>, <pbonzini@redhat.com>, <will@kernel.org>,
	<yuzenghui@huawei.com>, <wangzhou1@hisilicon.com>,
	<liuyonglong@huawei.com>, <Jonathan.Cameron@huawei.com>,
	<yezhenyu2@huawei.com>, <linuxarm@huawei.com>,
	<joey.gouly@arm.com>, <kvmarm@lists.linux.dev>,
	<kvm@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<skhan@linuxfoundation.org>, <suzuki.poulose@arm.com>
Subject: Re: [PATCH] arm64/kvm: Enable eager hugepage splitting if HDBSS is available
Date: Fri, 27 Mar 2026 15:40:30 +0800	[thread overview]
Message-ID: <6cce203f-89d9-4e9d-8b28-9629eb53b180@huawei.com> (raw)
In-Reply-To: <acQna2hLwdr1juTN@devkitleo>


On 3/26/2026 2:20 AM, Leonardo Bras wrote:
> FEAT_HDBSS speeds up guest memory dirty tracking by avoiding a page fault
> and saving the entry in a tracking structure.
>
> That may be a problem when we have guest memory backed by hugepages or
> transparent huge pages, as it's not possible to do on-demand hugepage
> splitting, relying only on eager hugepage splitting.
>
> So, at stage2 initialization, enable eager hugepage splitting with
> chunk = PAGE_SIZE if the system supports HDBSS.
>
> Signed-off-by: Leonardo Bras <leo.bras@arm.com>
> ---
>   arch/arm64/kvm/mmu.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index 070a01e53fcb..bdfa72b7c073 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -993,22 +993,26 @@ int kvm_init_stage2_mmu(struct kvm *kvm, struct kvm_s2_mmu *mmu, unsigned long t
>   
>   	mmu->last_vcpu_ran = alloc_percpu(typeof(*mmu->last_vcpu_ran));
>   	if (!mmu->last_vcpu_ran) {
>   		err = -ENOMEM;
>   		goto out_destroy_pgtable;
>   	}
>   
>   	for_each_possible_cpu(cpu)
>   		*per_cpu_ptr(mmu->last_vcpu_ran, cpu) = -1;
>   
> -	 /* The eager page splitting is disabled by default */
> -	mmu->split_page_chunk_size = KVM_ARM_EAGER_SPLIT_CHUNK_SIZE_DEFAULT;
> +	 /* The eager page splitting is disabled by default if system has no HDBSS */
> +	if (system_supports_hacdbs())
> +		mmu->split_page_chunk_size = PAGE_SIZE;
> +	else
> +		mmu->split_page_chunk_size = KVM_ARM_EAGER_SPLIT_CHUNK_SIZE_DEFAULT;
> +
>   	mmu->split_page_cache.gfp_zero = __GFP_ZERO;
>   
>   	mmu->pgd_phys = __pa(pgt->pgd);
>   
>   	if (kvm_is_nested_s2_mmu(kvm, mmu))
>   		kvm_init_nested_s2_mmu(mmu);
>   
>   	return 0;
>   
>   out_destroy_pgtable:


Thanks again for sending this patch. I'll integrate it into the next 
version and run some tests.



  reply	other threads:[~2026-03-27  7:40 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25  4:04 [PATCH v3 0/5] Support the FEAT_HDBSS introduced in Armv9.5 Tian Zheng
2026-02-25  4:04 ` [PATCH v3 1/5] arm64/sysreg: Add HDBSS related register information Tian Zheng
2026-02-25  4:04 ` [PATCH v3 2/5] KVM: arm64: Add support to set the DBM attr during memory abort Tian Zheng
2026-02-25  4:04 ` [PATCH v3 3/5] KVM: arm64: Add support for FEAT_HDBSS Tian Zheng
2026-06-01  0:50   ` Inochi Amaoto
2026-06-01  8:58     ` Marc Zyngier
2026-06-01  9:05       ` Inochi Amaoto
2026-06-05  8:29         ` Tian Zheng
2026-07-06 14:01           ` Leonardo Bras
2026-07-07  6:11             ` Tian Zheng
2026-07-07 10:07               ` Leonardo Bras
2026-02-25  4:04 ` [PATCH v3 4/5] KVM: arm64: Enable HDBSS support and handle HDBSSF events Tian Zheng
2026-02-25 17:46   ` Leonardo Bras
2026-02-27 10:47     ` Tian Zheng
2026-02-27 14:10       ` Leonardo Bras
2026-03-04  3:06         ` Tian Zheng
2026-03-04 12:08           ` Leonardo Bras
2026-03-05  7:37             ` Tian Zheng
2026-03-04 15:40   ` Leonardo Bras
2026-03-06  9:27     ` Tian Zheng
2026-03-06 15:01       ` Leonardo Bras
2026-03-12  6:17         ` Tian Zheng
2026-03-12 12:06           ` Leonardo Bras
2026-03-12 13:13             ` Tian Zheng
2026-03-12 14:58               ` Leonardo Bras
2026-03-25 18:05   ` Leonardo Bras
2026-03-25 18:20     ` [PATCH] arm64/kvm: Enable eager hugepage splitting if HDBSS is available Leonardo Bras
2026-03-27  7:40       ` Tian Zheng [this message]
2026-03-27 14:37         ` Leonardo Bras
2026-03-26 14:31     ` [PATCH v3 4/5] KVM: arm64: Enable HDBSS support and handle HDBSSF events Leonardo Bras
2026-03-27  7:35     ` Tian Zheng
2026-03-27 15:00       ` Leonardo Bras
2026-03-28  6:05         ` Tian Zheng
2026-03-30 11:31           ` Leonardo Bras
2026-04-21 14:18             ` Leonardo Bras
2026-04-24  6:48               ` Tian Zheng
2026-04-24 10:08                 ` Leonardo Bras
2026-02-25  4:04 ` [PATCH v3 5/5] KVM: arm64: Document HDBSS ioctl Tian Zheng
2026-03-31 14:13 ` [PATCH v3 0/5] Support the FEAT_HDBSS introduced in Armv9.5 Leonardo Bras
2026-04-02  2:40   ` Tian Zheng
2026-04-02 12:42     ` Leonardo Bras
2026-05-19 15:23 ` Will Deacon
2026-05-19 15:35   ` Leonardo Bras
2026-05-20  8:51   ` Tian Zheng

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=6cce203f-89d9-4e9d-8b28-9629eb53b180@huawei.com \
    --to=zhengtian10@huawei.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=leo.bras@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=skhan@linuxfoundation.org \
    --cc=suzuki.poulose@arm.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=will@kernel.org \
    --cc=yezhenyu2@huawei.com \
    --cc=yuzenghui@huawei.com \
    /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 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®