On 07.02.2024 16:34, Roger Pau Monne wrote:
> IVMD and RMRR ranges are functionally equivalent, and as so could use the same
> validity checker.
> 
> Move the IVMD to x86 common IOMMU code and adjust the function to take a pair
> of [start, end] mfn parameters.
> 
> So far only the AMD-Vi side is adjusted to use the newly introduced helper, 
> the
> VT-d side will be adjusted in a further change.
> 
> No functional change intended.
> 
> Signed-off-by: Roger Pau Monné <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>
with one minor remark:

> --- a/xen/drivers/passthrough/x86/iommu.c
> +++ b/xen/drivers/passthrough/x86/iommu.c
> @@ -792,6 +792,52 @@ static int __init cf_check adjust_irq_affinities(void)
>  }
>  __initcall(adjust_irq_affinities);
>  
> +bool __init iommu_unity_region_ok(const char *prefix, mfn_t start, mfn_t end)
> +{
> +    mfn_t addr;
> +
> +    if ( e820_all_mapped(mfn_to_maddr(start), mfn_to_maddr(end) + PAGE_SIZE,
> +                         E820_RESERVED) )
> +        return true;
> +
> +    printk(XENLOG_WARNING "%s: [%#" PRI_mfn " ,%#" PRI_mfn
> +           "] is not (entirely) in reserved memory\n",

Would you mind if I re-flowed this to

    printk(XENLOG_WARNING
           "%s: [%#" PRI_mfn " ,%#" PRI_mfn "] is not (entirely) in reserved 
memory\n",

while committing?

Jan

Reply via email to