From owner-freebsd-current@freebsd.org Thu Apr 20 02:29:37 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F33C8D47717 for ; Thu, 20 Apr 2017 02:29:37 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on0128.outbound.protection.outlook.com [104.47.126.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F698683; Thu, 20 Apr 2017 02:29:36 +0000 (UTC) (envelope-from decui@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mn/lcoOVg3jCV6YNoO3yojo0L+9+VYwo/1gGFvsYlho=; b=XCZVBwEZWMs1BqMOIr9LcGy5n7E5U/E3JO83R41HeCCYcHJ5gIjJCswgwto1ibRHIp8IWwmFjaKsP2PHDrcqHr6KDhgbtX57761TC4pYEtV52AtxMt0iUW50UH9rHqXtgUCMXHjyls+9SdGVsi9EH25Uo3yf318h+8HMdrEdE9c= Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM (10.170.151.145) by HK2P15301MB0002.APCP153.PROD.OUTLOOK.COM (10.170.151.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.1; Thu, 20 Apr 2017 02:29:31 +0000 Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) by HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) with mapi id 15.01.1061.003; Thu, 20 Apr 2017 02:29:31 +0000 From: Dexuan Cui To: John Baldwin , "freebsd-current@freebsd.org" CC: Jung-uk Kim , Yanmin Qiao Subject: RE: Add support for ACPI Module Device ACPI0004? Thread-Topic: Add support for ACPI Module Device ACPI0004? Thread-Index: AdK5Bn25Dro7P4OHStiOHYshQNXMIQANQ5GAAA/UMpA= Date: Thu, 20 Apr 2017 02:29:30 +0000 Message-ID: References: <3484633.CMRgrtiqef@ralph.baldwin.cx> In-Reply-To: <3484633.CMRgrtiqef@ralph.baldwin.cx> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [112.64.217.125] x-microsoft-exchange-diagnostics: 1; HK2P15301MB0002; 7:2ep5t7suaelCX0TNIcSHqfbfSDP+sfAqShhyaqUFf77hVgIRBTf8+0CxZiQJanrLWzL2c/aKFG7doFs/lBY2Hg/P8PdSmjFxtX03Bsbd1BFaZiLKpwfCdhkTQXNbcGjLzvSQ+e+mc22eMTBRhxniKGialon7u3fNdJ8kfpLYP77l/ziqYiiawz5uoD3cQIAwvuHs8AJgpTld6kPTfdg8wT0ks4xbeV3cbfih0MBWkJUl8NqyvsBMQ9yhKVVdO6/c5zE3QJB142v5+8DlJ6uu2rn3/WVJ/UQ3bDahBCE1SEIygtUAelsTJy3Gv0qyGTBq9uCncv3wXI4u0LIR8h/1VdGHJBnKiHosxKz4YzDtLFM= x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-ms-office365-filtering-correlation-id: bc64b527-8839-4276-31f0-08d487951380 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:HK2P15301MB0002; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415395)(61425038)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:HK2P15301MB0002; BCL:0; PCL:0; RULEID:; SRVR:HK2P15301MB0002; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39410400002)(39400400002)(39450400003)(39860400002)(39850400002)(51914003)(3846002)(2501003)(102836003)(575784001)(38730400002)(33656002)(7736002)(99936001)(86612001)(55016002)(86362001)(189998001)(10090500001)(5890100001)(74316002)(305945005)(54906002)(50986999)(54356999)(76176999)(122556002)(53936002)(6246003)(7696004)(107886003)(9686003)(5660300001)(3660700001)(3280700002)(2906002)(2950100002)(4326008)(81166006)(8676002)(66066001)(77096006)(6436002)(25786009)(2900100001)(10290500002)(6506006)(5005710100001)(450100002)(8990500004)(8936002); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2P15301MB0002; H:HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2017 02:29:30.7463 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2P15301MB0002 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 20 Apr 2017 02:29:38 -0000 > From: John Baldwin [mailto:jhb@freebsd.org] > Sent: Thursday, April 20, 2017 02:34 > > Can we add the support of "ACPI0004" with the below one-line change? > > > > acpi_sysres_probe(device_t dev) > > { > > - static char *sysres_ids[] =3D { "PNP0C01", "PNP0C02", NULL }; > > + static char *sysres_ids[] =3D { "PNP0C01", "PNP0C02", "ACPI0004", = NULL }; > > > Hmm, so the role of C01 and C02 is to reserve system resources, though we > in turn allow any child of acpi0 to suballocate those ranges (since histo= rically > c01 and c02 tend to allocate I/O ranges that are then used by things like= the > EC, PS/2 keyboard controller, etc.). From my reading of ACPI0004 in the = ACPI > 6.1 spec it's not quite clear that ACPI0004 is like that? In particular,= it > seems that 004 should only allow direct children to suballocate? This > change might work, but it will allow more devices to allocate the ranges = in > _CRS than otherwise. >=20 > Do you have an acpidump from a guest system that contains an ACPI0004 > node that you can share? >=20 > John Baldwin Hi John, Thanks for the help! Please see the attached file, which is got by "acpidump -dt | gzip -c9 > acpidump.dt.gz" In the dump, we can see the "ACPI0004" node (VMOD) is the parent of "VMBus" (VMBS).=20 It looks the _CRS of ACPI0004 is dynamically generated. Though we can't see the length of the MMIO range in the dumped asl code, it does have a 512MB MMIO range [0xFE0000000, 0xFFFFFFFFF]. It looks FreeBSD can't detect ACPI0004 automatically. With the above one-line change, I can first find the child device=20 acpi_sysresource0 of acpi0, then call AcpiWalkResources() to get the _CRS of acpi_sysresource0, i.e. the 512MB MMIO range. If you think we shouldn't touch acpi_sysresource0 here, I guess we can add a new small driver for ACPI0004, just like we added VMBus driver as a child device of acpi0? -- Dexuan