Re: [PATCH v2] target/i386: kvm: do not access uninitialized variable on older kernels

2022-03-22 Thread Richard Henderson
On 3/20/22 12:39, Paolo Bonzini wrote: +if (rc < 0) { +if (rc != -ENXIO) { +warn_report("KVM_GET_DEVICE_ATTR(0, KVM_X86_XCOMP_GUEST_SUPP) " +"error: %d", rc); Better as "error: %s", strerror(-rc) ? r~

Re: [PATCH v2] target/i386: kvm: do not access uninitialized variable on older kernels

2022-03-21 Thread Peter Krempa
On Sun, Mar 20, 2022 at 20:39:14 +0100, Paolo Bonzini wrote: > 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 >

[PATCH v2] target/i386: kvm: do not access uninitialized variable on older kernels

2022-03-20 Thread Paolo Bonzini
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