qemu/target
Paolo Bonzini ee88612df1 target/i386: Implement mc->kvm_type() to get VM type
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
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>
2024-04-23 17:35:25 +02:00
..
alpha target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:16 +01:00
arm KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
avr target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
cris target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
hexagon target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 11:46:17 +01:00
hppa target/hppa: Use insn_start from DisasContextBase 2024-04-09 07:45:09 -10:00
i386 target/i386: Implement mc->kvm_type() to get VM type 2024-04-23 17:35:25 +02:00
loongarch KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
m68k target/m68k: Map FPU exceptions to FPSR register 2024-04-09 07:43:31 -10:00
microblaze target/microblaze: Use insn_start from DisasContextBase 2024-04-09 07:45:09 -10:00
mips KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
nios2 target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
openrisc target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
ppc KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
riscv KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
rx target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:24 +01:00
s390x KVM: remove kvm_arch_cpu_check_are_resettable 2024-04-23 17:35:25 +02:00
sh4 target/sh4: add missing CHECK_NOT_DELAY_SLOT 2024-04-09 07:43:31 -10:00
sparc target/sparc: Use GET_ASI_CODE for ASI_KERNELTXT and ASI_USERTXT 2024-04-12 14:48:01 -07:00
tricore target/tricore/helper: Use correct string format in cpu_tlb_fill() 2024-03-26 14:24:06 +01:00
xtensa target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro 2024-03-12 12:04:25 +01:00
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build target: Make qemu_target_page_mask() available for *-user 2024-01-29 21:04:10 +10:00
target-common.c target: Make qemu_target_page_mask() available for *-user 2024-01-29 21:04:10 +10:00