[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 06/11] IOMMU: add common API for device reserved memory
On 13.08.2022 03:38, Marek Marczykowski-Górecki wrote: > --- a/xen/drivers/passthrough/iommu.c > +++ b/xen/drivers/passthrough/iommu.c > @@ -669,6 +669,51 @@ bool_t iommu_has_feature(struct domain *d, enum > iommu_feature feature) > return is_iommu_enabled(d) && test_bit(feature, dom_iommu(d)->features); > } > > +#define MAX_EXTRA_RESERVED_RANGES 20 > +struct extra_reserved_range { > + unsigned long start; > + unsigned long nr; > + pci_sbdf_t sbdf; > +}; > +static unsigned int __initdata nr_extra_reserved_ranges; > +static struct extra_reserved_range __initdata > + extra_reserved_ranges[MAX_EXTRA_RESERVED_RANGES]; > + > +int __init iommu_add_extra_reserved_device_memory(unsigned long start, > + unsigned long nr, > + pci_sbdf_t sbdf) Sadly indentation is now wrong here and ... > +{ > + unsigned int idx; > + > + if ( nr_extra_reserved_ranges >= MAX_EXTRA_RESERVED_RANGES ) > + return -ENOMEM; > + > + idx = nr_extra_reserved_ranges++; > + extra_reserved_ranges[idx].start = start; > + extra_reserved_ranges[idx].nr = nr; > + extra_reserved_ranges[idx].sbdf = sbdf; > + > + return 0; > +} > + > +int __init iommu_get_extra_reserved_device_memory(iommu_grdm_t *func, void > *ctxt) ... this line is now slightly too long. Personally I would prefer to shorten the names, e.g. by using "rdm" rather than "reserved_device_memory". But I wouldn't mind names to be kept, just as long as style constraints are met. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |