svn commit: r336472 - head/sys/dev/xen/pvcpu

Roger Pau Monné royger at FreeBSD.org
Thu Jul 19 08:00:53 UTC 2018


Author: royger
Date: Thu Jul 19 08:00:52 2018
New Revision: 336472
URL: https://svnweb.freebsd.org/changeset/base/336472

Log:
  xen: attach the PV CPU if no CPU device is present
  
  When booted as PVHv2, there's no ACPI CPU object, so attach the PV CPU
  device in order to take it's place.
  
  This is required in case some device or driver tries to poke at the
  PCPU device field.
  
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/pvcpu/pvcpu.c

Modified: head/sys/dev/xen/pvcpu/pvcpu.c
==============================================================================
--- head/sys/dev/xen/pvcpu/pvcpu.c	Thu Jul 19 07:58:24 2018	(r336471)
+++ head/sys/dev/xen/pvcpu/pvcpu.c	Thu Jul 19 08:00:52 2018	(r336472)
@@ -49,8 +49,8 @@ xenpvcpu_identify(driver_t *driver, device_t parent)
 {
 	int i;
 
-	/* Only attach to PV guests, HVM guests use the ACPI CPU devices */
-	if (!xen_pv_domain())
+	/* Only attach in case the per-CPU device is not set. */
+	if (!xen_domain() || PCPU_GET(device) != NULL)
 		return;
 
 	CPU_FOREACH(i) {


More information about the svn-src-head mailing list