Re: [PATCH] mce: use safe MSR accesses

From: Borislav Petkov
Date: Thu Mar 12 2015 - 13:32:31 EST


On Thu, Mar 12, 2015 at 12:20:07PM -0500, Joel Schopp wrote:
> These MSRs don't make sense in guest mode. The real question is if we
> fix that in KVM, here, or both. I'm a fan of fixing it in both places.
> Xen's behavior is to return a value of 0 if the guest tries to access
> these, that seems like a reasonable thing to do in KVM as well. I am
> volunteering myself to write that patch for KVM, but I would encourage

This should be first and foremost fixed in KVM as it is KVM which is
advertizing MCA CPUID feature and the guest simply uses it with all MSRs
which belong to it.

> accepting an updated version of this patch as well.

If you want to do that, I'd suggest using the error checking variants
in arch/x86/lib/msr.c which should also facilitate toggling of bits in
MSRs.

> Initializing val to 0 where it is declared should have the desired
> effect.

Yes, as long as KVM returns 0 for MC4_MISC0/1.

Thanks.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/