The per-VM s390dbf area is named "kvm-". When one process creates more than one VM, the second debug_register() will fail with debugfs: 'kvm-' already exists in 's390dbf' The VM is still created, but no debugging can be done. Append a sequence number that goes up by one for each VM created, so every VM gets its own directory: "kvm--". Signed-off-by: Christian Borntraeger --- arch/s390/kvm/s390/s390.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c index ee8e61a828bb8..60521c58cfdc8 100644 --- a/arch/s390/kvm/s390/s390.c +++ b/arch/s390/kvm/s390/s390.c @@ -3239,7 +3239,8 @@ void kvm_arch_free_vm(struct kvm *kvm) int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) { gfp_t alloc_flags = GFP_KERNEL_ACCOUNT | __GFP_ZERO; - char debug_name[16]; + static atomic_t vm_seq = ATOMIC_INIT(0); + char debug_name[32]; int i, rc; mutex_init(&kvm->arch.pv.import_lock); @@ -3265,7 +3266,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) if (!kvm->arch.sca) goto out_err; - snprintf(debug_name, sizeof(debug_name), "kvm-%u", current->pid); + snprintf(debug_name, sizeof(debug_name), "kvm-%u-%u", current->pid, + atomic_inc_return(&vm_seq)); kvm->arch.dbf = debug_register(debug_name, 32, 1, 7 * sizeof(long)); if (!kvm->arch.dbf) -- 2.53.0