All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Mathias Krause <minipli@grsecurity.net>
Cc: kvm@vger.kernel.org, Santosh Shukla <santosh.shukla@amd.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [kvm-unit-tests PATCH v4 1/2] nSVM: Add helper to report fatal errors in guest
Date: Thu, 6 Apr 2023 09:31:44 -0700	[thread overview]
Message-ID: <ZC7z8F4PlwMcmkpL@google.com> (raw)
In-Reply-To: <a2ff46e7-748a-0cd2-d973-8ce1cdbfa004@grsecurity.net>

On Thu, Apr 06, 2023, Mathias Krause wrote:
> On 05.04.23 22:51, Sean Christopherson wrote:
> > Add a helper macro to dedup nSVM test code that handles fatal errors
> > by reporting the failure, setting the test stage to a magic number, and
> > invoking VMMCALL to bail to the host and terminate.
> > 
> > Note, the V_TPR fails if report() is invoked.  Punt on the issue for
> > now as most users already report only failures, but leave a TODO for
> > future developers.
> > 
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> >  x86/svm_tests.c | 127 ++++++++++++++++--------------------------------
> >  1 file changed, 42 insertions(+), 85 deletions(-)
> > 
> > diff --git a/x86/svm_tests.c b/x86/svm_tests.c
> > index 27ce47b4..e87db3fa 100644
> > --- a/x86/svm_tests.c
> > +++ b/x86/svm_tests.c
> > @@ -947,6 +947,21 @@ static bool lat_svm_insn_check(struct svm_test *test)
> >  	return true;
> >  }
> >  
> > +/*
> > + * Report failures from SVM guest code, and on failure, set the stage to -1 and
> > + * do VMMCALL to terminate the test (host side must treat -1 as "finished").
> > + * TODO: fix the tests that don't play nice with a straight report, e.g. the
> > + * V_TPR test fails if report() is invoked.
> > + */
> > +#define report_svm_guest(cond, test, fmt, args...)	\
> > +do {							\
> > +	if (!(cond)) {					\
> 
> > +		report_fail("why didn't my format '" fmt "' format?", ##args);\
>                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Debug artifact? Should probably be this instead (making use of C99):

Yes.  I'm just glad I posted the PG version and not the rated R version.

  reply	other threads:[~2023-04-06 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 20:51 [kvm-unit-tests PATCH v4 0/2] nSVM: vNMI testcase Sean Christopherson
2023-04-05 20:51 ` [kvm-unit-tests PATCH v4 1/2] nSVM: Add helper to report fatal errors in guest Sean Christopherson
2023-04-06  8:31   ` Mathias Krause
2023-04-06 16:31     ` Sean Christopherson [this message]
2023-04-05 20:51 ` [kvm-unit-tests PATCH v4 2/2] x86: nSVM: Add support for VNMI test Sean Christopherson
2023-04-06 10:42   ` Santosh Shukla
2023-06-07 23:26 ` [kvm-unit-tests PATCH v4 0/2] nSVM: vNMI testcase 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=ZC7z8F4PlwMcmkpL@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=minipli@grsecurity.net \
    --cc=pbonzini@redhat.com \
    --cc=santosh.shukla@amd.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.