summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2020-07-29 22:26:22 +0000
committerPatrick Mooney <pmooney@oxide.computer>2020-08-01 18:53:27 +0000
commit425a83377a83720d1e9907ec3641a499a5eed18f (patch)
tree0f18bb7ffc51fe7e9761b2dd09865bdbcfb90f0e
parentec82ad7502f4abb881c6b3012833e59fd3c24594 (diff)
downloadillumos-joyent-425a83377a83720d1e9907ec3641a499a5eed18f.tar.gz
12998 OpenBSD needs DE_CFG MSR on AMD bhyve
Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Mike Zeller <mike.zeller@joyent.com> Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/contrib/bhyve/x86/specialreg.h1
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/svm_msr.c26
2 files changed, 26 insertions, 1 deletions
diff --git a/usr/src/contrib/bhyve/x86/specialreg.h b/usr/src/contrib/bhyve/x86/specialreg.h
index f528bad55c..b170cf3981 100644
--- a/usr/src/contrib/bhyve/x86/specialreg.h
+++ b/usr/src/contrib/bhyve/x86/specialreg.h
@@ -1100,6 +1100,7 @@
#define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */
#define MSR_LS_CFG 0xc0011020
#define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */
+#define MSR_DE_CFG 0xc0011029 /* Decode Configuration */
/* MSR_VM_CR related */
#define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */
diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm_msr.c b/usr/src/uts/i86pc/io/vmm/amd/svm_msr.c
index 0c1ce0e4e0..75502d3c8e 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/svm_msr.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/svm_msr.c
@@ -25,6 +25,18 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * Copyright 2020 Oxide Computer Company
+ */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -152,6 +164,14 @@ svm_rdmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t *result,
case MSR_EXTFEATURES:
*result = 0;
break;
+ case MSR_DE_CFG:
+ /*
+ * MSR_DE_CFG is used for a vast array of AMD errata, spanning
+ * from family 10h to 17h. In the future, it might make sense
+ * to more thoroughly emulate its contents.
+ */
+ *result = 0;
+ break;
default:
error = EINVAL;
break;
@@ -177,7 +197,11 @@ svm_wrmsr(struct svm_softc *sc, int vcpu, u_int num, uint64_t val, bool *retu)
case MSR_MTRR16kBase ... MSR_MTRR16kBase + 1:
case MSR_MTRR64kBase:
case MSR_SYSCFG:
- break; /* Ignore writes */
+ /* Ignore writes */
+ break;
+ case MSR_DE_CFG:
+ /* Ignore writes for now. (See: svm_rdmsr) */
+ break;
case MSR_AMDK8_IPM:
/*
* Ignore writes to the "Interrupt Pending Message" MSR.