qemu/target/i386/kvm
Paolo Bonzini 3ec5ad4008 target/i386: kvm: do not access uninitialized variable on older kernels
KVM support for AMX includes a new system attribute, KVM_X86_XCOMP_GUEST_SUPP.
Commit 19db68ca68 ("x86: Grant AMX permission for guest", 2022-03-15) however
did not fully consider the behavior on older kernels.  First, it warns
too aggressively.  Second, it invokes the KVM_GET_DEVICE_ATTR ioctl
unconditionally and then uses the "bitmask" variable, which remains
uninitialized if the ioctl fails.  Third, kvm_ioctl returns -errno rather
than -1 on errors.

While at it, explain why the ioctl is needed and KVM_GET_SUPPORTED_CPUID
is not enough.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-20 20:38:52 +01:00
..
hyperv-proto.h i386: Implement pseudo 'hv-avic' ('hv-apicv') enlightenment 2021-10-01 19:04:45 +02:00
hyperv-stub.c
hyperv.c
hyperv.h
kvm_i386.h x86: Grant AMX permission for guest 2022-03-15 11:50:50 +01:00
kvm-cpu.c x86: Grant AMX permission for guest 2022-03-15 11:50:50 +01:00
kvm-cpu.h i386: split cpu accelerators from cpu.c, using AccelCPUClass 2021-05-10 15:41:49 -04:00
kvm-stub.c i386: expand Hyper-V features during CPU feature expansion time 2021-07-13 09:13:29 -04:00
kvm.c target/i386: kvm: do not access uninitialized variable on older kernels 2022-03-20 20:38:52 +01:00
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 2021-10-13 10:47:49 +02:00
sev-stub.c target/i386/sev: Declare system-specific functions in 'sev.h' 2021-10-13 10:47:49 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h