[PATCH v2 0/2] KVM: arm64: ID register finalisation fixes

Mark Brown posted 2 patches 1 month, 4 weeks ago
There is a newer version of this series
arch/arm64/include/asm/kvm_host.h |  8 ++++++
arch/arm64/kvm/arm.c              |  2 +-
arch/arm64/kvm/sys_regs.c         | 57 ++++++++++++++++++++++++---------------
arch/arm64/kvm/sys_regs.h         |  2 +-
arch/arm64/kvm/vgic/vgic-init.c   |  6 ++---
5 files changed, 48 insertions(+), 27 deletions(-)
[PATCH v2 0/2] KVM: arm64: ID register finalisation fixes
Posted by Mark Brown 1 month, 4 weeks ago
While looking at some feature enablement I noticed that there are some
scenarios where we can end up with an inconsistently configured vCPU due
to finalizing configuration based on ID registers before we have blocked
writes to the ID registers. This series aims to clean up these issues.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v2:
- Also replace the kvm_vm_has_ran_once() usage in kvm_set_vm_id_rg() and
  kvm_vm_finalize_sys_regs() with kvm_id_regs_final().
- Link to v1: https://patch.msgid.link/20260731-kvm-arm64-idreg-final-v1-0-3de2a5616dc6@kernel.org

---
Mark Brown (2):
      KVM: arm64: Finalize guest-wide sysregs prior to per-vCPU sysregs
      KVM: arm64: Block ID register changes after we rely on the values

 arch/arm64/include/asm/kvm_host.h |  8 ++++++
 arch/arm64/kvm/arm.c              |  2 +-
 arch/arm64/kvm/sys_regs.c         | 57 ++++++++++++++++++++++++---------------
 arch/arm64/kvm/sys_regs.h         |  2 +-
 arch/arm64/kvm/vgic/vgic-init.c   |  6 ++---
 5 files changed, 48 insertions(+), 27 deletions(-)
---
base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
change-id: 20260729-kvm-arm64-idreg-final-77cbc46b558a

Best regards,
--  
Mark Brown <broonie@kernel.org>
Re: [PATCH v2 0/2] KVM: arm64: ID register finalisation fixes
Posted by Fuad Tabba 1 month, 4 weeks ago
Hi Mark,

On Mon, 3 Aug 2026 at 23:54, Mark Brown <broonie@kernel.org> wrote:
>
> While looking at some feature enablement I noticed that there are some
> scenarios where we can end up with an inconsistently configured vCPU due
> to finalizing configuration based on ID registers before we have blocked
> writes to the ID registers. This series aims to clean up these issues.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>

I didn't want to hold this for the broader coverage you suggested, so
here is a focused test for the failed-first-run path [1]. It fails
without this series.

Tested on top of v7.2-rc5 under QEMU: boot tests, plus the
set_id_regs, vgic_init and get-reg-list selftests, the last also under
nested virt (-M vhe, kvm-arm.mode=nested).

For the series:

Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev>
Tested-by: Fuad Tabba <fuad.tabba@linux.dev>

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260804092421.1728880-1-fuad.tabba@linux.dev/

> ---
> Changes in v2:
> - Also replace the kvm_vm_has_ran_once() usage in kvm_set_vm_id_rg() and
>   kvm_vm_finalize_sys_regs() with kvm_id_regs_final().
> - Link to v1: https://patch.msgid.link/20260731-kvm-arm64-idreg-final-v1-0-3de2a5616dc6@kernel.org
>
> ---
> Mark Brown (2):
>       KVM: arm64: Finalize guest-wide sysregs prior to per-vCPU sysregs
>       KVM: arm64: Block ID register changes after we rely on the values
>
>  arch/arm64/include/asm/kvm_host.h |  8 ++++++
>  arch/arm64/kvm/arm.c              |  2 +-
>  arch/arm64/kvm/sys_regs.c         | 57 ++++++++++++++++++++++++---------------
>  arch/arm64/kvm/sys_regs.h         |  2 +-
>  arch/arm64/kvm/vgic/vgic-init.c   |  6 ++---
>  5 files changed, 48 insertions(+), 27 deletions(-)
> ---
> base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
> change-id: 20260729-kvm-arm64-idreg-final-77cbc46b558a
>
> Best regards,
> --
> Mark Brown <broonie@kernel.org>
>