public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace
@ 2024-09-26  3:22 Shaoqin Huang
  2024-09-26  3:22 ` [RFC PATCH v1 2/2] KVM: arm64: " Shaoqin Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Shaoqin Huang @ 2024-09-26  3:22 UTC (permalink / raw)
  To: Oliver Upton, Marc Zyngier, kvmarm
  Cc: Eric Auger, Sebastian Ott, Cornelia Huck, Shaoqin Huang,
	Catalin Marinas, Fuad Tabba, James Morse, Joey Gouly,
	Kristina Martsenko, kvm, linux-arm-kernel, linux-kernel,
	linux-kselftest, Mark Brown, Paolo Bonzini, Shuah Khan,
	Suzuki K Poulose, Will Deacon, Zenghui Yu

Currently the RAS feature bit is not writable in ID_AA64PFR0EL1, this makes
migration fail when migration from the machine which RAS is 1 to another machine
which RAS is 2.

Allow RAS writable from userspace would make the migration possible between two
machines which RAS is different.

Shaoqin Huang (2):
  KVM: arm64: Use kvm_has_feat() to check if FEAT_RAS is advertised to
    the guest
  KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from
    userspace

 arch/arm64/kvm/guest.c                            | 4 ++--
 arch/arm64/kvm/handle_exit.c                      | 2 +-
 arch/arm64/kvm/hyp/include/hyp/switch.h           | 2 +-
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h        | 7 +++++--
 arch/arm64/kvm/sys_regs.c                         | 3 +--
 tools/testing/selftests/kvm/aarch64/set_id_regs.c | 1 +
 6 files changed, 11 insertions(+), 8 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RFC PATCH v1 2/2] KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace
  2024-09-26  3:22 [RFC PATCH v1 0/2] Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace Shaoqin Huang
@ 2024-09-26  3:22 ` Shaoqin Huang
  2024-09-26  7:25   ` Oliver Upton
  0 siblings, 1 reply; 3+ messages in thread
From: Shaoqin Huang @ 2024-09-26  3:22 UTC (permalink / raw)
  To: Oliver Upton, Marc Zyngier, kvmarm
  Cc: Eric Auger, Sebastian Ott, Cornelia Huck, Shaoqin Huang,
	James Morse, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Paolo Bonzini, Shuah Khan, linux-arm-kernel,
	linux-kernel, kvm, linux-kselftest

Currently FEAT_RAS is not writable, this makes migration fail between
systems where this feature differ. Allow the FEAT_RAS writable in
ID_AA64PFR0_EL1 to let the migration possible when the RAS is differ
between two machines.

Also update the kselftest to test the RAS field.

Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
---
 arch/arm64/kvm/sys_regs.c                         | 1 -
 tools/testing/selftests/kvm/aarch64/set_id_regs.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index b09f8ba3525b..51ff66a11793 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -2364,7 +2364,6 @@ static const struct sys_reg_desc sys_reg_descs[] = {
 	  .val = ~(ID_AA64PFR0_EL1_AMU |
 		   ID_AA64PFR0_EL1_MPAM |
 		   ID_AA64PFR0_EL1_SVE |
-		   ID_AA64PFR0_EL1_RAS |
 		   ID_AA64PFR0_EL1_GIC |
 		   ID_AA64PFR0_EL1_AdvSIMD |
 		   ID_AA64PFR0_EL1_FP), },
diff --git a/tools/testing/selftests/kvm/aarch64/set_id_regs.c b/tools/testing/selftests/kvm/aarch64/set_id_regs.c
index d20981663831..d2dd78ce0e02 100644
--- a/tools/testing/selftests/kvm/aarch64/set_id_regs.c
+++ b/tools/testing/selftests/kvm/aarch64/set_id_regs.c
@@ -126,6 +126,7 @@ static const struct reg_ftr_bits ftr_id_aa64pfr0_el1[] = {
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, CSV2, 0),
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, DIT, 0),
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, SEL2, 0),
+	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, RAS, 0),
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL3, 0),
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL2, 0),
 	REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64PFR0_EL1, EL1, 0),
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH v1 2/2] KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace
  2024-09-26  3:22 ` [RFC PATCH v1 2/2] KVM: arm64: " Shaoqin Huang
@ 2024-09-26  7:25   ` Oliver Upton
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Upton @ 2024-09-26  7:25 UTC (permalink / raw)
  To: Shaoqin Huang
  Cc: Marc Zyngier, kvmarm, Eric Auger, Sebastian Ott, Cornelia Huck,
	James Morse, Suzuki K Poulose, Zenghui Yu, Catalin Marinas,
	Will Deacon, Paolo Bonzini, Shuah Khan, linux-arm-kernel,
	linux-kernel, kvm, linux-kselftest

On Wed, Sep 25, 2024 at 11:22:40PM -0400, Shaoqin Huang wrote:
> Currently FEAT_RAS is not writable, this makes migration fail between
> systems where this feature differ. Allow the FEAT_RAS writable in
> ID_AA64PFR0_EL1 to let the migration possible when the RAS is differ
> between two machines.
> 
> Also update the kselftest to test the RAS field.

Please do kernel + selftests changes in separate patches.

-- 
Thanks,
Oliver

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-26  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-26  3:22 [RFC PATCH v1 0/2] Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from userspace Shaoqin Huang
2024-09-26  3:22 ` [RFC PATCH v1 2/2] KVM: arm64: " Shaoqin Huang
2024-09-26  7:25   ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox