On Mon, 26 May 2025 13:17:35 +0200 Janosch Frank <frankja@xxxxxxxxxxxxx> wrote: > On 5/20/25 8:26 PM, Claudio Imbrenda wrote: > > Refactor some gmap functions; move the implementation into a separate > > file with only helper functions. The new helper functions work on vm > > addresses, leaving all gmap logic in the gmap functions, which mostly > > become just wrappers. > > > > The whole gmap handling is going to be moved inside KVM soon, but the > > helper functions need to touch core mm functions, and thus need to > > stay in the core of kernel. > > > > Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx> > > --- > > MAINTAINERS | 2 + > > arch/s390/include/asm/gmap_helpers.h | 18 ++ > > arch/s390/kvm/diag.c | 11 +- > > arch/s390/kvm/kvm-s390.c | 5 +- > > arch/s390/mm/Makefile | 2 + > > arch/s390/mm/gmap.c | 46 ++--- > > arch/s390/mm/gmap_helpers.c | 259 +++++++++++++++++++++++++++ > > 7 files changed, 302 insertions(+), 41 deletions(-) > > create mode 100644 arch/s390/include/asm/gmap_helpers.h > > create mode 100644 arch/s390/mm/gmap_helpers.c > > [...] > > > diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile > > index 9726b91fe7e4..bd0401cc7ca5 100644 > > --- a/arch/s390/mm/Makefile > > +++ b/arch/s390/mm/Makefile > > @@ -12,3 +12,5 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o > > obj-$(CONFIG_PTDUMP) += dump_pagetables.o > > obj-$(CONFIG_PGSTE) += gmap.o > > obj-$(CONFIG_PFAULT) += pfault.o > > + > > +obj-$(subst m,y,$(CONFIG_KVM)) += gmap_helpers.o > > So gmap.o depends on PGSTE but gmap_helpers.o depends on KVM. > Yes, PGSTE is Y if KVM is set, but this looks really strange. yes, CONFIG_PGSTE will go away in the final series No point in using CONFIG_PGSTE here knowing it will go away soon anyway > > > @Heiko: > Can we move away from CONFIG_PGSTE and start using CONFIG_KVM instead? > Well, maybe this goes away with Claudio's rework anyway.