Re: [PATCH 3/3] x86/iommu: use a rangeset for hwdom setup

2023-11-20 Thread Roger Pau Monné
On Mon, Nov 20, 2023 at 11:30:16AM +0100, Jan Beulich wrote: > On 17.11.2023 10:47, Roger Pau Monne wrote: > > --- a/xen/arch/x86/hvm/io.c > > +++ b/xen/arch/x86/hvm/io.c > > @@ -364,9 +364,20 @@ static const struct hvm_mmcfg *vpci_mmcfg_find(const > > struct domain *d, > > return NULL; > >

Re: [PATCH 3/3] x86/iommu: use a rangeset for hwdom setup

2023-11-20 Thread Jan Beulich
On 17.11.2023 10:47, Roger Pau Monne wrote: > --- a/xen/arch/x86/hvm/io.c > +++ b/xen/arch/x86/hvm/io.c > @@ -364,9 +364,20 @@ static const struct hvm_mmcfg *vpci_mmcfg_find(const > struct domain *d, > return NULL; > } > > -bool vpci_is_mmcfg_address(const struct domain *d, paddr_t addr) >

Re: [PATCH 3/3] x86/iommu: use a rangeset for hwdom setup

2023-11-17 Thread Andrew Cooper
On 17/11/2023 9:47 am, Roger Pau Monne wrote: > The current loop that iterates from 0 to the maximum RAM address in order to > setup the IOMMU mappings is highly inefficient, and it will get worse as the > amount of RAM increases. It's also not accounting for any reserved regions > past the last R

Re: [PATCH 3/3] x86/iommu: use a rangeset for hwdom setup

2023-11-17 Thread Roger Pau Monné
On Fri, Nov 17, 2023 at 10:47:49AM +0100, Roger Pau Monne wrote: > The current loop that iterates from 0 to the maximum RAM address in order to > setup the IOMMU mappings is highly inefficient, and it will get worse as the > amount of RAM increases. It's also not accounting for any reserved region

[PATCH 3/3] x86/iommu: use a rangeset for hwdom setup

2023-11-17 Thread Roger Pau Monne
The current loop that iterates from 0 to the maximum RAM address in order to setup the IOMMU mappings is highly inefficient, and it will get worse as the amount of RAM increases. It's also not accounting for any reserved regions past the last RAM address. Instead of iterating over memory addresse