[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 15/26] target/i386: Implement mc->kvm_type() to get VM type
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 15/26] target/i386: Implement mc->kvm_type() to get VM type |
Date: |
Mon, 25 Mar 2024 11:57:37 +0100 |
On Mon, Mar 25, 2024 at 10:29 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> On 22/3/24 19:11, Paolo Bonzini wrote:
> > KVM is introducing a new API to create confidential guests, which
> > will be used by TDX and SEV-SNP but is also available for SEV and
> > SEV-ES. The API uses the VM type argument to KVM_CREATE_VM to
> > identify which confidential computing technology to use.
> >
> > Since there are no other expected uses of VM types, delegate
> > mc->kvm_type() for x86 boards to the confidential-guest-support
>
> s/mc/cgs/ here and in subject?
No, this refers to x86_kvm_type(), which is the implementation
mc->kvm_type. As the commit message says, mc->kvm_type() is delegated
to cgs->kvm_type(), via kvm_get_vm_type().
Paolo
> > object pointed to by ms->cgs.
> >
> > For example, if a sev-guest object is specified to
> > confidential-guest-support,
> > like,
> >
> > qemu -machine ...,confidential-guest-support=sev0 \
> > -object sev-guest,id=sev0,...
> >
> > it will check if a VM type KVM_X86_SEV_VM or KVM_X86_SEV_ES_VM
> > is supported, and if so use them together with the KVM_SEV_INIT2
> > function of the KVM_MEMORY_ENCRYPT_OP ioctl. If not, it will fall back to
> > KVM_SEV_INIT and KVM_SEV_ES_INIT.
> >
> > This is a preparatory work towards TDX and SEV-SNP support, but it
> > will also enable support for VMSA features such as DebugSwap, which
> > are only available via KVM_SEV_INIT2.
> >
> > Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com>
> > Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> > target/i386/confidential-guest.h | 19 ++++++++++++++
> > target/i386/kvm/kvm_i386.h | 2 ++
> > hw/i386/x86.c | 11 ++++++++
> > target/i386/kvm/kvm.c | 44 ++++++++++++++++++++++++++++++++
> > 4 files changed, 76 insertions(+)
>
- [PATCH 14/26] target/i386: introduce x86-confidential-guest, (continued)
- [PATCH 14/26] target/i386: introduce x86-confidential-guest, Paolo Bonzini, 2024/03/22
- [PATCH 16/26] target/i386: SEV: use KVM_SEV_INIT2 if possible, Paolo Bonzini, 2024/03/22
- [PATCH 17/26] trace/kvm: Split address space and slot id in trace_kvm_set_user_memory(), Paolo Bonzini, 2024/03/22
- [PATCH 20/26] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot, Paolo Bonzini, 2024/03/22
- [PATCH 18/26] kvm: Introduce support for memory_attributes, Paolo Bonzini, 2024/03/22
- [PATCH 19/26] RAMBlock: Add support of KVM private guest memfd, Paolo Bonzini, 2024/03/22
- [PATCH 15/26] target/i386: Implement mc->kvm_type() to get VM type, Paolo Bonzini, 2024/03/22
- [PATCH 21/26] kvm/memory: Make memory type private by default if it has guest memfd backend, Paolo Bonzini, 2024/03/22
- [PATCH 22/26] HostMem: Add mechanism to opt in kvm guest memfd via MachineState, Paolo Bonzini, 2024/03/22
- [PATCH 23/26] RAMBlock: make guest_memfd require uncoordinated discard, Paolo Bonzini, 2024/03/22
- [PATCH 24/26] physmem: Introduce ram_block_discard_guest_memfd_range(), Paolo Bonzini, 2024/03/22
- [PATCH 25/26] kvm: handle KVM_EXIT_MEMORY_FAULT, Paolo Bonzini, 2024/03/22
- [PATCH 26/26] i386/kvm: Move architectural CPUID leaf generation to separate helper, Paolo Bonzini, 2024/03/22