From: Sean Christopherson <seanjc@google.com>
To: Jacky Li <jackyli@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Ovidiu Panait <ovidiu.panait@windriver.com>,
Liam Merwick <liam.merwick@oracle.com>,
Ashish Kalra <Ashish.Kalra@amd.com>,
David Rientjes <rientjes@google.com>,
David Kaplan <david.kaplan@amd.com>,
Peter Gonda <pgonda@google.com>,
Mingwei Zhang <mizhang@google.com>,
kvm@vger.kernel.org
Subject: Re: [RFC PATCH 0/4] KVM: SEV: Limit cache flush operations in sev guest memory reclaim events
Date: Fri, 1 Dec 2023 10:05:04 -0800 [thread overview]
Message-ID: <ZWogUHqoIwiHGehZ@google.com> (raw)
In-Reply-To: <20231110003734.1014084-1-jackyli@google.com>
On Fri, Nov 10, 2023, Jacky Li wrote:
> The cache flush operation in sev guest memory reclaim events was
> originally introduced to prevent security issues due to cache
> incoherence and untrusted VMM. However when this operation gets
> triggered, it causes performance degradation to the whole machine.
>
> This cache flush operation is performed in mmu_notifiers, in particular,
> in the mmu_notifier_invalidate_range_start() function, unconditionally
> on all guest memory regions. Although the intention was to flush
> cache lines only when guest memory was deallocated, the excessive
> invocations include many other cases where this flush is unnecessary.
>
> This RFC proposes using the mmu notifier event to determine whether a
> cache flush is needed. Specifically, only do the cache flush when the
> address range is unmapped, cleared, released or migrated. A bitmap
> module param is also introduced to provide flexibility when flush is
> needed in more events or no flush is needed depending on the hardware
> platform.
I'm still not at all convinced that this is worth doing. We have clear line of
sight to cleanly and optimally handling SNP and beyond. If there is an actual
use case that wants to run SEV and/or SEV-ES VMs, which can't support page
migration, on the same host as traditional VMs, _and_ for some reason their
userspace is incapable of providing reasonable NUMA locality, then the owners of
that use case can speak up and provide justification for taking on this extra
complexity in KVM.
next prev parent reply other threads:[~2023-12-01 18:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 0:37 [RFC PATCH 0/4] KVM: SEV: Limit cache flush operations in sev guest memory reclaim events Jacky Li
2023-11-10 0:37 ` [RFC PATCH 1/4] KVM: SEV: Drop wbinvd_on_all_cpus() as kvm mmu notifier would flush the cache Jacky Li
2023-12-01 17:53 ` Sean Christopherson
2023-11-10 0:37 ` [RFC PATCH 2/4] KVM: SEV: Plumb mmu_notifier_event into sev function Jacky Li
2023-11-10 0:37 ` [RFC PATCH 3/4] KVM: SEV: Limit the call of WBINVDs based on the event type of mmu notifier Jacky Li
2023-11-10 18:52 ` Kalra, Ashish
2023-11-10 0:37 ` [RFC PATCH 4/4] KVM: SEV: Use a bitmap module param to decide whether a cache flush is needed during the guest memory reclaim Jacky Li
2023-12-01 18:00 ` Sean Christopherson
2023-12-01 18:05 ` Sean Christopherson [this message]
2023-12-01 19:02 ` [RFC PATCH 0/4] KVM: SEV: Limit cache flush operations in sev guest memory reclaim events Mingwei Zhang
2023-12-01 21:30 ` Kalra, Ashish
2023-12-01 21:58 ` Mingwei Zhang
2023-12-01 22:13 ` Kalra, Ashish
2023-12-01 22:13 ` Sean Christopherson
2023-12-01 22:22 ` Mingwei Zhang
2023-12-01 22:30 ` Sean Christopherson
2023-12-02 6:21 ` Mingwei Zhang
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=ZWogUHqoIwiHGehZ@google.com \
--to=seanjc@google.com \
--cc=Ashish.Kalra@amd.com \
--cc=david.kaplan@amd.com \
--cc=jackyli@google.com \
--cc=kvm@vger.kernel.org \
--cc=liam.merwick@oracle.com \
--cc=mizhang@google.com \
--cc=ovidiu.panait@windriver.com \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=rientjes@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 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.