From owner-freebsd-current@FreeBSD.ORG Tue Dec 24 11:25:36 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80559540; Tue, 24 Dec 2013 11:25:36 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0A6816F3; Tue, 24 Dec 2013 11:25:34 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.95,542,1384300800"; d="scan'208";a="87482328" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 24 Dec 2013 11:25:32 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Tue, 24 Dec 2013 06:25:31 -0500 Received: from gateway-cbg.eng.citrite.net ([10.80.16.17] helo=localhost.localdomain) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1VvQ4F-0007qS-MK; Tue, 24 Dec 2013 11:22:31 +0000 From: Roger Pau Monne To: , , , , , , Subject: [PATCH RFC 10/13] xen: add ACPI bus to xen_nexus when running as Dom0 Date: Tue, 24 Dec 2013 12:20:59 +0100 Message-ID: <1387884062-41154-11-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.7.7.5 (Apple Git-26) In-Reply-To: <1387884062-41154-1-git-send-email-roger.pau@citrix.com> References: <1387884062-41154-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA2 Cc: Roger Pau Monne X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 11:25:36 -0000 Also disable a couple of ACPI devices that are not usable under Dom0. --- sys/x86/xen/xen_nexus.c | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/x86/xen/xen_nexus.c b/sys/x86/xen/xen_nexus.c index 288e6b6..823b3bc 100644 --- a/sys/x86/xen/xen_nexus.c +++ b/sys/x86/xen/xen_nexus.c @@ -35,6 +35,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include + #include #include @@ -44,7 +48,6 @@ static const char *xen_devices[] = "xenstore", /* XenStore bus */ "xen_et", /* Xen PV timer (provides: tc, et, clk) */ "xc", /* Xen PV console */ - "isa", /* Dummy ISA bus for sc to attach */ }; /* @@ -56,13 +59,14 @@ nexus_xen_probe(device_t dev) if (!xen_pv_domain()) return (ENXIO); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_SPECIFIC); } static int nexus_xen_attach(device_t dev) { int i, error = 0; + device_t acpi_dev; nexus_init_resources(); bus_generic_probe(dev); @@ -79,8 +83,22 @@ nexus_xen_attach(device_t dev) if (BUS_ADD_CHILD(dev, 0, xen_devices[i], 0) == NULL) panic("%s: could not add", xen_devices[i]); } + if (xen_initial_domain()) { + /* Disable some ACPI devices that are not usable by Dom0 */ + setenv("debug.acpi.disabled", "cpu hpet timer"); + + acpi_dev = BUS_ADD_CHILD(dev, 10, "acpi", 0); + if (acpi_dev == NULL) + panic("Unable to add ACPI bus to Xen Dom0"); + } else { + /* Dummy ISA bus for sc to attach */ + if (BUS_ADD_CHILD(dev, 0, "isa", 0) == NULL) + panic("isa: could not add"); + } - bus_generic_attach(dev); + error = bus_generic_attach(dev); + if (xen_initial_domain() && (error == 0)) + acpi_install_wakeup_handler(device_get_softc(acpi_dev)); return (error); } -- 1.7.7.5 (Apple Git-26)