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

Re: [PATCH RFC] xen/pci: detect when BARs overlap RAM


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 28 Jan 2022 07:48:44 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=5HDj+QDjhBelpbStj8jZgdzE9FCzwzbGpviKNmsqLmE=; b=AA+974KmMuv3M5seXDkWPd0cRgAeBlmHKbawKNO3OWKFFONRk6lYSQs46TcnbVbCuseZpzDXv7I/bNz8TalXU2zqU8hUw7AdaAyqdI8ScHvzZKWek7DB6LubHEJPNl6fWcBXaNgzuq1w38Paeda4TluWqTeJBoIMwEsRWrj3d3J8NmZgEGdGHrLA1xYuQxTx1q92BMKsZJEz0EJmJnq4HjrcmB/X5Z669LH8Icqe29eQ5RFgcZn8luC6UEKPpnmZ7dwccQkTMy324LdWlyto8eMuTcvjNU3TUKi6VYYm9FZz1hs032+73ocAFRYxVv207BBPvbdy6XohM1kQ6mrJ5g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvY81XqC6TDPEc2PxaKiifuBAiY3hb10gIz50bNk5XriRpfaEjsqxBTySX/KFzc/zAbXwjXTQ6FsHiKBEAqbnDx4cvDlcJK4M6DkTdf+OMIQMqgjWE7Z5ogdZgePVD90GxZ8mj/PhzdiT1UH2q+skTGhyID48rGiTg7T9+uGKrf3KAt53JhHCw/+NCsUc/ZY18LQQMZr8QF9oRJCdL4JtDdMkchr4/q2VKaar0lWbylUeOS0PYGlGtwvZyy8M+rkEksd0EM6e2MQRwPQO+5Uto5iv3PsjRR72yvPVpH0YbNFzsfTth/eK7iObuqAkcKw1gkb+aGLxf3hnRJ8ZoXUeg==
  • 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>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 28 Jan 2022 06:49:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.01.2022 16:45, Roger Pau Monné wrote:
> On Wed, Jan 26, 2022 at 03:08:28PM +0100, Jan Beulich wrote:
>> On 26.01.2022 13:26, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/mm.c
>>> +++ b/xen/arch/x86/mm.c
>>> @@ -479,6 +479,26 @@ unsigned int page_get_ram_type(mfn_t mfn)
>>>      return type ?: RAM_TYPE_UNKNOWN;
>>>  }
>>>  
>>> +bool is_iomem_range(uint64_t start, uint64_t size)
>>
>> Might be nice to have this sit next it is_iomem_page(). And wouldn't
>> at least "start" better be paddr_t?
> 
> (paddr_t, size_t) would be better, but AFAICT size_t can be an
> unsigned long and on Arm32 that won't be suitable for holding a 64bit
> BAR size.

Talking of representing the range - a BAR occupying one part of a
page overlapping an E820 entry covering another part of that same
page is going to be equally bad, I think. The range may therefore
want expressing in page granularity. This may then be easier as
[start,end], at least on the calling side (can use PFN_DOWN()
twice then).

Jan




 


Rackspace

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