kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <graf@amazon.com>
To: Aaron Lewis <aaronlewis@google.com>
Cc: Peter Shier <pshier@google.com>,
	Jim Mattson <jmattson@google.com>,
	"kvm list" <kvm@vger.kernel.org>
Subject: Re: [PATCH v2 3/4] selftests: kvm: Add exception handling to selftests
Date: Mon, 12 Oct 2020 13:44:03 +0200	[thread overview]
Message-ID: <954837b0-884e-26c3-988e-487dffa9e894@amazon.com> (raw)
In-Reply-To: <CAAAPnDFTwb3o44gxdC7ONTJLob44BLus0zEza--j0exhsys=aA@mail.gmail.com>



On 09.10.20 17:32, Aaron Lewis wrote:
> 
>>> +#ifdef __x86_64__
>>> +       assert_on_unhandled_exception(vm, vcpuid);
>>> +#endif
>>
>> Can we avoid the #ifdef and instead just implement a stub function for
>> the other archs? Then move the prototype the the function to a generic
>> header of course.
>>
>> Alex
> 
> I considered that, I even implemented it that way at first, but when I
> looked around I saw no examples of stubs in the other archs, and I saw
> an example of leaving the #ifdef with a corresponding arch specific
> implementation  (ie: kvm_get_cpu_address_width()).  That's why I went
> with it this way.  If the stub is preferred I can change it.

We usually do the stub way in normal KVM code. I'd prefer to copy that 
design pattern in the selftest code as well - it makes things easier to 
follow IMHO.

Thanks,

Alex




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



  reply	other threads:[~2020-10-12 11:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 11:46 [PATCH v2 0/4] Test MSR exits to userspace Aaron Lewis
2020-10-09 11:46 ` [PATCH v2 1/4] selftests: kvm: Fix the segment descriptor layout to match the actual layout Aaron Lewis
2020-10-09 11:46 ` [PATCH v2 2/4] selftests: kvm: Clear uc so UCALL_NONE is being properly reported Aaron Lewis
2020-10-09 11:46 ` [PATCH v2 3/4] selftests: kvm: Add exception handling to selftests Aaron Lewis
2020-10-09 12:38   ` Alexander Graf
2020-10-09 15:32     ` Aaron Lewis
2020-10-12 11:44       ` Alexander Graf [this message]
2020-10-09 11:46 ` [PATCH v2 4/4] selftests: kvm: Test MSR exiting to userspace Aaron Lewis

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=954837b0-884e-26c3-988e-487dffa9e894@amazon.com \
    --to=graf@amazon.com \
    --cc=aaronlewis@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pshier@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).