From: Leonardo Bras <leo.bras@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Leonardo Bras <leo.bras@arm.com>,
Oliver Upton <oupton@kernel.org>,
Fuad Tabba <fuad.tabba@linux.dev>,
Joey Gouly <joey.gouly@arm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Raghavendra Rao Ananta <rananta@google.com>,
Tian Zheng <zhengtian10@huawei.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/5] KVM: arm64: New PTE dirty-page encoding, HAFDBS new usage
Date: Tue, 15 Sep 2026 16:31:36 +0100 [thread overview]
Message-ID: <aqlk2ApfQvHAs1j_@LeoBrasDK> (raw)
In-Reply-To: <86cxui7j4k.wl-maz@kernel.org>
On Sat, Sep 12, 2026 at 01:24:11PM +0100, Marc Zyngier wrote:
> On Tue, 01 Sep 2026 18:15:51 +0100,
> Leonardo Bras <leo.bras@arm.com> wrote:
> >
> > This series have 2 main goals:
> >
> > 1 - Patches #1,#2,#3 : Change the PTE descriptor to use WD/WC/RO encodings
> > making use of the DBM bit, adapting all usages, and
>
> What are WD and WC? I can sort of guess that this is write-dirty and
> write clean, but that's not exactly obvious. More importantly, you
> don't even explain *why* anything needs changing...
>
> > 2 - Patches #4,#5 are an RFC on using HAFDBS on a guest to avoid resetting
> > all PTEs to WC when dirty-logging starts, speeding-up startup.
> >
> > (1) will also introduce a new walker for cleaning the dirty-bit, which will
> > clear the DBM bit if it's a block mapping (hugepage). This is needed as on
> > lazy-splitting we need to fault a write so we can do the lazy splitting.
> > This is needed for both the next patches, and for HDBSS & HACDBS
> > enablement.
>
> Again, this is incredibly opaque to the reviewer. What is the problem
> you are trying to solve? This is what a cover letter is for.
Hi Marc, thanks for reviewing!
Okay, I will try to explain it better on the next version. What do you
think of this text:
===================
This series have 2 main goals:
1 - Introduce a new PTE encoding (Patches #1, #2, #3)
2 - An idea to use HAFDBS on a guest to avoid resetting all PTEs to WC
when dirty-logging starts
Goal 1:
Patches #1, #2, #3: Before adding Stage-2 support to HAFDBS, HDBSS and
HACDBS, we need to change the PTE descriptor encoding, as the DBM bit
is required on mappings for those hardware engines to actually being
able to update the PTEs. Currently what we have is:
- Read-Only (RO): S2AP[1]=0
- Read-Write (RW): S2AP[1]=1
and for them to work with the new features, we need to have:
- Read-Only (RO): DBM=0, S2AP[1]=0
- Writable-Clean (WC): DBM=1, S2AP[1]=0
- Writable-Dirty (WD): DBM=1, S2AP[1]=1
WC and WD are described in the Arm ARM, on R_XZFQH and R_BRFGY.
We also need to prepare for dealing with lazy splitting when HAFDBS is
enabled: since it updates the PTE without taking a fault on guest write, it
means we can't have lazy splitting if we mark all PTEs as WC.
To address that, there is a suggestion to set, on dirty-track enable:
- All pages as WC, as they don't need splitting, and
- All blocks as RO, as they are required to fault to do lazy splitting
In order to have that, a new walker is introduced to have a different
behavior depending on the entry's level.
This is needed for the Goal 2, as well as for HDBSS enablement.
Goal 2:
Patches #4,#5 are an RFC on using HAFDBS on a guest to avoid resetting
all PTEs to WC when dirty-logging starts, making it faster.
I really just want feedback to understand if it's worth pursuing.
My main idea is that we can use HAFDBS _outside_ dirty-logging to only mark
dirty the pages that were actually written to.
That is supposed to make it faster to transverse the pagetables when we
need to clean the dirty-bit, as there is potentially less atomic writes to
perform.
The price paid for that is disabling HAFDBS on every vcpu before we can
start cleaning the pages, during a dirty-track request.
Please let me know of what you think!
Thanks!
Leo
prev parent reply other threads:[~2026-09-15 15:31 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 17:15 Leonardo Bras
2026-09-01 17:15 ` [RFC PATCH 1/5] KVM: arm64: pgtables: Change write bit from S2AP_W to DBM Leonardo Bras
2026-09-13 9:00 ` Marc Zyngier
2026-09-15 17:12 ` Leonardo Bras
2026-09-16 0:37 ` Oliver Upton
2026-09-16 11:22 ` Leonardo Bras
2026-09-16 12:20 ` Marc Zyngier
2026-09-16 13:25 ` Leonardo Bras
2026-09-16 8:30 ` Marc Zyngier
2026-09-16 13:03 ` Leonardo Bras
2026-09-01 17:15 ` [RFC PATCH 2/5] KVM: arm64: Add KVM_PGTABLE_PROT_DIRTY Leonardo Bras
2026-09-13 9:09 ` Marc Zyngier
2026-09-15 17:33 ` Leonardo Bras
2026-09-01 17:15 ` [RFC PATCH 3/5] KVM: arm64: Introduce a dedicated walker for stage2 write-protect Leonardo Bras
2026-09-01 17:15 ` [RFC PATCH 4/5] KVM: arm64: Add KVM_REQ_RELOAD_STAGE2 Leonardo Bras
2026-09-02 3:41 ` Tian Zheng
2026-09-02 10:53 ` Leonardo Bras
2026-09-01 17:15 ` [RFC PATCH 5/5] KVM: arm64: Enable HAFDBS for guests not on migration Leonardo Bras
2026-09-16 0:10 ` Oliver Upton
2026-09-16 14:00 ` Leonardo Bras
2026-09-16 23:27 ` Oliver Upton
2026-09-12 12:24 ` [RFC PATCH 0/5] KVM: arm64: New PTE dirty-page encoding, HAFDBS new usage Marc Zyngier
2026-09-15 15:31 ` Leonardo Bras [this message]
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=aqlk2ApfQvHAs1j_@LeoBrasDK \
--to=leo.bras@arm.com \
--cc=catalin.marinas@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=rananta@google.com \
--cc=seiden@linux.ibm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
--cc=zhengtian10@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®