diff options
author | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2017-10-11 15:55:00 +0200 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2018-09-26 21:30:14 +0200 |
commit | fbd54cb5fecaf7d64cca371aa5ff1b2a8a3d5a11 (patch) | |
tree | 9d3d96876db1623044cfa640b256fed4229706ed | |
parent | 9f16e2df28efab26216cf68e3841c0a460c5bb73 (diff) | |
download | illumos-joyent-fbd54cb5fecaf7d64cca371aa5ff1b2a8a3d5a11.tar.gz |
9792 support bhyve as a platform
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>
Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r-- | usr/src/uts/i86pc/io/pcplusmp/apic_common.c | 4 | ||||
-rw-r--r-- | usr/src/uts/i86pc/os/cpuid.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/x86_archext.h | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/io/pcplusmp/apic_common.c b/usr/src/uts/i86pc/io/pcplusmp/apic_common.c index 6e37c2ed59..a884694bfa 100644 --- a/usr/src/uts/i86pc/io/pcplusmp/apic_common.c +++ b/usr/src/uts/i86pc/io/pcplusmp/apic_common.c @@ -1675,6 +1675,7 @@ apic_check_msi_support() dev_info_t *cdip; char dev_type[16]; int dev_len; + int hwenv = get_hwenv(); DDI_INTR_IMPLDBG((CE_CONT, "apic_check_msi_support:\n")); @@ -1696,7 +1697,8 @@ apic_check_msi_support() continue; if (strcmp(dev_type, "pciex") == 0) return (PSM_SUCCESS); - if (strcmp(dev_type, "pci") == 0 && get_hwenv() == HW_KVM) + if (strcmp(dev_type, "pci") == 0 && + (hwenv == HW_KVM || hwenv == HW_BHYVE)) return (PSM_SUCCESS); } diff --git a/usr/src/uts/i86pc/os/cpuid.c b/usr/src/uts/i86pc/os/cpuid.c index 4ab084749b..1e5d470e0d 100644 --- a/usr/src/uts/i86pc/os/cpuid.c +++ b/usr/src/uts/i86pc/os/cpuid.c @@ -718,6 +718,10 @@ determine_platform(void) platform_type = HW_KVM; return; } + if (strcmp(hvstr, HVSIG_BHYVE) == 0) { + platform_type = HW_BHYVE; + return; + } if (strcmp(hvstr, HVSIG_MICROSOFT) == 0) platform_type = HW_MICROSOFT; } else { diff --git a/usr/src/uts/intel/sys/x86_archext.h b/usr/src/uts/intel/sys/x86_archext.h index b863a8e592..69669bd2b4 100644 --- a/usr/src/uts/intel/sys/x86_archext.h +++ b/usr/src/uts/intel/sys/x86_archext.h @@ -947,6 +947,7 @@ extern void reset_gdtr_limit(void); #define HVSIG_VMWARE "VMwareVMware" #define HVSIG_KVM "KVMKVMKVM" #define HVSIG_MICROSOFT "Microsoft Hv" +#define HVSIG_BHYVE "bhyve bhyve " /* * Defined hardware environments @@ -958,8 +959,10 @@ extern void reset_gdtr_limit(void); #define HW_VMWARE (1 << 3) /* Running on VMware hypervisor */ #define HW_KVM (1 << 4) /* Running on KVM hypervisor */ #define HW_MICROSOFT (1 << 5) /* Running on Microsoft hypervisor */ +#define HW_BHYVE (1 << 6) /* Running on bhyve hypervisor */ -#define HW_VIRTUAL (HW_XEN_HVM | HW_VMWARE | HW_KVM | HW_MICROSOFT) +#define HW_VIRTUAL (HW_XEN_HVM | HW_VMWARE | HW_KVM | HW_MICROSOFT | \ + HW_BHYVE) #endif /* _KERNEL */ |