From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mx.groups.io with SMTP id smtpd.web11.8341.1608213152784243476 for ; Thu, 17 Dec 2020 05:52:33 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.191, mailfrom: cenjiahui@huawei.com) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CxYM92xp7zhtTr; Thu, 17 Dec 2020 21:51:49 +0800 (CST) Received: from [10.174.184.155] (10.174.184.155) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Thu, 17 Dec 2020 21:52:17 +0800 Subject: Re: [edk2-devel] [PATCH v2 0/4] Add extra pci roots support for Arm To: , , "Ni, Ray" CC: "Justen, Jordan L" , "ard.biesheuvel@arm.com" , "leif@nuviainc.com" , "xieyingtai@huawei.com" , "miaoyubo@huawei.com" , "xuxiaoyang2@huawei.com" , Alex Williamson References: <20201109130511.5946-1-cenjiahui@huawei.com> <5d2daf54-a57b-c4bd-a757-cf6b710cd4e5@huawei.com> From: "Jiahui Cen" Message-ID: Date: Thu, 17 Dec 2020 21:52:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit On 2020/12/17 21:23, Laszlo Ersek wrote: > On 12/15/20 13:52, Jiahui Cen wrote: >> For x86, Linux does not handle the pci resource assignment. But for arm, it >> would assign all the pci resources, unless we explicitly let Linux preserve >> PCI resource alignment made by firmware, using "PCI Boot Configuration" >> _DSM function. > This difference between x86 and arm seems inexplicable to me. > >> What do you think of adding "PCI Boot Configuration" _DSM function into >> dsdt table to make kernel use firmware's resource configuration? > The relevant kernel commits seem to be: > > - 18e94a338436 ("PCI: Make a shareable UUID for PCI firmware ACPI _DSM", > 2015-04-08) > > - a78cf9657ba5 ("PCI/ACPI: Evaluate PCI Boot Configuration _DSM", > 2019-06-21) > > I've also read now section "4.6.5. _DSM for Ignoring PCI Boot > Configurations" in the "PCI(TM) Firmware Specification, > Revision 3.1, December 13, 2010". > > Basically if this _DSM#5 function exists, it tells the OS whether it is > required to honor the firmware-assigned resources (value 0), or if it is > free to reassign (value 1). If the function does not exist at all, then, > "the operating system may continue to use the legacy handling regarding > the boot configuration". > > Without knowing more, I consider it a bug that aarch64 Linux uses a > default strategy (in the absence of the _DSM#5 function) that is the > opposite of the x86 default. But, you seem to be right that there is a > specified way to convince arm64 Linux otherwise. Can you indeed add this > _DSM#5 function to the "virt" machine's ACPI generator, returning value > 0, and see if it makes a difference? OK, I've tested adding _DSM#5 function in QEMU, and it seems to work well for ARM "virt" machine. Thanks, Jiahui