svn commit: r358147 - in stable/12/usr.sbin: bhyve bhyvectl

Konstantin Belousov kib at FreeBSD.org
Thu Feb 20 01:39:49 UTC 2020


Author: kib
Date: Thu Feb 20 01:39:48 2020
New Revision: 358147
URL: https://svnweb.freebsd.org/changeset/base/358147

Log:
  MFC r357866:
  bhyve, bhyvectl: Add Hygon Dhyana support.

Modified:
  stable/12/usr.sbin/bhyve/xmsr.c
  stable/12/usr.sbin/bhyvectl/bhyvectl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/xmsr.c
==============================================================================
--- stable/12/usr.sbin/bhyve/xmsr.c	Thu Feb 20 01:38:56 2020	(r358146)
+++ stable/12/usr.sbin/bhyve/xmsr.c	Thu Feb 20 01:39:48 2020	(r358147)
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
 
 #include "xmsr.h"
 
-static int cpu_vendor_intel, cpu_vendor_amd;
+static int cpu_vendor_intel, cpu_vendor_amd, cpu_vendor_hygon;
 
 int
 emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t num, uint64_t val)
@@ -63,7 +63,7 @@ emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t nu
 		default:
 			break;
 		}
-	} else if (cpu_vendor_amd) {
+	} else if (cpu_vendor_amd || cpu_vendor_hygon) {
 		switch (num) {
 		case MSR_HWCR:
 			/*
@@ -127,7 +127,7 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t nu
 			error = -1;
 			break;
 		}
-	} else if (cpu_vendor_amd) {
+	} else if (cpu_vendor_amd || cpu_vendor_hygon) {
 		switch (num) {
 		case MSR_BIOS_SIGN:
 			*val = 0;
@@ -224,6 +224,8 @@ init_msr(void)
 	error = 0;
 	if (strcmp(cpu_vendor, "AuthenticAMD") == 0) {
 		cpu_vendor_amd = 1;
+	} else if (strcmp(cpu_vendor, "HygonGenuine") == 0) {
+		cpu_vendor_hygon = 1;
 	} else if (strcmp(cpu_vendor, "GenuineIntel") == 0) {
 		cpu_vendor_intel = 1;
 	} else {

Modified: stable/12/usr.sbin/bhyvectl/bhyvectl.c
==============================================================================
--- stable/12/usr.sbin/bhyvectl/bhyvectl.c	Thu Feb 20 01:38:56 2020	(r358146)
+++ stable/12/usr.sbin/bhyvectl/bhyvectl.c	Thu Feb 20 01:39:48 2020	(r358147)
@@ -657,6 +657,8 @@ cpu_vendor_intel(void)
 
 	if (strcmp(cpu_vendor, "AuthenticAMD") == 0) {
 		return (false);
+	} else if (strcmp(cpu_vendor, "HygonGenuine") == 0) {
+		return (false);
 	} else if (strcmp(cpu_vendor, "GenuineIntel") == 0) {
 		return (true);
 	} else {


More information about the svn-src-all mailing list