All of lore.kernel.org
 help / color / mirror / Atom feed
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 4/4] KVM: SEV: Use a bitmap module param to decide whether a cache flush is needed during the guest memory reclaim
Date: Fri, 1 Dec 2023 10:00:14 -0800	[thread overview]
Message-ID: <ZWofLnuB7_BcTxDK@google.com> (raw)
In-Reply-To: <20231110003734.1014084-5-jackyli@google.com>

On Fri, Nov 10, 2023, Jacky Li wrote:
> Use a bitmap to provide the flexibility on deciding whether the flush is
> needed for a specific mmu notifier event. The cache flush during memory
> reclamation was originally introduced to address the cache incoherency
> issues in some SME_COHERENT platforms. User may configure the bitmap
> depending on the hardware (e.g. No flush needed when SME_COHERENT can
> extend to DMA devices) or userspace VMM (e.g. No flush needed when VMM
> ensures guest memory is properly unpinned).

Absolutely not.  KVM and the kernel must know when a flush is needed and when it
is not.  The various errata around cache line aliasing is far too messy to punt
to userspace.  Not to mention this bleeds kernel internals to userspace and thus
risks unintentionally creating an ABI.

  reply	other threads:[~2023-12-01 18:00 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 [this message]
2023-12-01 18:05 ` [RFC PATCH 0/4] KVM: SEV: Limit cache flush operations in sev guest memory reclaim events Sean Christopherson
2023-12-01 19:02   ` 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=ZWofLnuB7_BcTxDK@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.