* [GIT PULL 1/6] KVM: s390: fix ESSA addressing exception injection in migration mode
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 17:34 ` sashiko-bot
2026-11-06 16:49 ` [GIT PULL 2/6] KVM: s390: pqap: fix AP status written to wrong half of GR1 Christian Borntraeger
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Gautam Gala <ggala@linux.ibm.com>
__do_essa() treated any negative return from dat_perform_essa() as the
normal "no CBRL entry appended" case and returned 0, so a page-table
walk failure silently dropped the addressing exception.
Return -PGM_ADDRESSING on a walk failure and inject the program
interrupt in __do_essa() for the -PGM_ADDRESSING return value.
DAT_WALK_ANY is required in the dat_entry_walk() call so that a GFN
backed by a large page (segment or region entry) does not return an
error: the walk stops early but succeeds, leaving ptep as NULL, which is
already handled by the existing "set exception state, return -1" path.
Without DAT_WALK_ANY such addresses would fall through to the new error
path and incorrectly inject PGM_ADDRESSING.
Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Suggested-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Gautam Gala <ggala@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
arch/s390/kvm/gmap/dat.c | 5 ++++-
arch/s390/kvm/s390/priv.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/s390/kvm/gmap/dat.c b/arch/s390/kvm/gmap/dat.c
index ff80d02c9f564..a2031aece4ed1 100644
--- a/arch/s390/kvm/gmap/dat.c
+++ b/arch/s390/kvm/gmap/dat.c
@@ -1084,6 +1084,7 @@ int dat_set_prefix_notif_bit(union asce asce, gfn_t gfn)
* * %1 if the page state has been altered and the page is to be added to the CBRL
* * %0 if the page state has been altered, but the page is not to be added to the CBRL
* * %-1 if the page state has not been altered and the page is not to be added to the CBRL
+ * * %PGM_ADDRESSING if the guest page-table walk failed
*/
int dat_perform_essa(union asce asce, gfn_t gfn, int orc, union essa_state *state, bool *dirty)
{
@@ -1092,7 +1093,9 @@ int dat_perform_essa(union asce asce, gfn_t gfn, int orc, union essa_state *stat
union pte *ptep;
int res = 0;
- if (dat_entry_walk(NULL, gfn, asce, 0, TABLE_TYPE_PAGE_TABLE, &crstep, &ptep)) {
+ if (dat_entry_walk(NULL, gfn, asce, DAT_WALK_ANY, TABLE_TYPE_PAGE_TABLE, &crstep, &ptep))
+ return PGM_ADDRESSING;
+ if (!ptep) {
*state = (union essa_state) { .exception = 1 };
return -1;
}
diff --git a/arch/s390/kvm/s390/priv.c b/arch/s390/kvm/s390/priv.c
index 856939acf012f..b252c812dcbe7 100644
--- a/arch/s390/kvm/s390/priv.c
+++ b/arch/s390/kvm/s390/priv.c
@@ -1169,6 +1169,8 @@ static inline int __do_essa(struct kvm_vcpu *vcpu, const int orc)
entries = (vcpu->arch.sie_block->cbrlo & ~PAGE_MASK) >> 3;
nappended = dat_perform_essa(vcpu->arch.gmap->asce, gfn, orc, &state, &dirtied);
+ if (nappended == PGM_ADDRESSING)
+ return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
vcpu->run->s.regs.gprs[r1] = state.val;
if (nappended < 0)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [GIT PULL 1/6] KVM: s390: fix ESSA addressing exception injection in migration mode
2026-11-06 16:49 ` [GIT PULL 1/6] KVM: s390: fix ESSA addressing exception injection in migration mode Christian Borntraeger
@ 2026-11-06 17:34 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-06 17:34 UTC (permalink / raw)
To: Christian Borntraeger
Cc: KVM, linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: s390: commit message states -PGM_ADDRESSING instead of
PGM_ADDRESSING
It also noticed 1 related pre-existing issue this patch does not
introduce:
- [High] KVM: s390: missing CMMA init and page table allocation in
handle_essa() [1]
--
commit ee014980cbe371ebff00ee828f1f5961b34040ff
Author: Gautam Gala <ggala@linux.ibm.com>
KVM: s390: fix ESSA addressing exception injection in migration mode
This commit updates dat_perform_essa() to pass DAT_WALK_ANY to
dat_entry_walk() and return PGM_ADDRESSING on walk failure, so __do_essa()
injects an addressing exception instead of silently dropping it.
> Return -PGM_ADDRESSING on a walk failure and inject the program
> interrupt in __do_essa() for the -PGM_ADDRESSING return value.
[Severity: Low]
This isn't a bug, but the commit message says -PGM_ADDRESSING whereas the
code returns and checks positive PGM_ADDRESSING.
> diff --git a/arch/s390/kvm/s390/priv.c b/arch/s390/kvm/s390/priv.c
> index 856939acf012f..b252c812dcbe7 100644
> --- a/arch/s390/kvm/s390/priv.c
> +++ b/arch/s390/kvm/s390/priv.c
> @@ -1169,6 +1169,8 @@ static inline int __do_essa(struct kvm_vcpu *vcpu, const int orc)
> entries = (vcpu->arch.sie_block->cbrlo & ~PAGE_MASK) >> 3;
>
> nappended = dat_perform_essa(vcpu->arch.gmap->asce, gfn, orc, &state, &dirtied);
> + if (nappended == PGM_ADDRESSING)
> + return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
> vcpu->run->s.regs.gprs[r1] = state.val;
> if (nappended < 0)
> return 0;
[Severity: High]
This problem wasn't introduced by this patch, but can an initial ESSA
intercept arriving after migration has already started reach __do_essa()
without GMAP_FLAG_USES_CMM set or guest page tables allocated [1]?
In handle_essa(), setting GMAP_FLAG_USES_CMM and calling
gmap_allocate_all_page_tables_best_effort() only happen in the
!migration_mode branch:
arch/s390/kvm/s390/priv.c:handle_essa() {
...
if (!READ_ONCE(vcpu->kvm->arch.migration_mode)) {
...
if (!uses_cmm(vcpu->arch.gmap)) {
set_bit(GMAP_FLAG_USES_CMM, &vcpu->arch.gmap->flags);
gmap_allocate_all_page_tables_best_effort(vcpu->arch.gmap);
}
...
} else {
scoped_guard(mutex, &vcpu->kvm->slots_arch_lock)
scoped_guard(read_lock, &vcpu->kvm->mmu_lock)
i = __do_essa(vcpu, orc);
...
}
If the guest executes its first ESSA instruction while migration_mode is
already active, dat_perform_essa() walks the gmap without allocating missing
page tables, returning an exception state and dropping the PGSTE update for
any unallocated segment. In addition, because GMAP_FLAG_USES_CMM remains
unset on kvm->arch.gmap, kvm_s390_get_cmma_bits() sees
!uses_cmm(kvm->arch.gmap) and returns zeroed data, losing dirtied guest CMMA
attributes during live migration.
[1] https://sashiko.dev/#/bug/linux-20a07467-1a8a-41bb-8117-0f046fed9112
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106164958.431978-2-borntraeger@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [GIT PULL 2/6] KVM: s390: pqap: fix AP status written to wrong half of GR1
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
2026-11-06 16:49 ` [GIT PULL 1/6] KVM: s390: fix ESSA addressing exception injection in migration mode Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 16:54 ` sashiko-bot
2026-11-06 16:49 ` [GIT PULL 3/6] KVM: s390: arm64: Turn vcpu->arch.pause into a counter Christian Borntraeger
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Gautam Gala <ggala@linux.ibm.com>
The AP Queue Status Word (APQSW) occupies bit positions 32-63 of GR1,
i.e. the low 32 bits of the 64-bit register, while the upper 32 bits
are reserved.
The no-hook fallback path in handle_pqap() synthesizes an APQSW and
copies struct ap_queue_status directly into GPR1 using memcpy(). On
big-endian s390 this places the APQSW in the upper 32 bits of the
register rather than in the architecturally defined APQSW field.
Use union ap_queue_status_reg and assign its value directly to GPR1.
This places APQSW in the correct half of the register and aligns the
fallback path with the register layout used by the AP infrastructure.
Fixes: e5282de93105 ("s390: ap: kvm: add PQAP interception for AQIC")
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Gautam Gala <ggala@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
arch/s390/kvm/s390/priv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/s390/kvm/s390/priv.c b/arch/s390/kvm/s390/priv.c
index b252c812dcbe7..f22612a127c96 100644
--- a/arch/s390/kvm/s390/priv.c
+++ b/arch/s390/kvm/s390/priv.c
@@ -593,7 +593,7 @@ EXPORT_SYMBOL_FOR_MODULES(kvm_s390_is_gpa_in_memslot, "vfio_ap");
*/
static int handle_pqap(struct kvm_vcpu *vcpu)
{
- struct ap_queue_status status = {};
+ union ap_queue_status_reg status = {};
crypto_hook pqap_hook;
unsigned long reg0;
int ret;
@@ -662,8 +662,8 @@ static int handle_pqap(struct kvm_vcpu *vcpu)
* No hook means no driver to enable the SIE CRYCB and no queues.
* We send this response to the guest.
*/
- status.response_code = 0x01;
- memcpy(&vcpu->run->s.regs.gprs[1], &status, sizeof(status));
+ status.status.response_code = 0x01;
+ vcpu->run->s.regs.gprs[1] = status.value;
kvm_s390_set_psw_cc(vcpu, 3);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [GIT PULL 2/6] KVM: s390: pqap: fix AP status written to wrong half of GR1
2026-11-06 16:49 ` [GIT PULL 2/6] KVM: s390: pqap: fix AP status written to wrong half of GR1 Christian Borntraeger
@ 2026-11-06 16:54 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-06 16:54 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev
> From: Gautam Gala <ggala@linux.ibm.com>
>
> The AP Queue Status Word (APQSW) occupies bit positions 32-63 of GR1,
> i.e. the low 32 bits of the 64-bit register, while the upper 32 bits
> are reserved.
>
> The no-hook fallback path in handle_pqap() synthesizes an APQSW and
> copies struct ap_queue_status directly into GPR1 using memcpy(). On
> big-endian s390 this places the APQSW in the upper 32 bits of the
> register rather than in the architecturally defined APQSW field.
>
> Use union ap_queue_status_reg and assign its value directly to GPR1.
> This places APQSW in the correct half of the register and aligns the
> fallback path with the register layout used by the AP infrastructure.
>
> Fixes: e5282de93105 ("s390: ap: kvm: add PQAP interception for AQIC")
> Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Gautam Gala <ggala@linux.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106164958.431978-3-borntraeger@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [GIT PULL 3/6] KVM: s390: arm64: Turn vcpu->arch.pause into a counter
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
2026-11-06 16:49 ` [GIT PULL 1/6] KVM: s390: fix ESSA addressing exception injection in migration mode Christian Borntraeger
2026-11-06 16:49 ` [GIT PULL 2/6] KVM: s390: pqap: fix AP status written to wrong half of GR1 Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 16:55 ` sashiko-bot
2026-11-06 16:49 ` [GIT PULL 4/6] KVM: s390: arm64: Declare enum vcpu_sysreg Christian Borntraeger
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Steffen Eiden <seiden@linux.ibm.com>
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")
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
Reviewed-by: Andreas Grapentin <gra@linux.ibm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
arch/s390/include/asm/kvm_host_arm64.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/s390/include/asm/kvm_host_arm64.h b/arch/s390/include/asm/kvm_host_arm64.h
index 82343e723ebf4..a3e40650d75d0 100644
--- a/arch/s390/include/asm/kvm_host_arm64.h
+++ b/arch/s390/include/asm/kvm_host_arm64.h
@@ -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;
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [GIT PULL 3/6] KVM: s390: arm64: Turn vcpu->arch.pause into a counter
2026-11-06 16:49 ` [GIT PULL 3/6] KVM: s390: arm64: Turn vcpu->arch.pause into a counter Christian Borntraeger
@ 2026-11-06 16:55 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-06 16:55 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev
> From: Steffen Eiden <seiden@linux.ibm.com>
>
> 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")
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
> Reviewed-by: Andreas Grapentin <gra@linux.ibm.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106164958.431978-4-borntraeger@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [GIT PULL 4/6] KVM: s390: arm64: Declare enum vcpu_sysreg
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
` (2 preceding siblings ...)
2026-11-06 16:49 ` [GIT PULL 3/6] KVM: s390: arm64: Turn vcpu->arch.pause into a counter Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 16:59 ` sashiko-bot
2026-11-06 16:49 ` [GIT PULL 5/6] KVM: s390: arm64: Fix kvm_arm64 module naming consistency Christian Borntraeger
2026-11-06 16:49 ` [GIT PULL 6/6] selftests: drivers/s390x: Select uvdevice tests using the target architecture Christian Borntraeger
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Andreas Grapentin <gra@linux.ibm.com>
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")
Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
arch/s390/include/asm/kvm_host_arm64.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/s390/include/asm/kvm_host_arm64.h b/arch/s390/include/asm/kvm_host_arm64.h
index a3e40650d75d0..3e69724f17c90 100644
--- a/arch/s390/include/asm/kvm_host_arm64.h
+++ b/arch/s390/include/asm/kvm_host_arm64.h
@@ -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>
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [GIT PULL 4/6] KVM: s390: arm64: Declare enum vcpu_sysreg
2026-11-06 16:49 ` [GIT PULL 4/6] KVM: s390: arm64: Declare enum vcpu_sysreg Christian Borntraeger
@ 2026-11-06 16:59 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-06 16:59 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev
> From: Andreas Grapentin <gra@linux.ibm.com>
>
> 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")
> Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
> Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106164958.431978-5-borntraeger@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [GIT PULL 5/6] KVM: s390: arm64: Fix kvm_arm64 module naming consistency
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
` (3 preceding siblings ...)
2026-11-06 16:49 ` [GIT PULL 4/6] KVM: s390: arm64: Declare enum vcpu_sysreg Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 16:59 ` sashiko-bot
2026-11-06 16:49 ` [GIT PULL 6/6] selftests: drivers/s390x: Select uvdevice tests using the target architecture Christian Borntraeger
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Andreas Grapentin <gra@linux.ibm.com>
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.
Signed-off-by: Andreas Grapentin <gra@linux.ibm.com>
Fixes: 91b87e6eea4d0 ("KVM: s390: arm64: Integrate arm on s390")
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
arch/s390/kvm/arm64/Makefile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/s390/kvm/arm64/Makefile b/arch/s390/kvm/arm64/Makefile
index 3f0fe5c9f0a17..b48dc65b7aaab 100644
--- a/arch/s390/kvm/arm64/Makefile
+++ b/arch/s390/kvm/arm64/Makefile
@@ -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
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* [GIT PULL 6/6] selftests: drivers/s390x: Select uvdevice tests using the target architecture
2026-11-06 16:49 [GIT PULL 0/6] KVM: s390: Fixes for 7.4 Christian Borntraeger
` (4 preceding siblings ...)
2026-11-06 16:49 ` [GIT PULL 5/6] KVM: s390: arm64: Fix kvm_arm64 module naming consistency Christian Borntraeger
@ 2026-11-06 16:49 ` Christian Borntraeger
2026-11-06 16:56 ` sashiko-bot
5 siblings, 1 reply; 13+ messages in thread
From: Christian Borntraeger @ 2026-11-06 16:49 UTC (permalink / raw)
To: Paolo Bonzini
Cc: KVM, Janosch Frank, Claudio Imbrenda, David Hildenbrand,
linux-s390, Christian Borntraeger, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Sven Schnelle, Christoph Schlameuss,
Steffen Eiden, Gautam Gala, Marc Zyngier, Sasha Levin
From: Sasha Levin <sashal@kernel.org>
The uvdevice Makefile decides whether to build its test from uname -m,
which describes the build host. A cross build for s390 on another host
therefore silently omits the test, while the non-s390 branch provides
no-op build and installation targets but no emit_tests target.
Select the test from the target ARCH when it is given and from the
host's SUBARCH otherwise, accepting both the s390 and s390x spellings,
and include lib.mk unconditionally so that other architectures build,
install and emit an empty runlist. ARCH itself is left unset so that a
native LLVM=1 build keeps using the compiler's native target.
Drop the include path derived from tools/arch/$(ARCH): the test only
needs asm/uvdevice.h from the installed kernel headers, and the path
does not exist for the s390x spelling.
Fixes: cbac924200b8 ("selftests: drivers/s390x: Add uvdevice tests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
.../selftests/drivers/s390x/uvdevice/Makefile | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/drivers/s390x/uvdevice/Makefile b/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
index 755d164384c46..586a9aa6fb158 100644
--- a/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
+++ b/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
@@ -1,20 +1,13 @@
include ../../../../../build/Build.include
-UNAME_M := $(shell uname -m)
-
-ifneq ($(UNAME_M),s390x)
-nothing:
-.PHONY: all clean run_tests install
-.SILENT:
-else
+top_srcdir ?= ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(or $(ARCH),$(SUBARCH))
+ifneq (,$(filter s390 s390x,$(ARCH_PROCESSED)))
TEST_GEN_PROGS := test_uvdevice
-top_srcdir ?= ../../../../../..
-LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
-
-CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES) -I$(LINUX_TOOL_ARCH_INCLUDE)
+CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES)
+endif
include ../../../lib.mk
-
-endif
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [GIT PULL 6/6] selftests: drivers/s390x: Select uvdevice tests using the target architecture
2026-11-06 16:49 ` [GIT PULL 6/6] selftests: drivers/s390x: Select uvdevice tests using the target architecture Christian Borntraeger
@ 2026-11-06 16:56 ` sashiko-bot
0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-11-06 16:56 UTC (permalink / raw)
To: Christian Borntraeger
Cc: linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev
> From: Sasha Levin <sashal@kernel.org>
>
> The uvdevice Makefile decides whether to build its test from uname -m,
> which describes the build host. A cross build for s390 on another host
> therefore silently omits the test, while the non-s390 branch provides
> no-op build and installation targets but no emit_tests target.
>
> Select the test from the target ARCH when it is given and from the
> host's SUBARCH otherwise, accepting both the s390 and s390x spellings,
> and include lib.mk unconditionally so that other architectures build,
> install and emit an empty runlist. ARCH itself is left unset so that a
> native LLVM=1 build keeps using the compiler's native target.
>
> Drop the include path derived from tools/arch/$(ARCH): the test only
> needs asm/uvdevice.h from the installed kernel headers, and the path
> does not exist for the s390x spelling.
>
> Fixes: cbac924200b8 ("selftests: drivers/s390x: Add uvdevice tests")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106164958.431978-7-borntraeger@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 13+ messages in thread