From: Sean Christopherson <seanjc@google.com>
To: Marc Orr <marcorr@google.com>
Cc: Joerg Roedel <jroedel@suse.de>,
Varad Gautam <varad.gautam@suse.com>,
kvm list <kvm@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Andrew Jones <drjones@redhat.com>,
Zixuan Wang <zxwang42@gmail.com>,
Erdem Aktas <erdemaktas@google.com>,
David Rientjes <rientjes@google.com>,
"Singh, Brijesh" <brijesh.singh@amd.com>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
bp@suse.de
Subject: Re: [kvm-unit-tests PATCH v3 11/11] x86: AMD SEV-ES: Handle string IO for IOIO #VC
Date: Fri, 15 Apr 2022 19:11:46 +0000 [thread overview]
Message-ID: <YlnDclyQmmaISvAZ@google.com> (raw)
In-Reply-To: <CAA03e5FVTizMzWeO2CDS_d7ym6eoaqn1tAOe+2C=OUOPLoHz3Q@mail.gmail.com>
On Fri, Apr 15, 2022, Marc Orr wrote:
> On Fri, Apr 15, 2022 at 11:30 AM Sean Christopherson <seanjc@google.com> wrote:
> > Yes, we can and probably should add wrappers for the raw string I/O tests too.
> > But, no matter what, somehwere there has to be a helper to translate raw string
> > I/O into SEV-ES string I/O. I don't see why doing that in the #VC handler is any
> > easier than doing it in a helper.
>
> Hmmm... yeah, if this patch really does get vetoed then rather than
> throw it away maybe we can convert it to be loaded with a helper now.
>
> Note: I hear your arguments, but I still don't agree with throwing
> away this patch. At least not based on the arguments made in this
> email thread. I think having a default #VC handler to handle string IO
> is better than not having one. Individual tests can always override
> it.
What test is ever going to do its own string port I/O? String MMIO is a different
beast because REP MOVS and REP STOS can be generated by the compiler almost at will,
e.g. memcpy(), memset(), struct initialization, random for-loops, etc...
Port I/O on the other requires very deliberate code. I doubt it's even possible
to generate string port I/O without resorting to assembly.
Outside of emulator.c, the next closest instance is the use of KVM's "force emulation
prefix", which happens to sometimes decode as INSL due to using byte 0x6d :-)
realmode.c's print_serial() has string I/O, but (a) it's #ifdef'd out by default
and (b) would be trivial to convert to a common helper.
In other words, any test that does string I/O is going to have to either open code
it in inline asm or call a helper. I'd much prefer we enable the latter.
> From reading the other email thread on the decoder, I get the
> sense that the real reason you're opposed to this patch is because
> you're opposed to pulling in the Linux decoder. I don't follow that
> patch as well as this one. So that may or may not be a valid reason to
> nuke this patch. I'll leave that for others to discuss.
Yeah, they're very intertwined, not having to pull in a massive decoder is a big
motivation for not wanting string I/O support in the #VC handler. But, even were
that not the case, IMO bouncing through the #VC handler for string I/O is asinine
because the source of the #VC _knows_ that it wants to do string I/O. Just call
a helper.
prev parent reply other threads:[~2022-04-15 19:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 10:54 [kvm-unit-tests PATCH v3 00/11] Add #VC exception handling for AMD SEV-ES Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 01/11] x86: AMD SEV-ES: Setup #VC exception handler " Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 02/11] x86: Move svm.h to lib/x86/ Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 03/11] lib: Define unlikely()/likely() macros in libcflat.h Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 04/11] lib: x86: Import insn decoder from Linux Varad Gautam
2022-04-06 1:37 ` Sean Christopherson
2022-04-08 7:42 ` Joerg Roedel
2022-04-15 18:07 ` Sean Christopherson
2022-08-25 16:42 ` Vasant Karasulli
2022-08-26 0:05 ` Sean Christopherson
2023-03-29 9:55 ` Joerg Roedel
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 05/11] x86: AMD SEV-ES: Pull related GHCB definitions and helpers " Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 06/11] x86: AMD SEV-ES: Prepare for #VC processing Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 07/11] lib/x86: Move xsave helpers to lib/ Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 08/11] x86: AMD SEV-ES: Handle CPUID #VC Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 09/11] x86: AMD SEV-ES: Handle MSR #VC Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 10/11] x86: AMD SEV-ES: Handle IOIO #VC Varad Gautam
2022-02-24 10:54 ` [kvm-unit-tests PATCH v3 11/11] x86: AMD SEV-ES: Handle string IO for " Varad Gautam
2022-04-06 1:50 ` Sean Christopherson
2022-04-08 7:43 ` Joerg Roedel
2022-04-15 16:57 ` Sean Christopherson
2022-04-15 17:22 ` Marc Orr
2022-04-15 17:42 ` Marc Orr
2022-04-15 18:30 ` Sean Christopherson
2022-04-15 18:45 ` Marc Orr
2022-04-15 19:11 ` Sean Christopherson [this message]
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=YlnDclyQmmaISvAZ@google.com \
--to=seanjc@google.com \
--cc=Thomas.Lendacky@amd.com \
--cc=bp@suse.de \
--cc=brijesh.singh@amd.com \
--cc=drjones@redhat.com \
--cc=erdemaktas@google.com \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=marcorr@google.com \
--cc=pbonzini@redhat.com \
--cc=rientjes@google.com \
--cc=varad.gautam@suse.com \
--cc=zxwang42@gmail.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.