[PATCH v2 0/5] Support the FEAT_HDBSS introduced in Armv9.5

Tian Zheng posted 5 patches 1 week, 3 days ago
Documentation/virt/kvm/api.rst       |  15 ++++
arch/arm64/Kconfig                   |  14 ++++
arch/arm64/include/asm/cpucaps.h     |   2 +
arch/arm64/include/asm/cpufeature.h  |   5 ++
arch/arm64/include/asm/esr.h         |   2 +
arch/arm64/include/asm/kvm_arm.h     |   1 +
arch/arm64/include/asm/kvm_host.h    |  14 ++++
arch/arm64/include/asm/kvm_mmu.h     |  17 +++++
arch/arm64/include/asm/kvm_pgtable.h |   4 +
arch/arm64/include/asm/sysreg.h      |  12 +++
arch/arm64/kernel/cpufeature.c       |   9 +++
arch/arm64/kvm/arm.c                 | 107 +++++++++++++++++++++++++++
arch/arm64/kvm/handle_exit.c         |  45 +++++++++++
arch/arm64/kvm/hyp/pgtable.c         |   6 ++
arch/arm64/kvm/hyp/vhe/switch.c      |   1 +
arch/arm64/kvm/mmu.c                 |  10 +++
arch/arm64/kvm/reset.c               |   3 +
arch/arm64/tools/cpucaps             |   1 +
arch/arm64/tools/sysreg              |  28 +++++++
include/linux/kvm_host.h             |   1 +
include/uapi/linux/kvm.h             |   1 +
tools/include/uapi/linux/kvm.h       |   1 +
22 files changed, 299 insertions(+)
[PATCH v2 0/5] Support the FEAT_HDBSS introduced in Armv9.5
Posted by Tian Zheng 1 week, 3 days ago
This series of patches add support to the Hardware Dirty state tracking
Structure(HDBSS) feature, which is introduced by the ARM architecture
in the DDI0601(ID121123) version.

The HDBSS feature is an extension to the architecture that enhances
tracking translation table descriptors' dirty state, identified as
FEAT_HDBSS. The goal of this feature is to reduce the cost of surveying
for dirtied granules, with minimal effect on recording when a granule
has been dirtied.

The purpose of this feature is to make the execution overhead of live
migration lower to both the guest and the host, compared to existing
approaches (write-protect or search stage 2 tables).

After these patches, users(such as qemu) can use the
KVM_CAP_ARM_HW_DIRTY_STATE_TRACK ioctl to enable or disable the HDBSS
feature before and after the live migration.

This feature is similar to Intel's Page Modification Logging (PML),
offering hardware-assisted dirty tracking to reduce live migration
overhead. With PML support expanding beyond Intel, HDBSS introduces a
comparable mechanism for ARM.

eillon (4):
  arm64/sysreg: Add HDBSS related register information
  KVM: arm64: Support set the DBM attr during memory abort
  KVM: arm64: Add support for FEAT_HDBSS
  KVM: arm64: Enable HDBSS support and handle HDBSSF events

Tian Zheng (1):
  KVM: arm64: Document HDBSS ioctl

 Documentation/virt/kvm/api.rst       |  15 ++++
 arch/arm64/Kconfig                   |  14 ++++
 arch/arm64/include/asm/cpucaps.h     |   2 +
 arch/arm64/include/asm/cpufeature.h  |   5 ++
 arch/arm64/include/asm/esr.h         |   2 +
 arch/arm64/include/asm/kvm_arm.h     |   1 +
 arch/arm64/include/asm/kvm_host.h    |  14 ++++
 arch/arm64/include/asm/kvm_mmu.h     |  17 +++++
 arch/arm64/include/asm/kvm_pgtable.h |   4 +
 arch/arm64/include/asm/sysreg.h      |  12 +++
 arch/arm64/kernel/cpufeature.c       |   9 +++
 arch/arm64/kvm/arm.c                 | 107 +++++++++++++++++++++++++++
 arch/arm64/kvm/handle_exit.c         |  45 +++++++++++
 arch/arm64/kvm/hyp/pgtable.c         |   6 ++
 arch/arm64/kvm/hyp/vhe/switch.c      |   1 +
 arch/arm64/kvm/mmu.c                 |  10 +++
 arch/arm64/kvm/reset.c               |   3 +
 arch/arm64/tools/cpucaps             |   1 +
 arch/arm64/tools/sysreg              |  28 +++++++
 include/linux/kvm_host.h             |   1 +
 include/uapi/linux/kvm.h             |   1 +
 tools/include/uapi/linux/kvm.h       |   1 +
 22 files changed, 299 insertions(+)

