From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, Michal Luczaj <mhal@rbox.co>
Subject: Re: [PATCH 2/4] KVM: selftests: Add helper macros for ioctl()s that return file descriptors
Date: Fri, 4 Aug 2023 10:27:07 -0700 [thread overview]
Message-ID: <ZM006zd4bpsGBtWF@google.com> (raw)
In-Reply-To: <ZM0rXgKvb912k5BE@linux.dev>
On Fri, Aug 04, 2023, Oliver Upton wrote:
> Hi Sean,
>
> On Thu, Aug 03, 2023 at 05:42:24PM -0700, Sean Christopherson wrote:
> > Add KVM, VM, and vCPU scoped helpers for ioctl()s that return file
> > descriptors, i.e. deduplicate code for asserting success on ioctls() for
> > which a positive return value, not just zero, is considered success.
> >
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
>
> I appreciate the desire to eliminate duplicate code, but I think the
> naming just muddies the waters. TBH, when I first read the diff w/o the
> changelog, I thought you were describing the input fd (i.e. 'kvm_fd',
> 'vm_fd', 'vcpu_fd'). I don't think explicitly spelling out the condition
> each time (i.e. ret >= 0) is all that difficult.
Yeah, but it's not just a desire to dedup code, I also am trying to funnel as
many "ioctl() succeeded" asserts as possible into common code so that they naturally
benefit from things like patch 4 (detecting dead/bugged VMs).
I agree the naming sucks.
WARNING: multiple messages have this Message-ID (diff)
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Marc Zyngier <maz@kernel.org>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, Michal Luczaj <mhal@rbox.co>
Subject: Re: [PATCH 2/4] KVM: selftests: Add helper macros for ioctl()s that return file descriptors
Date: Fri, 4 Aug 2023 10:27:07 -0700 [thread overview]
Message-ID: <ZM006zd4bpsGBtWF@google.com> (raw)
In-Reply-To: <ZM0rXgKvb912k5BE@linux.dev>
On Fri, Aug 04, 2023, Oliver Upton wrote:
> Hi Sean,
>
> On Thu, Aug 03, 2023 at 05:42:24PM -0700, Sean Christopherson wrote:
> > Add KVM, VM, and vCPU scoped helpers for ioctl()s that return file
> > descriptors, i.e. deduplicate code for asserting success on ioctls() for
> > which a positive return value, not just zero, is considered success.
> >
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
>
> I appreciate the desire to eliminate duplicate code, but I think the
> naming just muddies the waters. TBH, when I first read the diff w/o the
> changelog, I thought you were describing the input fd (i.e. 'kvm_fd',
> 'vm_fd', 'vcpu_fd'). I don't think explicitly spelling out the condition
> each time (i.e. ret >= 0) is all that difficult.
Yeah, but it's not just a desire to dedup code, I also am trying to funnel as
many "ioctl() succeeded" asserts as possible into common code so that they naturally
benefit from things like patch 4 (detecting dead/bugged VMs).
I agree the naming sucks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-04 17:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 0:42 [PATCH 0/4] KVM: selftests: ioctl() macro cleanups Sean Christopherson
2023-08-04 0:42 ` Sean Christopherson
2023-08-04 0:42 ` [PATCH 1/4] KVM: selftests: Drop the single-underscore ioctl() helpers Sean Christopherson
2023-08-04 0:42 ` Sean Christopherson
2023-08-04 0:42 ` [PATCH 2/4] KVM: selftests: Add helper macros for ioctl()s that return file descriptors Sean Christopherson
2023-08-04 0:42 ` Sean Christopherson
2023-08-04 16:46 ` Oliver Upton
2023-08-04 16:46 ` Oliver Upton
2023-08-04 17:27 ` Sean Christopherson [this message]
2023-08-04 17:27 ` Sean Christopherson
2023-08-14 18:11 ` Sean Christopherson
2023-08-14 18:11 ` Sean Christopherson
2023-08-04 17:57 ` Colton Lewis
2023-08-04 17:57 ` Colton Lewis
2023-08-04 18:33 ` Sean Christopherson
2023-08-04 18:33 ` Sean Christopherson
2023-08-04 0:42 ` [PATCH 3/4] KVM: selftests: Use asserting kvm_ioctl() macros when getting ARM page sizes Sean Christopherson
2023-08-04 0:42 ` Sean Christopherson
2023-08-04 14:58 ` Michal Luczaj
2023-08-04 14:58 ` Michal Luczaj
2023-08-04 15:23 ` Sean Christopherson
2023-08-04 15:23 ` Sean Christopherson
2023-08-04 0:42 ` [PATCH 4/4] KVM: selftests: Add logic to detect if ioctl() failed because VM was killed Sean Christopherson
2023-08-04 0:42 ` Sean Christopherson
2023-08-04 15:24 ` [PATCH 0/4] KVM: selftests: ioctl() macro cleanups Sean Christopherson
2023-08-04 15:24 ` 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=ZM006zd4bpsGBtWF@google.com \
--to=seanjc@google.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mhal@rbox.co \
--cc=oliver.upton@linux.dev \
/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.