From: Sean Christopherson <seanjc@google.com>
To: Mingwei Zhang <mizhang@google.com>
Cc: Ashish Kalra <ashish.kalra@amd.com>,
Jacky Li <jackyli@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Ovidiu Panait <ovidiu.panait@windriver.com>,
Liam Merwick <liam.merwick@oracle.com>,
David Rientjes <rientjes@google.com>,
David Kaplan <david.kaplan@amd.com>,
Peter Gonda <pgonda@google.com>,
kvm@vger.kernel.org, Michael Roth <michael.roth@amd.com>
Subject: Re: [RFC PATCH 0/4] KVM: SEV: Limit cache flush operations in sev guest memory reclaim events
Date: Fri, 1 Dec 2023 14:13:52 -0800 [thread overview]
Message-ID: <ZWpaoLpWNk_P_zum@google.com> (raw)
In-Reply-To: <CAL715WK7zF3=HJf9qkA-pbs1VMMxSw_=2Z-e6e_621HnK-nC8g@mail.gmail.com>
On Fri, Dec 01, 2023, Mingwei Zhang wrote:
> On Fri, Dec 1, 2023 at 1:30 PM Kalra, Ashish <ashish.kalra@amd.com> wrote:
> > For SNP + gmem, where the HVA ranges covered by the MMU notifiers are
> > not acting on encrypted pages, we are ignoring MMU invalidation
> > notifiers for SNP guests as part of the SNP host patches being posted
> > upstream and instead relying on gmem own invalidation stuff to clean
> > them up on a per-folio basis.
> >
> > Thanks,
> > Ashish
>
> oh, I have no question about that. This series only applies to
> SEV/SEV-ES type of VMs.
>
> For SNP + guest_memfd, I don't see the implementation details, but I
> doubt you can ignore mmu_notifiers if the request does cover some
> encrypted memory in error cases or corner cases. Does the SNP enforce
> the usage of guest_memfd? How do we prevent exceptional cases? I am
> sure you guys already figured out the answers, so I don't plan to dig
> deeper until SNP host pages are accepted.
KVM will not allow SNP guests to map VMA-based memory as encrypted/private, full
stop. Any invalidations initiated by mmu_notifiers will therefore apply only to
shared memory.
That approach doesn't work for SEV/SEV-ES because KVM can't prevent the guest
from accessing memory as encrypted, i.e. KVM needs the #NPF due to RMP violation
to intercept attempts to convert a GFN from shared to private.
next prev parent reply other threads:[~2023-12-01 22:13 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 ` [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 [this message]
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=ZWpaoLpWNk_P_zum@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=michael.roth@amd.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 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).