Re: [PATCH 3/4] KVM: x86: WARN and reject loading KVM if NX is supported but not enabled

From: Paolo Bonzini
Date: Fri Jun 18 2021 - 06:27:38 EST


On 16/06/21 00:39, Jim Mattson wrote:

rdmsrl_safe(MSR_EFER, &host_efer);
+ if (WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_NX) &&
+ !(host_efer & EFER_NX)))
+ return -EIO;
Input/output error? Is that really the most appropriate error here?
Why not, say, -ENOTSUP?

I'm sure there's some arcane convention here that I'm not privy to.:-)

Reviewed-by: Jim Mattson<jmattson@xxxxxxxxxx>


EIO often means "how the heck did we get here?" or "look in dmesg to get more info", both of which I think are appropriate after a WARN.

Paolo