Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: KVM <kvm@vger.kernel.org>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Andreas Grapentin <gra@linux.ibm.com>,
	Marc Zyngier <maz@kernel.org>
Subject: [PATCH 2/2] KVM: s390: arm64: Use a sequence number in the s390dbf name
Date: Fri,  4 Dec 2026 10:11:31 +0100	[thread overview]
Message-ID: <20261204091131.150681-3-borntraeger@linux.ibm.com> (raw)
In-Reply-To: <20261204091131.150681-1-borntraeger@linux.ibm.com>

The per-VM s390dbf area is named "kvm-arm64-<pid>-<random>". Two VMs of
the same process can still get the same random number, and debugfs then
fails to create the second directory.

Use the new s390 scheme.

Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
---
 arch/s390/kvm/arm64/arm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kvm/arm64/arm.c b/arch/s390/kvm/arm64/arm.c
index bd9d85235f438..6fd0ba2061dcc 100644
--- a/arch/s390/kvm/arm64/arm.c
+++ b/arch/s390/kvm/arm64/arm.c
@@ -106,6 +106,7 @@ static int kvm_vm_type_ipa_size_shift(unsigned long type)
 
 int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 {
+	static atomic_t vm_seq = ATOMIC_INIT(0);
 	char debug_name[32];
 	int ret;
 
@@ -121,7 +122,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	bitmap_zero(kvm->arch.vcpu_features, KVM_VCPU_MAX_FEATURES);
 
 	snprintf(debug_name, sizeof(debug_name), "kvm-arm64-%u-%u",
-		 current->pid, get_random_u32());
+		 current->pid, atomic_inc_return(&vm_seq));
 	kvm->arch.dbf = debug_register(debug_name, 32, 1, 7 * sizeof(long));
 	if (!kvm->arch.dbf)
 		return -ENOMEM;
-- 
2.53.0


  parent reply	other threads:[~2026-12-04  9:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  9:11 [PATCH 0/2] KVM: s390: fix longstanding s390 debug feature bug Christian Borntraeger
2026-12-04  9:11 ` [PATCH 1/2] KVM: s390: Use a unique s390dbf name per VM Christian Borntraeger
2026-12-04  9:21   ` sashiko-bot
2026-12-04  9:11 ` Christian Borntraeger [this message]
2026-12-04  9:19   ` [PATCH 2/2] KVM: s390: arm64: Use a sequence number in the s390dbf name sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204091131.150681-3-borntraeger@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gra@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox