Skip to contentSkip to conversation

KVM: s390: arm64: Fixes for arm64 KVM support

PATCH Applied Andreas Grapentin 5 participants 15 messages Nov 3 – Nov 5

Subsystems (4)
lore
Share & tools
lore

Andreas Grapentin

author reviewer
#0 lore raw

cover KVM: s390: arm64: Fixes for arm64 KVM support

Some fixups for the previous series that introduced arm64 KVM support on s390. Forward-declare enum vcpu_sysreg because we are definitely going to need that, then make the module naming consistent and iron out an inconsistency in the definition of vcpu->arch.pause between s390 and native arm64 KVM.

No functional changes intended on either arm64 or s390.

---
Andreas Grapentin (2):
KVM: s390: arm64: Declare enum vcpu_sysreg
KVM: s390: arm64: Fix kvm_arm64 module naming consistency

Steffen Eiden (1):

      KVM: s390: arm64: Turn vcpu->arch.pause into a counter
 arch/s390/include/asm/kvm_host_arm64.h |  8 ++++----
 arch/s390/kvm/arm64/Makefile           | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-s390_arm64_kvm_fixups-b285654f214c

Best regards,

Signature · 1 line
Andreas Grapentin <[email protected]>
author reviewer
#1 lore raw

PATCH 1/3 KVM: s390: arm64: Turn vcpu->arch.pause into a counter

From: Steffen Eiden <[email protected]>

The s390 arm64 vcpu struct mirrors arm64's kvm_vcpu_arch. When commit e64309198eda2 ("KVM: arm64: Turn vcpu->arch.pause into a counter") changed the type of kvm_vcpu_arch.pause from bool to atomic_t, the merge into this tree missed the s390 copy, leaving it out of sync.

Nothing on the s390 side accesses vcpu->arch.pause yet, so this has no functional effect. Align the type to keep the mirror identical to its arm64 counterpart.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")
---
 arch/s390/include/asm/kvm_host_arm64.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/s390/include/asm/kvm_host_arm64.h +3 -4
index 82343e723ebf..a3e40650d75d 100644
@@ -63,11 +63,10 @@ struct kvm_vcpu_arch {
 	/*
 	 * Don't run the guest (internal implementation need).
 	 *
-	 * Contrary to the flags above, this is set/cleared outside of
-	 * a vcpu context, and thus cannot be mixed with the flags
-	 * themselves (or the flag accesses need to be made atomic).
+	 * Contrary to the flags above, this is updated outside of
+	 * a vcpu context, and thus cannot be mixed with the flags.
 	 */
-	bool pause;
+	atomic_t pause;
 
 	/* vcpu power state */
 	struct kvm_mp_state mp_state;
Signature · 1 line
2.55.0
#2 lore raw

Re: [PATCH 1/3] KVM: s390: arm64: Turn vcpu->arch.pause into a counter

Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

From: Steffen Eiden <[email protected]>

The s390 arm64 vcpu struct mirrors arm64's kvm_vcpu_arch. When commit e64309198eda2 ("KVM: arm64: Turn vcpu->arch.pause into a counter") changed the type of kvm_vcpu_arch.pause from bool to atomic_t, the merge into this tree missed the s390 copy, leaving it out of sync.

Quoted 7 lines

Nothing on the s390 side accesses vcpu->arch.pause yet, so this has no functional effect. Align the type to keep the mirror identical to its arm64 counterpart.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
author reviewer Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] KVM: s390: arm64: Turn vcpu->arch.pause into a counter

In reply to Andreas Grapentin
Quoted 41 lines · Andreas Grapentin

From: Steffen Eiden <[email protected]>

The s390 arm64 vcpu struct mirrors arm64's kvm_vcpu_arch. When commit e64309198eda2 ("KVM: arm64: Turn vcpu->arch.pause into a counter") changed the type of kvm_vcpu_arch.pause from bool to atomic_t, the merge into this tree missed the s390 copy, leaving it out of sync.

Nothing on the s390 side accesses vcpu->arch.pause yet, so this has no functional effect. Align the type to keep the mirror identical to its arm64 counterpart.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")
---
 arch/s390/include/asm/kvm_host_arm64.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/s390/include/asm/kvm_host_arm64.h +3 -4
