[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.17] x86/pci: allow BARs to be positioned on e820 reserved regions


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 5 Oct 2022 10:53:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H2Zetr1xY0K9Qb+N4KGnzbTM303y6IKMboQSifrvcUg=; b=XNYtymIAagca71BFQv7E7C2uaTlRlM2HfoL8ieCHSfT7RsTFimvDWTro4StRkU5Vdj7NVdf0Ko9bMRPmr7rY9gin6zRVIvIFSF6wwgLbb+U6pBkMQp3LlNqWJE1KZ2gVhSHxCTh9r0ywfMpeMldPILppvqHROcdx/XIp99M00KubtZa5KAzaF2BwiBRO6ZJmdsjw1fFSUTeUfcrbP6mivglxRfuHVq8TTdGjPC3F5kiKgRBkh1uAwAKpBsP7Pa08OPESPLIL/WBrTc5IWcAPRyrbeOfb38/sN88bQxOSij6ZWXk0dEtog/8bD+5446A0uceT+dcMD2o34bJAabluOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTb93ZhSWo2krb/PemS+aXGm8KmWpI6BJ8WxTWnhaeFNchcsQKU6L9nyRiZa+21JPMMWBKeRIa/SHK7F6UKNorSRwFtR+lKN7L7Ix/CMEbWwjeTEeNnbjLzjluW8HB5kzH6m76PjhxaIAr1+W62Z+6lX2SNRGqrgqeIIuugYl7sPhp/NgSucUTGzAO/rQlOYATfHLYMl0RuVlJameOKyCVFrxGgAsQEqUvTztWgQA4lhY9ngGDjx0zLXauPMb1exmOom7rS8TYKdBUfB+DDzfTL5uo4wkvEdGYZeU1DF2Alek2AzGgvv2n5UFR+PA3b4zlSb4SL4aVb1YH5LHucp/w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 05 Oct 2022 08:53:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.10.2022 10:37, Roger Pau Monné wrote:
> On Tue, Oct 04, 2022 at 06:11:50PM +0200, Jan Beulich wrote:
>> On 04.10.2022 17:36, Roger Pau Monne wrote:
>>> The EFI memory map contains two memory types (EfiMemoryMappedIO and
>>> EfiMemoryMappedIOPortSpace) used to describe IO memory areas used by
>>> EFI firmware.
>>>
>>> The current parsing of the EFI memory map is translating
>>> EfiMemoryMappedIO to E820_RESERVED on x86.  This causes issues on some
>>> boxes as the firmware is relying on using those regions to position
>>> the BARs of devices being used (possibly during runtime) for the
>>> firmware.
>>>
>>> Xen will disable memory decoding on any device that has BARs
>>> positioned over any regions on the e820 memory map, hence the firmware
>>> will malfunction after Xen turning off memory decoding for the
>>> device(s) that have BARs mapped in EfiMemoryMappedIO regions.
>>>
>>> The system under which this was observed has:
>>>
>>> EFI memory map:
>>> [...]
>>>  00000fd000000-00000fe7fffff type=11 attr=800000000000100d
>>> [...]
>>> 0000:00:1f.5 disabled: BAR [0xfe010, 0xfe010] overlaps with memory map
>>>
>>> The device behind this BAR is:
>>>
>>> 00:1f.5 Serial bus controller [0c80]: Intel Corporation Lewisburg SPI 
>>> Controller (rev 09)
>>>     Subsystem: Super Micro Computer Inc Device 091c
>>>     Flags: fast devsel
>>>     Memory at fe010000 (32-bit, non-prefetchable) [size=4K]well
>>>
>>> For the record, the symptom observed in that machine was a hard freeze
>>> when attempting to set an EFI variable (XEN_EFI_set_variable).
>>>
>>> Fix by allowing BARs of PCI devices to be positioned over reserved
>>> memory regions, but print a warning message about such overlap.
>>
>> Somewhat hesitantly I might ack this change, but I'd like to give
>> others (Andrew in particular) some time to voice their views. As
>> said during the earlier discussion - I think we're relaxing things
>> too much by going this route.
> 
> Another option would be to explicitly check in efi_memmap for
> EfiMemoryMappedIO regions and BAR overlap and only allow those.  That
> would be more cumbersome code wise AFAICT.

Indeed there's a question of balancing well here, between two outcomes
neither of which is really desirable.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.