freebsd-src/sys/x86
Roger Pau Monné 6744fd8e75 x86/cpu: improve hypervisor detection
Some hypervisors can expose multiple signatures, for example Xen will expose
both the Xen and the HyperV signatures if Viridian extensions are enabled for
the guest.  Presence of multiple signatures is currently not handled by
FreeBSD, that will exit once a known signature is found in cpuid output.

Exposing the HyperV signature on hypervisors different than HyperV is not
uncommon, this is done so that such hypervisor can expose a (subset) of the
Viridian extensions to Windows guests for performance reasons.  Likely for
compatibility purposes the HyperV signature is always exposed on the first
leaf, and the Xen signature is exposed in the secondary leaf.

Fix the specific case of HyperV by not exiting from the scan if the HyperV
signature is found, and prefer a second signature if one is found.

Note that long term we might wish to convert vm_guest into a bitmap, so that it
can signal detection of multiple hypervisor interfaces.

Fixes: b0165dc453 ('x86/xen: fix HVM guest hypercall page setup')
PR: 276421
Sponsored by: Cloud Software Group
Reviewed by: markj kib
Differential revision: https://reviews.freebsd.org/D43508
2024-02-22 11:08:04 +01:00
..
acpica acpi/apm: Improve APM ioctl interface emulation 2024-01-10 17:05:00 -07:00
bios sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
conf sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
cpufreq sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
include x86/ucode: add const where appropriate 2024-02-13 08:18:06 -08:00
iommu DMAR: add knob to disable RMRR entries installation into domains 2023-12-26 03:28:22 +02:00
isa atrtc: Add a required include 2023-12-28 15:17:32 -05:00
linux linux(4): Remove sys/cdefs.h inclusion under x86/linux due to 685dc743 2023-08-18 15:58:32 +03:00
pci x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources 2024-01-23 09:35:47 -08:00
x86 x86/cpu: improve hypervisor detection 2024-02-22 11:08:04 +01:00
xen x86/xen: introduce non-hypercall based emergency print 2024-02-22 11:08:03 +01:00