From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B5C7312826 for ; Wed, 10 Jun 2026 12:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781096368; cv=none; b=VE0zOAeCGx5h+iUAQZoZQcYMztZDYnNh+EFsqBVoSMH+iiVaZTh8Htpl1IUUCyyI7OU0A5I5SjCODKzkIy58Vz42jXxmUeJcUObSsYnTq8fBpRvXlX80CuNHKFuUOZAJHIf3Eca4EhA+UGaL61QkkkysaN8NWM6RL/1sIyYE4gk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781096368; c=relaxed/simple; bh=TgmksmNVC96bTT2ieffY2phr04R1TTArIkyOtGoC9zk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=MISmX8ziNVMCxjQOnsvKe0hnnJTgsP4zLlgojrBKZja1qQKdxU85gbKJsvmpneyGUQalJFPgqLtBP+Ip7jE3e7RmmRxw3kAzWIWO6ixHOd4Rry4IYPw8em+qzm4ppGpboaPDwUSKPI9nJoerT84NkzEno84oHZW23iaPExWhjVc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=v/ZEEvdF; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="v/ZEEvdF" Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-8422ca754d8so4677065b3a.1 for ; Wed, 10 Jun 2026 05:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781096367; x=1781701167; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1NbKBk0OFMtK3aDv+gUztpO8HwlNLStu40uQDPANIdU=; b=v/ZEEvdFY9YoRNnZIRIX6GKTDxeCoSA0oyTdT4uSslWB2ZG6Ht27dObcPPNmrYkMCF kTol3CtW2ndSNOITHCNt6rUwX6mBeOJ51NZMnKLHB4bCEdX9+F7W2lLfS2YSeM/bbZuj VH1ULyP3Qx/jpb2h2g+w+ivnu8YpcLnVflyKbnytHbpEbFGgoEjiqX9H9eAL4elmPAW2 KXaxWaoCl/Q6a6+HATEyBZ1XFu5UxPa1mc1Ed3h/imtcYYTz5MeI2ednkFUdJ0aYOLD1 CJ5Jm5JfhOM2psBsJ4/jHqol5nYSKLO41/5ywXZtvB/J/uuFoLBgg5sSzfZ42n1Z1iST /paA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781096367; x=1781701167; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1NbKBk0OFMtK3aDv+gUztpO8HwlNLStu40uQDPANIdU=; b=fEKRPXQD+PmRW8npept1JcgEC9pN4YJfnuiKn8xWaIwJ7faCvaLMxxk8mi6VtItPM1 9COdU3fRJ8shuv5Tc3WOr46vEI3lnSQH/h6bJoCQRI4hofjlIHS0xyhchRu+y/LGC7At q4ClUoyLCeDnw11mYKH1tVihEULrkSVfdJcEyZEwpkA0cKNiBYkWnNCWHlAhtTdTKI4s dMYzSFwXMlxUKPqQ6glS5yp74MDMVdqQCT4HaPPqBnxZDiiiWhISgTR4/kJGE750z/tv Labe7dvgXgN3eyfNiGHJg5L1aMbKN7v6q71XUwfW+eJdIx3Whz/aVNn7im+MvlydnTWT qiqQ== X-Forwarded-Encrypted: i=1; AFNElJ+po7rRHDuYUv/vZOUz/xw3wPzrVJapX/JxELra7BtWYvMzieL/FWnSfPTUMrCXpk1TFRgNZvjuVElHlgM=@vger.kernel.org X-Gm-Message-State: AOJu0YyT1FGCPDAux7O33eztdLnLLg6OzvU3F5s6MN0qD2k2t3w6tv8D 7W+fYvofw7KmDAbT+qS9zkXXqDoDZctBaPwGN2kbzfhXdDUaRIcYW1ptIQCVKwgcRxyfKcgEqfP 3Vb/1tQ== X-Received: from pfrg6.prod.google.com ([2002:aa7:9f06:0:b0:83f:1941:b9bc]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4c85:b0:842:48ae:1d56 with SMTP id d2e1a72fcca58-8430a742437mr8863146b3a.35.1781096366425; Wed, 10 Jun 2026 05:59:26 -0700 (PDT) Date: Wed, 10 Jun 2026 05:59:25 -0700 In-Reply-To: <2d2c46be7f051c7f1c645afaec67f57067d37a81.1781093720.git.ritesh.list@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <2d2c46be7f051c7f1c645afaec67f57067d37a81.1781093720.git.ritesh.list@gmail.com> Message-ID: Subject: Re: [PATCH v3 RESEND 05/10] KVM: selftests: Print the vcpu_id when KVM_CREATE_VCPU ioctl fails From: Sean Christopherson To: "Ritesh Harjani (IBM)" Cc: kvm@vger.kernel.org, Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Michael Ellerman , Christophe Leroy , Anushree Mathur , Venkat Rao Bagalkote , Harsh Prateek Bora , Ackerley Tng , Christian Borntraeger , Claudio Imbrenda Content-Type: text/plain; charset="us-ascii" On Wed, Jun 10, 2026, Ritesh Harjani (IBM) wrote: > Print the vcpu_id and errno when the KVM_CREATE_VCPU ioctl fails, for > debug purposes. > This helped in debugging an issue with KVM on PowerVM, where KVM_CREATE_VCPU > only supports max 2048 vcpus, because the PAPR_HCALL H_GUEST_CREATE_VCPU > ("Documentation/arch/powerpc/kvm-nested.rst") supports only up to 0-2047 > vcpu_id. However KVM_CAP_MAX_VCPUS capability extension always reports max_vcpus > as NR_CPUS of the host. > > Signed-off-by: Ritesh Harjani (IBM) > --- > tools/testing/selftests/kvm/lib/kvm_util.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index e00a25f59416..6319e2037882 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1354,6 +1354,13 @@ struct kvm_vcpu *__vm_vcpu_add(struct kvm_vm *vm, u32 vcpu_id) > vcpu->vm = vm; > vcpu->id = vcpu_id; > vcpu->fd = __vm_ioctl(vm, KVM_CREATE_VCPU, (void *)(unsigned long)vcpu_id); > + if (vcpu->fd < 0) { > + int saved_errno = errno; > + > + pr_info("Failed KVM_CREATE_VCPU for vcpu_id %u with errno %d\n", > + vcpu_id, saved_errno); > + errno = saved_errno; Sorry, but NAK. There are myriad failures where printing extra information can help debug a failure/assert, I don't want to create a slippery slope where the codebase is littered with extra print statements that someone found useful at some point.