--
2.33.0
Re: [PATCH v2 0/5] Support the FEAT_HDBSS introduced in Armv9.5
Posted by Marc Zyngier 1 week, 3 days ago
On Fri, 21 Nov 2025 09:23:37 +0000,
Tian Zheng <zhengtian10@huawei.com> wrote:
> 
> This series of patches add support to the Hardware Dirty state tracking
> Structure(HDBSS) feature, which is introduced by the ARM architecture
> in the DDI0601(ID121123) version.
> 
> The HDBSS feature is an extension to the architecture that enhances
> tracking translation table descriptors' dirty state, identified as
> FEAT_HDBSS. The goal of this feature is to reduce the cost of surveying
> for dirtied granules, with minimal effect on recording when a granule
> has been dirtied.
> 
> The purpose of this feature is to make the execution overhead of live
> migration lower to both the guest and the host, compared to existing
> approaches (write-protect or search stage 2 tables).
> 
> After these patches, users(such as qemu) can use the
> KVM_CAP_ARM_HW_DIRTY_STATE_TRACK ioctl to enable or disable the HDBSS
> feature before and after the live migration.
> 
> This feature is similar to Intel's Page Modification Logging (PML),
> offering hardware-assisted dirty tracking to reduce live migration
> overhead. With PML support expanding beyond Intel, HDBSS introduces a
> comparable mechanism for ARM.

Where is the change log describing what was changed compared to the
previous version?

We gave you extensive comments back in March. You never replied to the
feedback. And you now dump a whole set of patches, 6 months later,
without the slightest indication of what has changed?

Why should we make the effort to review this again?

	M.

-- 
Without deviation from the norm, progress is not possible.
Re: [PATCH v2 0/5] Support the FEAT_HDBSS introduced in Armv9.5
Posted by z00939249 1 week, 3 days ago
On 2025/11/21 17:54, Marc Zyngier wrote:
> On Fri, 21 Nov 2025 09:23:37 +0000,
> Tian Zheng <zhengtian10@huawei.com> wrote:
>>
>> This series of patches add support to the Hardware Dirty state tracking
>> Structure(HDBSS) feature, which is introduced by the ARM architecture
>> in the DDI0601(ID121123) version.
>>
>> The HDBSS feature is an extension to the architecture that enhances
>> tracking translation table descriptors' dirty state, identified as
>> FEAT_HDBSS. The goal of this feature is to reduce the cost of surveying
>> for dirtied granules, with minimal effect on recording when a granule
>> has been dirtied.
>>
>> The purpose of this feature is to make the execution overhead of live
>> migration lower to both the guest and the host, compared to existing
>> approaches (write-protect or search stage 2 tables).
>>
>> After these patches, users(such as qemu) can use the
>> KVM_CAP_ARM_HW_DIRTY_STATE_TRACK ioctl to enable or disable the HDBSS
>> feature before and after the live migration.
>>
>> This feature is similar to Intel's Page Modification Logging (PML),
>> offering hardware-assisted dirty tracking to reduce live migration
>> overhead. With PML support expanding beyond Intel, HDBSS introduces a
>> comparable mechanism for ARM.
> 
> Where is the change log describing what was changed compared to the
> previous version?
> 
> We gave you extensive comments back in March. You never replied to the
> feedback. And you now dump a whole set of patches, 6 months later,
> without the slightest indication of what has changed?
> 
> Why should we make the effort to review this again?

Apologies for the lack of proper changelog and the delayed follow-up on 
the feedback provided in March. This was an oversight on our part during 
the transition of maintainership for the HDBSS patch series. We 
sincerely appreciate the thorough comments you shared earlier and regret 
not responding in a timely manner.

Below is a summary of the changes made from v1 to v2.

v1:
https://lore.kernel.org/kvm/20250311040321.1460-1-yezhenyu2@huawei.com/

v1->v2 changes:
- Removed redundant macro definitions and switched to tool-generated.
- Split HDBSS interface and implementation into separate patches.
- Integrate system_supports_hdbss() into ARM feature initialization.
- Refactored HDBSS data structure to store meaningful values instead
of raw register contents.
- Fixed permission checks when applying DBM bits in page tables to
prevent potential memory corruption.
- Removed unnecessary dsb instructions.
- Drop the debugging printks.
- Merged the two patches "using ioctl to enable/disable the HDBSS
feature" and "support to handle the HDBSSF event" into one.

We apologize again for the delay and the missing changelog, and we 
greatly appreciate your time in reviewing this updated version.
Re: [PATCH v2 0/5] Support the FEAT_HDBSS introduced in Armv9.5
Posted by Marc Zyngier 1 week, 2 days ago
On Fri, 21 Nov 2025 10:21:16 +0000,
z00939249 <zhengtian10@huawei.com> wrote:
> 
> On 2025/11/21 17:54, Marc Zyngier wrote:
> > On Fri, 21 Nov 2025 09:23:37 +0000,
> > Tian Zheng <zhengtian10@huawei.com> wrote:
> >> 
> >> This series of patches add support to the Hardware Dirty state tracking
> >> Structure(HDBSS) feature, which is introduced by the ARM architecture
> >> in the DDI0601(ID121123) version.
> >> 
> >> The HDBSS feature is an extension to the architecture that enhances
> >> tracking translation table descriptors' dirty state, identified as
> >> FEAT_HDBSS. The goal of this feature is to reduce the cost of surveying
> >> for dirtied granules, with minimal effect on recording when a granule
> >> has been dirtied.
> >> 
> >> The purpose of this feature is to make the execution overhead of live
> >> migration lower to both the guest and the host, compared to existing
> >> approaches (write-protect or search stage 2 tables).
> >> 
> >> After these patches, users(such as qemu) can use the
> >> KVM_CAP_ARM_HW_DIRTY_STATE_TRACK ioctl to enable or disable the HDBSS
> >> feature before and after the live migration.
> >> 
> >> This feature is similar to Intel's Page Modification Logging (PML),
> >> offering hardware-assisted dirty tracking to reduce live migration
> >> overhead. With PML support expanding beyond Intel, HDBSS introduces a
> >> comparable mechanism for ARM.
> > 
> > Where is the change log describing what was changed compared to the
> > previous version?
> > 
> > We gave you extensive comments back in March. You never replied to the
> > feedback. And you now dump a whole set of patches, 6 months later,
> > without the slightest indication of what has changed?
> > 
> > Why should we make the effort to review this again?
> 
> Apologies for the lack of proper changelog and the delayed follow-up
> on the feedback provided in March. This was an oversight on our part
> during the transition of maintainership for the HDBSS patch series. We
> sincerely appreciate the thorough comments you shared earlier and
> regret not responding in a timely manner.
> 
> Below is a summary of the changes made from v1 to v2.
> 
> v1:
> https://lore.kernel.org/kvm/20250311040321.1460-1-yezhenyu2@huawei.com/
> 
> v1->v2 changes:
> - Removed redundant macro definitions and switched to tool-generated.
> - Split HDBSS interface and implementation into separate patches.
> - Integrate system_supports_hdbss() into ARM feature initialization.
> - Refactored HDBSS data structure to store meaningful values instead
> of raw register contents.
> - Fixed permission checks when applying DBM bits in page tables to
> prevent potential memory corruption.
> - Removed unnecessary dsb instructions.
> - Drop the debugging printks.
> - Merged the two patches "using ioctl to enable/disable the HDBSS
> feature" and "support to handle the HDBSSF event" into one.

Thanks for the update.

Please make sure you always include such description in future version
of this series. I hope the next version won't take as long (over 8
months between versions is counter productive).

	M.

-- 
Jazz isn't dead. It just smells funny.