|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 2/6] xen: add a p2mt parameter to map_mmio_regions
Hi, On 07/08/2019 01:23, Stefano Stabellini wrote: Add a p2mt parameter to map_mmio_regions, pass p2m_mmio_direct_dev on ARM and p2m_mmio_direct on x86 -- no changes in behavior. On x86, introduce a macro to strip away the last parameter and rename the existing implementation of map_mmio_regions to map_mmio_region. Use map_mmio_region in vpci as it is x86-only today. This feels quite wrong. You have a "plural" function calling a "singular" function. This is usually the other way around. This is also quite difficult for a user to understand why the 's' is been dropped/added (depending how you view it) because in both case you only deal with a single region. The confusion is added because there are no unmap_mmio_region so the code looks strange to read: > + rc = map->map ? map_mmio_region(map->d, _gfn(s), size, _mfn(s)) > : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(s));Anyway, I realized that Jan suggested it and it is x86 code. So if he is happy with it so it be. [...]
I think it is a pretty bad idea to have arch specific code in common code. This is only to make more difficult to add new arch (such as RISCv). Instead we should provide helper in arch code. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |