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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 31 Jan 2022 10:57:21 +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=FMwOYletfg1emNdwRApZqU68CzXOXzlVvuXR8NTHqBQ=; b=Pn3LvlT66Rq/xvbn09TysfMY4kyspQEOpsjAmPHFckt9yKx/XERYjfbMhQ40pTVVJxEvdK+Czd60yU+w7yv6d8lVc9KBNG6iG4cbc7rISJcjZUrHP7UbUnDHRck0WN8WBPFAf5SPUnp7chfG0iKgG19nOH0Z8Qk7iaXZ3HO1YfoJCLyqxNl/HBb7v4RNVfpas4uI3AeDRd5cxQhY0w+Bn+SjgjvXPRTIEmrEAy0r0lhpqAm4u/2MdEs0gE4snS2VS7jVELaLh0UqvUMBGFz1hQ/IXhxn0JaJO7grUaaKJLoM6dpPzAdKv+CXgCyp+7LuM5GW7e1ejO5xoIUXufnZhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+YD7f+Kfl6xxAl6sqD9oi2SNPU/4ek0CJ/hdrVve/Z3ue59sY03PvCAKZ0w8KkCobJNSbMwGweno9H566qL5RiCKnnNqeZYJW5loH0LW8+0TEjDd+FODioOxJsKOw7kXb4VwUJRTqC7/KDEcGg8ry/sO1rXgqbc59ibb7Vabj4K732/2B9cn1/MW/KbKdvHMzGuu7L8Q+NiX7UHN1TpM8OW7KeBqHeJsACJmkiRVnPjTSS4CIhzJWN2TxqJ9gfp5pH41Qltp11BQXBK4Jl8j4uJmUhn17r8B4Ycy+0bJK3+iaW9S2vECxUclOso79NGk4ScJ+46iuGKircRadYGjg==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.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: Mon, 31 Jan 2022 09:57:41 +0000
  • Ironport-data: A9a23:NzBHs6MpA+5pMq3vrR3vkcFynXyQoLVcMsEvi/4bfWQNrUokgTQCy 2YWWDjQb/jeM2vwLd9/PY7kpB4H75HdndNgGwto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdpJYz/uUGuCJQUNUjMlkfZKhTr6UUsxNbVU8En150Ek6w7dRbrNA2rBVPSvc4 bsenOWHULOV82Yc3rU8sv/rRLtH5ZweiRtA1rAMTakjUGz2zhH5OKk3N6CpR0YUd6EPdgKMq 0Qv+5nilo/R109F5tpICd8XeGVSKlLZFVDmZna7x8FOK/WNz8A/+v9TCRYSVatYo3LVkNkr0 OUQj6aPcSN5PJOTu94NWQYNRkmSPYUekFPGCX22sMjVxEzaaXr8hf5pCSnaP6VBpLwxWzsXs 6VFdnZdNXhvhMrvqF6/YvNrick5atHiIasUu216zCGfBvEjKXzGa/uRvYUGg2Zs7ixINebUT ZI4dAAoVh7BQhFeNF5UBcwO3/j90xETdBUH8QnI9MLb+VP70whZwLXrdt3PdbSiT8hPglyRo G6A+m3jGwwbL/SW0z/D+XWp7sffkCW+VI8MGbmQ8v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50wakA5cfwyEyojfm/s6/BxN6jBmHA1awyJO3/93J mU2ZVZ+Ir+D/mswicVON4x299qt2PFNFpTN9mY0
  • Ironport-hdrordr: A9a23:t5XWmK4D8ViiOkCq7wPXwMzXdLJyesId70hD6qkXc20zTiX4rb HLoB1/73TJYVkqNE3I9eruBEDiexPhHPxOj7X5VI3KNGOKhILCFuBfxLqn7zr8GzDvss5xvJ 0QFpSW0eeAbmSSW/yKgjWFLw==
  • Ironport-sdr: l5s4xwbYLz6a/CEmXVpGDugQuaaovlE3joxvHrCvs3Qt+9kNLthzCSBWkDnvZdIYwwWwmpd9YV Up2teUFm0nwW1ee/cfx8taNZBBFamWW+3pH5566Q650vmmpa5DV8+Qt5LrvKUERwkHvHs6IseC kbJo9+ZKndIaNAZTvw+2+b3anslG6oz0KmeT0N0qNlcg2G5JFpOTn2AqiPwTYvHdylDeCMQjdL Nb40G3G06z/Nojexw9Qi3/hHdZx6XN480jy+y6Se/Huh0qPhYgZoU8+4wTS8GZf2hzgYVz8cO4 RfLA680qUZIA118sldPiGwwp
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jan 28, 2022 at 07:48:44AM +0100, Jan Beulich wrote:
> 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).

Yes, indeed, would likely be better. Then I can make both parameters
unsigned long.

I also think is_memory_hole would be a suitable name given the new
implementation?

Thanks, Roger.



 


Rackspace

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