[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 00/19] QEMU gmem implemention
From: |
Isaku Yamahata |
Subject: |
Re: [RFC PATCH 00/19] QEMU gmem implemention |
Date: |
Mon, 31 Jul 2023 10:10:41 -0700 |
On Mon, Jul 31, 2023 at 12:21:42PM -0400,
Xiaoyao Li <xiaoyao.li@intel.com> 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.
Hi Xiaoyao. Because qemu has already confidential guest support, we should
utilize it. Say,
qemu \
-object sw-protected, id=swp0, <more options for KVM_X86_SW_PROTECTED_VM> \
-machine confidential-guest-support=swp0
> 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.
Memory region property (how to create KVM memory slot) should be independent
from underlying VM type. Some (e.g. TDX) may require KVM private memory slot,
some may not. Leave the decision to its vm type backend. They can use qemu
memory listener.
--
Isaku Yamahata <isaku.yamahata@gmail.com>
- [RFC PATCH 11/19] kvm/memory: Introduce the infrastructure to set the default shared/private value, (continued)
- [RFC PATCH 11/19] kvm/memory: Introduce the infrastructure to set the default shared/private value, Xiaoyao Li, 2023/07/31
- [RFC PATCH 12/19] i386/kvm: Set memory to default private for KVM_X86_SW_PROTECTED_VM, Xiaoyao Li, 2023/07/31
- [RFC PATCH 13/19] physmem: replace function name with __func__ in ram_block_discard_range(), Xiaoyao Li, 2023/07/31
- [RFC PATCH 14/19] physmem: Add ram_block_convert_range, Xiaoyao Li, 2023/07/31
- [RFC PATCH 15/19] kvm: handle KVM_EXIT_MEMORY_FAULT, Xiaoyao Li, 2023/07/31
- [RFC PATCH 16/19] trace/kvm: Add trace for page convertion between shared and private, Xiaoyao Li, 2023/07/31
- [RFC PATCH 17/19] pci-host/q35: Move PAM initialization above SMRAM initialization, Xiaoyao Li, 2023/07/31
- [RFC PATCH 18/19] q35: Introduce smm_ranges property for q35-pci-host, Xiaoyao Li, 2023/07/31
- Re: [RFC PATCH 00/19] QEMU gmem implemention, Daniel P . Berrangé, 2023/07/31
- Re: [RFC PATCH 00/19] QEMU gmem implemention,
Isaku Yamahata <=