lkml.org 
[lkml]   [2022]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 6/6] KVM: selftests: Test Hyper-V extended hypercall exit to userspace
On Mon, Nov 7, 2022 at 6:05 PM Vipin Sharma <vipinsh@google.com> wrote:
>
> On Mon, Nov 7, 2022 at 11:01 AM David Matlack <dmatlack@google.com> wrote:
> >
> > On Fri, Nov 04, 2022 at 09:57:04PM -0700, Vipin Sharma wrote:
> > > +
> > > + TEST_ASSERT((run->exit_reason == KVM_EXIT_IO),
> > > + "unexpected exit reason: %u (%s)", run->exit_reason,
> > > + exit_reason_str(run->exit_reason));
> >
> > Optional: Asserting a specific exit reason is a pretty common pattern in
> > the x86 selftests. It'd be nice to create a common macro for it. e.g.
> >
> > ASSERT_EXIT_REASON(vcpu, KVM_EXIT_IO);
> >
>
> This is much better. I can add a patch which creates this API.
>
> Should it be run or vcpu? Seems like everything needed is in struct kvm_run{}.

Either one but I suspect vcpu will produce a cleaner final result
since all tests pass around struct kvm_vcpu and only use kvm_run to
check the exit reason. i.e. I suspect you'll be able to delete several
struct kvm_run local variables as part of adding ASSERT_EXIT_REASON().

\
 
 \ /
  Last update: 2022-11-08 18:46    [W:0.078 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site