index 82343e723ebf..a3e40650d75d 100644
@@ -63,11 +63,10 @@ struct kvm_vcpu_arch {
 	/*
 	 * Don't run the guest (internal implementation need).
 	 *
-	 * Contrary to the flags above, this is set/cleared outside of
-	 * a vcpu context, and thus cannot be mixed with the flags
-	 * themselves (or the flag accesses need to be made atomic).
+	 * Contrary to the flags above, this is updated outside of
+	 * a vcpu context, and thus cannot be mixed with the flags.
 	 */
-	bool pause;
+	atomic_t pause;
 
 	/* vcpu power state */
 	struct kvm_mp_state mp_state;
Signature · 2 lines
-- 
2.55.0

Best,
-A

author reviewer
#4 lore raw

PATCH 2/3 KVM: s390: arm64: Declare enum vcpu_sysreg

In reply to Andreas Grapentin

Forward-declare enum vcpu_sysreg in kvm_host_arm64.h. This should have been included in the first iteration of the header, since we will need it to talk about system registers.

Since the definition of enum vcpu_sysreg is not shared yet, and not used on the s390 side, this should not cause any functional changes.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")
---
 arch/s390/include/asm/kvm_host_arm64.h | 1 +
 1 file changed, 1 insertion(+)
arch/s390/include/asm/kvm_host_arm64.h +1 -0
index a3e40650d75d..3e69724f17c9 100644
@@ -8,6 +8,7 @@
 #include <asm/debug.h>
 
 #define vcpu_gp_regs(v)		((v)->arch.sae_block.gpr)
+enum vcpu_sysreg;
 
 #include <arm64/kvm_host.h>
 #include <arm64/ptrace.h>
Signature · 1 line
2.55.0
#5 lore raw

Re: [PATCH 2/3] KVM: s390: arm64: Declare enum vcpu_sysreg

Sashiko has reviewed this patch and found no issues.
Quoted 9 lines

Forward-declare enum vcpu_sysreg in kvm_host_arm64.h. This should have been included in the first iteration of the header, since we will need it to talk about system registers.

Since the definition of enum vcpu_sysreg is not shared yet, and not used on the s390 side, this should not cause any functional changes.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
reviewer Reviewed-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] KVM: s390: arm64: Declare enum vcpu_sysreg

In reply to Andreas Grapentin
Quoted 9 lines · Andreas Grapentin

Forward-declare enum vcpu_sysreg in kvm_host_arm64.h. This should have been included in the first iteration of the header, since we will need it to talk about system registers.

Since the definition of enum vcpu_sysreg is not shared yet, and not used on the s390 side, this should not cause any functional changes.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")
maintainer Acked-by on v1 2/3
#7 lore raw

Re: [PATCH 2/3] KVM: s390: arm64: Declare enum vcpu_sysreg

In reply to Andreas Grapentin

Am 03.11.26 um 17:37 schrieb Andreas Grapentin:

Quoted 9 lines

Forward-declare enum vcpu_sysreg in kvm_host_arm64.h. This should have been included in the first iteration of the header, since we will need it to talk about system registers.

Since the definition of enum vcpu_sysreg is not shared yet, and not used on the s390 side, this should not cause any functional changes.

Fixes e6c329180d1d ("KVM: s390: arm64: Introduce host definitions")
Quoted 17 lines
---
  arch/s390/include/asm/kvm_host_arm64.h | 1 +
  1 file changed, 1 insertion(+)
arch/s390/include/asm/kvm_host_arm64.h +1 -0
index a3e40650d75d..3e69724f17c9 100644
@@ -8,6 +8,7 @@
  #include <asm/debug.h>
 
  #define vcpu_gp_regs(v)		((v)->arch.sae_block.gpr)
+enum vcpu_sysreg;
 
  #include <arm64/kvm_host.h>
  #include <arm64/ptrace.h>
author reviewer
#8 lore raw

PATCH 3/3 KVM: s390: arm64: Fix kvm_arm64 module naming consistency

In reply to Andreas Grapentin

the module build for the kvm_arm64 module produced kvm-arm64.ko, fix the Makefile to produce kvm_arm64.ko instead, so the output file name matches the module name.

