All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	linuxppc-dev@lists.ozlabs.org,  linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	 Christophe Leroy <chleroy@kernel.org>,
	Anushree Mathur <anushree.mathur@linux.ibm.com>,
	 Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
	Harsh Prateek Bora <harshpb@linux.ibm.com>,
	 Ackerley Tng <ackerleytng@google.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	 Claudio Imbrenda <imbrenda@linux.ibm.com>
Subject: Re: [PATCH v3 RESEND 05/10] KVM: selftests: Print the vcpu_id when KVM_CREATE_VCPU ioctl fails
Date: Wed, 10 Jun 2026 05:59:25 -0700	[thread overview]
Message-ID: <ailfrWKNI9SfBNRh@google.com> (raw)
In-Reply-To: <2d2c46be7f051c7f1c645afaec67f57067d37a81.1781093720.git.ritesh.list@gmail.com>

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) <ritesh.list@gmail.com>
> ---
>  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.


  reply	other threads:[~2026-06-10 12:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 12:47 [PATCH v3 RESEND 00/10] KVM: selftests: add powerpc support Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 01/10] KVM: selftests: Move pgd_created check into virt_pgd_alloc Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 02/10] KVM: selftests: Add aligned guest physical page allocator Ritesh Harjani (IBM)
2026-06-10 16:18   ` Sean Christopherson
2026-06-10 12:47 ` [PATCH v3 RESEND 03/10] KVM: PPC: selftests: add support for powerpc Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 04/10] KVM: PPC: selftests: powerpc enable kvm_create_max_vcpus test Ritesh Harjani (IBM)
2026-06-10 17:59   ` Sean Christopherson
2026-06-10 12:47 ` [PATCH v3 RESEND 05/10] KVM: selftests: Print the vcpu_id when KVM_CREATE_VCPU ioctl fails Ritesh Harjani (IBM)
2026-06-10 12:59   ` Sean Christopherson [this message]
2026-06-10 12:47 ` [PATCH v3 RESEND 06/10] KVM: PPC: selftests: Use u64 instead of uint64_t Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 07/10] KVM: PPC: selftests: Use s64 instead of int64_t Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 08/10] KVM: PPC: selftests: Use u32 instead of uint32_t Ritesh Harjani (IBM)
2026-06-10 12:47 ` [PATCH v3 RESEND 09/10] KVM: PPC: selftests: Use u8 instead of uint8_t Ritesh Harjani (IBM)
2026-06-10 12:54   ` sashiko-bot
2026-06-10 12:47 ` [PATCH v3 RESEND 10/10] KVM: PPC: selftests: Replace u64 gpa, u64 gva|vaddr with gpa_t and gva_t Ritesh Harjani (IBM)
2026-06-10 12:51 ` [PATCH v3 RESEND 00/10] KVM: selftests: add powerpc support Sean Christopherson
2026-06-10 12:53   ` Ritesh Harjani
2026-06-10 16:19     ` Sean Christopherson

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=ailfrWKNI9SfBNRh@google.com \
    --to=seanjc@google.com \
    --cc=ackerleytng@google.com \
    --cc=anushree.mathur@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=harshpb@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=pbonzini@redhat.com \
    --cc=ritesh.list@gmail.com \
    --cc=venkat88@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.