Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
Hi Andrew, + +void *_xvrealloc(void *va, size_t size, unsigned int align) +{ +return _xrealloc(va, size, align); +} + +#endif >>> Does this really compile with the wrappers not being static inline ? >>> >>> That aside, could we not do this using conditional

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
>> >> Sure, I’ll wrap what can’t be used in MPU case with HAS_VMAP, I would like >> to keep out: >> >> void *vmap_contig(mfn_t mfn, unsigned int nr); >> >> void vunmap(const void *va); >> >> void __iomem *ioremap(paddr_t pa, size_t len); >> >> static inline void iounmap(void __iomem *va) >>

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Jan Beulich
On 15.11.2024 13:46, Luca Fancellu wrote: > > >> On 15 Nov 2024, at 11:12, Jan Beulich wrote: >> >> On 15.11.2024 11:50, Luca Fancellu wrote: >>> --- a/xen/common/vmap.c >>> +++ b/xen/common/vmap.c >>> @@ -426,3 +426,10 @@ void *_xvrealloc(void *va, size_t size, unsigned int >>> align) >>> >>>

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 11:12, Jan Beulich wrote: > > On 15.11.2024 11:50, Luca Fancellu wrote: >> --- a/xen/common/vmap.c >> +++ b/xen/common/vmap.c >> @@ -426,3 +426,10 @@ void *_xvrealloc(void *va, size_t size, unsigned int >> align) >> >> return ptr; >> } >> + >> +void iounmap(void __iom

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Andrew Cooper
On 15/11/2024 12:15 pm, Luca Fancellu wrote: > >> On 15 Nov 2024, at 12:00, Andrew Cooper wrote: >> >> On 15/11/2024 10:50 am, Luca Fancellu wrote: >>> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h >>> index 440d85a284bb..802be6687085 100644 >>> --- a/xen/include/xen/xvmallo

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 12:00, Andrew Cooper wrote: > > On 15/11/2024 10:50 am, Luca Fancellu wrote: >> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h >> index 440d85a284bb..802be6687085 100644 >> --- a/xen/include/xen/xvmalloc.h >> +++ b/xen/include/xen/xvmalloc.h >> @@ -40,

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Luca Fancellu
> On 15 Nov 2024, at 12:00, Andrew Cooper wrote: > > On 15/11/2024 10:50 am, Luca Fancellu wrote: >> diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h >> index 440d85a284bb..802be6687085 100644 >> --- a/xen/include/xen/xvmalloc.h >> +++ b/xen/include/xen/xvmalloc.h >> @@ -40,

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Andrew Cooper
On 15/11/2024 10:50 am, Luca Fancellu wrote: > diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h > index 440d85a284bb..802be6687085 100644 > --- a/xen/include/xen/xvmalloc.h > +++ b/xen/include/xen/xvmalloc.h > @@ -40,20 +40,46 @@ > ((typeof(ptr))_xvrealloc(ptr, offsetof(typ

Re: [PATCH 1/5] common/vmap: Fall back to simple allocator when !HAS_VMAP

2024-11-15 Thread Jan Beulich
On 15.11.2024 11:50, Luca Fancellu wrote: > --- a/xen/common/vmap.c > +++ b/xen/common/vmap.c > @@ -426,3 +426,10 @@ void *_xvrealloc(void *va, size_t size, unsigned int > align) > > return ptr; > } > + > +void iounmap(void __iomem *va) > +{ > +unsigned long addr = (unsigned long)(void