From 12f91c70a38b74fbe167b21ad1fb9d7789faa8ca Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Tue, 24 Feb 2015 05:15:40 +0000 Subject: [PATCH] Emulate MSR 0xC0011024 when running on AMD processors. OpenBSD guests test bit 0 of this MSR to detect whether the workaround for erratum 721 has been applied. Reported by: Jason Tubnor (jason@tubnor.net) MFC after: 1 week --- usr.sbin/bhyve/xmsr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usr.sbin/bhyve/xmsr.c b/usr.sbin/bhyve/xmsr.c index d50a93945449..5b7bfbbc71e3 100644 --- a/usr.sbin/bhyve/xmsr.c +++ b/usr.sbin/bhyve/xmsr.c @@ -185,6 +185,15 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t num, uint64_t *val) *val = 0; break; + /* + * OpenBSD guests test bit 0 of this MSR to detect if the + * workaround for erratum 721 is already applied. + * http://support.amd.com/TechDocs/41322_10h_Rev_Gd.pdf + */ + case 0xC0011029: + *val = 1; + break; + default: error = -1; break;