From: Sean Christopherson <seanjc@google.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 0/2] KVM: x86/mmu: .change_pte() optimization in TDP MMU
Date: Wed, 6 Sep 2023 09:46:35 -0700 [thread overview]
Message-ID: <ZPis61o4lkjr0mMU@google.com> (raw)
In-Reply-To: <5d81a9cd-f96d-bcdb-7878-74c2ead26cfb@arm.com>
On Wed, Sep 06, 2023, Robin Murphy wrote:
> On 2023-09-06 15:44, Sean Christopherson wrote:
> > On Wed, Sep 06, 2023, Robin Murphy wrote:
> > > Even non-virtualised, SWIOTLB is pretty horrible for I/O performance by its
> > > very nature - avoiding it if at all possible should always be preferred.
> >
> > Yeah. The main reason I didn't just sweep this under the rug is the confidential
> > VM use case, where SWIOTLB is used to bounce data from guest private memory into
> > shread buffers. There's also a good argument that anyone that cares about I/O
> > performance in confidential VMs should put in the effort to enlighten their device
> > drivers to use shared memory directly, but practically speaking that's easier said
> > than done.
>
> Indeed a bunch of work has gone into SWIOTLB recently trying to make it a
> bit more efficient for such cases where it can't be avoided, so it is
> definitely still interesting to learn about impacts at other levels like
> this. Maybe there's a bit of a get-out for confidential VMs though, since
> presumably there's not much point COW-ing encrypted private memory, so
> perhaps KVM might end up wanting to optimise that out and thus happen to end
> up less sensitive to unavoidable SWIOTLB behaviour anyway?
CoW should be a non-issue for confidential VMs, at least on x86. SEV and SEV-ES
are effectively forced to pin memory as writable before it can be mapped into the
guest. TDX and SNP and will have a different implementation, but similar behavior.
Confidential VMs would benefit purely by either eliminating or reducing the cost
of "initializing" memory, i.e. by eliminating the memcpy() or replacing it with a
memset(). I most definitely don't care enough about confidential VM I/O performance
to try and micro-optimize that behavior, their existence was simply what made me
look more closely instead of just telling Yan to stop using IDE :-)
next prev parent reply other threads:[~2023-09-06 16:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 8:50 [PATCH 0/2] KVM: x86/mmu: .change_pte() optimization in TDP MMU Yan Zhao
2023-08-08 8:53 ` [PATCH 1/2] KVM: x86/mmu: Remove dead code in .change_pte() handler in x86 " Yan Zhao
2023-08-08 8:54 ` [PATCH 2/2] KVM: x86/mmu: prefetch SPTE directly in x86 TDP MMU's change_pte() handler Yan Zhao
2023-08-16 18:18 ` [PATCH 0/2] KVM: x86/mmu: .change_pte() optimization in TDP MMU Sean Christopherson
2023-08-17 0:00 ` Yan Zhao
2023-08-17 17:53 ` Sean Christopherson
2023-08-18 10:17 ` Yan Zhao
2023-08-18 13:46 ` Sean Christopherson
2023-09-04 7:03 ` Yan Zhao
2023-09-05 18:59 ` Sean Christopherson
2023-09-05 19:30 ` Linus Torvalds
2023-09-06 0:29 ` Robin Murphy
2023-09-06 14:44 ` Sean Christopherson
2023-09-06 16:18 ` Robin Murphy
2023-09-06 16:46 ` Sean Christopherson [this message]
2023-09-08 8:18 ` Christoph Hellwig
2023-09-05 20:18 ` Sean Christopherson
2023-09-06 1:51 ` Yan Zhao
2023-09-06 22:17 ` Paolo Bonzini
2023-09-07 0:51 ` Sean Christopherson
2023-09-07 0:36 ` Yan Zhao
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=ZPis61o4lkjr0mMU@google.com \
--to=seanjc@google.com \
--cc=hch@lst.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=pbonzini@redhat.com \
--cc=robin.murphy@arm.com \
--cc=torvalds@linux-foundation.org \
--cc=yan.y.zhao@intel.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.