From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Sean Christopherson" <seanjc@google.com>,
"David Hildenbrand" <david@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Peter Xu" <peterx@redhat.com>,
"Chao Peng" <chao.p.peng@linux.intel.com>,
"Michael Roth" <michael.roth@amd.com>,
isaku.yamahata@gmail.com, qemu-devel@nongnu.org,
kvm@vger.kernel.org
Subject: Re: [RFC PATCH 00/19] QEMU gmem implemention
Date: Mon, 31 Jul 2023 17:51:28 +0100 [thread overview]
Message-ID: <ZMfmkCQImgsinE6T@redhat.com> (raw)
In-Reply-To: <20230731162201.271114-1-xiaoyao.li@intel.com>
On Mon, Jul 31, 2023 at 12:21:42PM -0400, Xiaoyao Li wrote:
> This is the first RFC version of enabling KVM gmem[1] as the backend for
> private memory of KVM_X86_PROTECTED_VM.
>
> It adds the support to create a specific KVM_X86_PROTECTED_VM type VM,
> and introduces 'private' property for memory backend. When the vm type
> is KVM_X86_PROTECTED_VM and memory backend has private enabled as below,
> it will call KVM gmem ioctl to allocate private memory for the backend.
>
> $qemu -object memory-backend-ram,id=mem0,size=1G,private=on \
> -machine q35,kvm-type=sw-protected-vm,memory-backend=mem0 \
> ...
>
> Unfortunately this patch series fails the boot of OVMF at very early
> stage due to triple fault because KVM doesn't support emulate string IO
> to private memory. We leave it as an open to be discussed.
>
> There are following design opens that need to be discussed:
>
> 1. how to determine the vm type?
>
> a. like this series, specify the vm type via machine property
> 'kvm-type'
> b. check the memory backend, if any backend has 'private' property
> set, the vm-type is set to KVM_X86_PROTECTED_VM.
>
> 2. whether 'private' property is needed if we choose 1.b as design
>
> with 1.b, QEMU can decide whether the memory region needs to be
> private (allocates gmem fd for it) or not, on its own.
>
> 3. What is KVM_X86_SW_PROTECTED_VM going to look like? What's the
> purose of it and what's the requirement on it. I think it's the
> questions for KVM folks than QEMU folks.
>
> Any other idea/open/question is welcomed.
>
>
> Beside, TDX QEMU implemetation is based on this series to provide
> private gmem for TD private memory, which can be found at [2].
> And it can work corresponding KVM [3] to boot TDX guest.
We already have a general purpose configuration mechanism for
confidential guests. The -machine argument has a property
confidential-guest-support=$OBJECT-ID, for pointing to an
object that implements the TYPE_CONFIDENTIAL_GUEST_SUPPORT
interface in QEMU. This is implemented with SEV, PPC PEF
mode, and s390 protvirt.
I would expect TDX to follow this same design ie
qemu-system-x86_64 \
-object tdx-guest,id=tdx0,..... \
-machine q35,confidential-guest-support=tdx0 \
...
and not require inventing the new 'kvm-type' attribute at least.
For the memory backend though, I'm not so sure - possibly that
might be something that still wants an extra property to identify
the type of memory to allocate, since we use memory-backend-ram
for a variety of use cases. Or it could be an entirely new object
type such as "memory-backend-gmem"
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-07-31 16:52 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 16:21 [RFC PATCH 00/19] QEMU gmem implemention Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 01/19] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory() Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 02/19] *** HACK *** linux-headers: Update headers to pull in gmem APIs Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 03/19] RAMBlock: Support KVM gmemory Xiaoyao Li
2023-08-01 16:33 ` David Hildenbrand
2023-07-31 16:21 ` [RFC PATCH 04/19] memory: Introduce memory_region_can_be_private() Xiaoyao Li
2023-07-31 21:23 ` Peter Xu
2023-07-31 21:33 ` Michael S. Tsirkin
2023-07-31 21:34 ` Sean Christopherson
2023-07-31 21:36 ` Michael S. Tsirkin
2023-08-01 0:21 ` Peter Xu
2023-08-01 16:23 ` Sean Christopherson
2023-08-01 16:48 ` Claudio Fontana
2023-08-01 16:52 ` Claudio Fontana
2023-08-02 8:05 ` Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 05/19] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot Xiaoyao Li
2023-08-01 17:10 ` Claudio Fontana
2023-08-03 8:43 ` Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 06/19] i386/pc: Drop pc_machine_kvm_type() Xiaoyao Li
2023-08-02 23:00 ` Isaku Yamahata
2023-07-31 16:21 ` [RFC PATCH 07/19] target/i386: Implement mc->kvm_type() to get VM type Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 08/19] HostMem: Add private property to indicate to use kvm gmem Xiaoyao Li
2023-07-31 17:22 ` Markus Armbruster
2023-08-01 14:54 ` Xiaoyao Li
2023-08-01 14:57 ` Daniel P. Berrangé
2023-08-02 8:04 ` Xiaoyao Li
2023-08-01 17:21 ` David Hildenbrand
2023-08-02 8:03 ` Xiaoyao Li
2023-08-02 14:14 ` David Hildenbrand
2023-08-02 22:53 ` Isaku Yamahata
2023-08-03 13:05 ` David Hildenbrand
2023-07-31 16:21 ` [RFC PATCH 09/19] i386/kvm: Create gmem fd for KVM_X86_SW_PROTECTED_VM Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 10/19] kvm: Introduce support for memory_attributes Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 11/19] kvm/memory: Introduce the infrastructure to set the default shared/private value Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 12/19] i386/kvm: Set memory to default private for KVM_X86_SW_PROTECTED_VM Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 13/19] physmem: replace function name with __func__ in ram_block_discard_range() Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 14/19] physmem: Add ram_block_convert_range Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT Xiaoyao Li
2023-08-02 22:25 ` Isaku Yamahata
2023-09-13 6:59 ` Xiaoyao Li
2023-08-09 15:02 ` Xu Yilun
2023-09-13 7:00 ` Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 16/19] trace/kvm: Add trace for page convertion between shared and private Xiaoyao Li
2023-07-31 16:21 ` [RFC PATCH 17/19] pci-host/q35: Move PAM initialization above SMRAM initialization Xiaoyao Li
2023-07-31 16:22 ` [RFC PATCH 18/19] q35: Introduce smm_ranges property for q35-pci-host Xiaoyao Li
2023-07-31 16:22 ` [RFC PATCH 19/19] i386: Disable SMM mode for X86_SW_PROTECTED_VM Xiaoyao Li
2023-08-02 22:27 ` Isaku Yamahata
2023-07-31 16:51 ` Daniel P. Berrangé [this message]
2023-08-01 1:45 ` [RFC PATCH 00/19] QEMU gmem implemention Xiaoyao Li
2023-08-10 15:58 ` Michael Roth
2023-08-10 15:58 ` Michael Roth via
2023-08-14 21:45 ` Isaku Yamahata
2023-07-31 17:10 ` Isaku Yamahata
2023-08-01 1:55 ` Xiaoyao Li
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=ZMfmkCQImgsinE6T@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=chao.p.peng@linux.intel.com \
--cc=david@redhat.com \
--cc=eblake@redhat.com \
--cc=imammedo@redhat.com \
--cc=isaku.yamahata@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=seanjc@google.com \
--cc=xiaoyao.li@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.