On 15.03.2024 19:06, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/include/asm/mm.h > +++ b/xen/arch/riscv/include/asm/mm.h > @@ -3,11 +3,246 @@ > #ifndef _ASM_RISCV_MM_H > #define _ASM_RISCV_MM_H > > +#include <public/xen.h> > +#include <xen/bug.h> > +#include <xen/mm-frame.h> > +#include <xen/pdx.h> > +#include <xen/types.h> > + > #include <asm/page-bits.h> > > #define pfn_to_paddr(pfn) ((paddr_t)(pfn) << PAGE_SHIFT) > #define paddr_to_pfn(pa) ((unsigned long)((pa) >> PAGE_SHIFT)) > > +#define paddr_to_pdx(pa) mfn_to_pdx(maddr_to_mfn(pa)) > +#define gfn_to_gaddr(gfn) pfn_to_paddr(gfn_x(gfn)) > +#define gaddr_to_gfn(ga) _gfn(paddr_to_pfn(ga)) > +#define mfn_to_maddr(mfn) pfn_to_paddr(mfn_x(mfn)) > +#define maddr_to_mfn(ma) _mfn(paddr_to_pfn(ma)) > +#define vmap_to_mfn(va) maddr_to_mfn(virt_to_maddr((vaddr_t)(va))) > +#define vmap_to_page(va) mfn_to_page(vmap_to_mfn(va)) > + > +static inline void *maddr_to_virt(unsigned long ma)
paddr_t as parameter type? > +{ > + BUG_ON("unimplemented"); > + return NULL; > +} >[...] > +#define PFN_ORDER(pfn) ((pfn)->v.free.order) Would be nice if RISC-V wouldn't repeat the parameter mis-naming: Any of p, pg, or page would be more suitable here. With the adjustments: Acked-by: Jan Beulich <jbeul...@suse.com> Jan