---
 arch/s390/kvm/arm64/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/s390/kvm/arm64/Makefile +6 -6
index 3f0fe5c9f0a1..b48dc65b7aaa 100644
@@ -29,7 +29,7 @@ $(obj)/%-arm64.o: $(src)/%.c FORCE
 	$(call if_changed_rule,cc_o_c)
 	$(call cmd,force_checksrc)
 
-# %-arm64.o stems don't match any kvm-arm64-y entry so Kbuild derives wrong
+# %-arm64.o stems don't match any kvm_arm64-y entry so Kbuild derives wrong
 # KBUILD_MODNAME/KBUILD_MODFILE. Force include a generated header to override.
 KVM_ARM64_MODNAME_H := $(obj)/generated/kvm_arm64_modname.h
 ccflags-y += -include $(KVM_ARM64_MODNAME_H)
@@ -48,7 +48,7 @@ define filechk_kvm_arm64_modname
 	echo '#undef __KBUILD_MODNAME';				\
 	echo '#define __KBUILD_MODNAME $(KVM_DEV_NAME)';	\
 	echo '#undef KBUILD_MODFILE';				\
-	echo '#define KBUILD_MODFILE "$(obj)/kvm-arm64"';	\
+	echo '#define KBUILD_MODFILE "$(obj)/kvm_arm64"';	\
 	echo '#endif /* __KVM_ARM64_MODNAME_H */'
 endef
 
@@ -60,7 +60,7 @@ $(addprefix $(obj)/,$(kvm-arm64-obj)): private part-of-builtin := y
 
 ifeq ($(CONFIG_KVM),m)
 
-kvm-arm64-y = $(kvm-arm64-obj)
+kvm_arm64-y = $(kvm-arm64-obj)
 
 else ifeq ($(CONFIG_KVM),y)
 
@@ -86,7 +86,7 @@ $(obj)/kvm_symbol_list: $(obj)/kvm-unnamespaced.o FORCE
 
 # cmd_oc_o_o carries -DKBUILD_MODFILE so generate_builtin_ranges.awk
 # can attribute kvm-namespaced.o to kvm_arm64 via its .cmd file.
-cmd_oc_o_o = $(cmd_objcopy) -DKBUILD_MODFILE='"$(obj)/kvm-arm64"'
+cmd_oc_o_o = $(cmd_objcopy) -DKBUILD_MODFILE='"$(obj)/kvm_arm64"'
 define rule_oc_o_o
 	$(call cmd,objcopy)
 	@printf '%s\n' 'savedcmd_$@ := $(call make-cmd,oc_o_o)' > $(dot-target).cmd
@@ -98,7 +98,7 @@ OBJCOPYFLAGS_kvm-namespaced.o := -O $(LD_BFD) --localize-symbols=$(obj)/kvm_symb
 $(obj)/kvm-namespaced.o: $(obj)/kvm-unnamespaced.o $(obj)/kvm_symbol_list FORCE
 	$(call if_changed_rule,oc_o_o)
 
-kvm-arm64-y = kvm-namespaced.o
+kvm_arm64-y = kvm-namespaced.o
 
 targets += kvm-unnamespaced.o kvm_symbol_list kvm-namespaced.o
 
@@ -106,5 +106,5 @@ endif
 
 clean-files += kvm-unnamespaced.o kvm_symbol_list kvm-namespaced.o
 
-obj-$(CONFIG_KVM) += kvm-arm64.o
+obj-$(CONFIG_KVM) += kvm_arm64.o
 
Signature · 1 line
2.55.0
#9 lore raw

Re: [PATCH 3/3] KVM: s390: arm64: Fix kvm_arm64 module naming consistency

Sashiko has reviewed this patch and found no issues.
Quoted 5 lines

the module build for the kvm_arm64 module produced kvm-arm64.ko, fix the Makefile to produce kvm_arm64.ko instead, so the output file name matches the module name.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
reviewer Reviewed-by on v1 3/3
#10 lore raw

Re: [PATCH 3/3] KVM: s390: arm64: Fix kvm_arm64 module naming consistency

In reply to Andreas Grapentin
Quoted 1 line · Andreas Grapentin

the module build for the kvm_arm64 module produced kvm-arm64.ko, fix the

Nit: start with an upper case T

Quoted 4 lines

Makefile to produce kvm_arm64.ko instead, so the output file name matches the module name.

maintainer Acked-by on v1 3/3
#11 lore raw

Re: [PATCH 3/3] KVM: s390: arm64: Fix kvm_arm64 module naming consistency

In reply to Andreas Grapentin

Am 03.11.26 um 17:37 schrieb Andreas Grapentin:

Quoted 5 lines

the module build for the kvm_arm64 module produced kvm-arm64.ko, fix the Makefile to produce kvm_arm64.ko instead, so the output file name matches the module name.

Its a stretch, but maybe add

Fixes 91b87e6eea4d0 ("KVM: s390: arm64: Integrate arm on s390")

so that any backports will not miss this.

reviewer Acked-by on the v1 series
#12 lore raw
In reply to Andreas Grapentin
Quoted 6 lines · Andreas Grapentin

Some fixups for the previous series that introduced arm64 KVM support on s390. Forward-declare enum vcpu_sysreg because we are definitely going to need that, then make the module naming consistent and iron out an inconsistency in the definition of vcpu->arch.pause between s390 and native arm64 KVM.

It's an interesting one. Obviously, this wasn't caught by building the upstream code. I guess this triggered with the rest of the patches?

Quoted 9 lines

No functional changes intended on either arm64 or s390.

---
Andreas Grapentin (2):
KVM: s390: arm64: Declare enum vcpu_sysreg
KVM: s390: arm64: Fix kvm_arm64 module naming consistency

Quoted 6 lines

Steffen Eiden (1):

      KVM: s390: arm64: Turn vcpu->arch.pause into a counter
 arch/s390/include/asm/kvm_host_arm64.h |  8 ++++----
 arch/s390/kvm/arm64/Makefile           | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

Looks all reasonable to me.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
reviewer
#13 lore raw
Quoted 11 lines · Marc Zyngier
Quoted 6 lines · Andreas Grapentin

Some fixups for the previous series that introduced arm64 KVM support on s390. Forward-declare enum vcpu_sysreg because we are definitely going to need that, then make the module naming consistent and iron out an inconsistency in the definition of vcpu->arch.pause between s390 and native arm64 KVM.

It's an interesting one. Obviously, this wasn't caught by building the upstream code. I guess this triggered with the rest of the patches?

Yes, this was triggered by the rest of the patches. The field somehow got in the first batch although it is not needed. We'll need it later anyways so I did not delete it for this fixup.

Quoted 13 lines
Quoted 13 lines

No functional changes intended on either arm64 or s390.

---
Andreas Grapentin (2):
KVM: s390: arm64: Declare enum vcpu_sysreg
KVM: s390: arm64: Fix kvm_arm64 module naming consistency

Steffen Eiden (1):

      KVM: s390: arm64: Turn vcpu->arch.pause into a counter
Quoted 7 lines
Quoted 3 lines
 arch/s390/include/asm/kvm_host_arm64.h |  8 ++++----
 arch/s390/kvm/arm64/Makefile           | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

Looks all reasonable to me.

Thanks.

Steffen

maintainer Applied
#14 lore raw
In reply to Andreas Grapentin

Am 03.11.26 um 17:37 schrieb Andreas Grapentin:

Quoted 17 lines

Some fixups for the previous series that introduced arm64 KVM support on s390. Forward-declare enum vcpu_sysreg because we are definitely going to need that, then make the module naming consistent and iron out an inconsistency in the definition of vcpu->arch.pause between s390 and native arm64 KVM.

No functional changes intended on either arm64 or s390.

---
Andreas Grapentin (2):
KVM: s390: arm64: Declare enum vcpu_sysreg
KVM: s390: arm64: Fix kvm_arm64 module naming consistency

Steffen Eiden (1):

       KVM: s390: arm64: Turn vcpu->arch.pause into a counter
Quoted 8 lines
  arch/s390/include/asm/kvm_host_arm64.h |  8 ++++----
  arch/s390/kvm/arm64/Makefile           | 12 ++++++------
  2 files changed, 10 insertions(+), 10 deletions(-)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-s390_arm64_kvm_fixups-b285654f214c

Best regards,

Thanks applied.