Re: [PATCH 3/4] xen: Drop CONFIG_XEN_AUTO_XLATE

Stefano Stabellini <[email protected]>
Newsgroups gmane.comp.emulators.xen.devel,gmane.linux.kernel
Message-ID <[email protected]>
On Wed, 5 Aug 2026, Juergen Gross wrote:
> CONFIG_XEN_AUTO_XLATE is referenced only in code built with CONFIG_XEN
> enabled. As it is enabled for all architectures supporting Xen, it can
> be just dropped.
> 
> Signed-off-by: Juergen Gross <[email protected]>

Reviewed-by: Stefano Stabellini <[email protected]>

> ---
>  drivers/xen/Kconfig   |  6 ------
>  drivers/xen/Makefile  |  2 +-
>  drivers/xen/privcmd.c |  4 ++--
>  include/xen/xen-ops.h | 22 ----------------------
>  4 files changed, 3 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index cfb517cd77dc..32e35a8580ee 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -309,12 +309,6 @@ config XEN_EFI
>  	def_bool y
>  	depends on (ARM || ARM64 || X86_64) && EFI
>  
> -config XEN_AUTO_XLATE
> -	def_bool y
> -	depends on ARM || ARM64 || X86
> -	help
> -	  Support for auto-translated physmap guests.
> -
>  config XEN_ACPI
>  	def_bool y
>  	depends on X86 && ACPI
> diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile
> index c0503f1c7d5b..6ce2e2a52d47 100644
> --- a/drivers/xen/Makefile
> +++ b/drivers/xen/Makefile
> @@ -2,6 +2,7 @@
>  obj-$(CONFIG_HOTPLUG_CPU)		+= cpu_hotplug.o
>  obj-y	+= grant-table.o features.o balloon.o manage.o time.o
>  obj-y	+= mem-reservation.o
> +obj-y	+= xlate_mmu.o
>  obj-y	+= events/
>  obj-y	+= xenbus/
>  
> @@ -29,7 +30,6 @@ obj-$(CONFIG_XEN_PRIVCMD)		+= xen-privcmd.o
>  obj-$(CONFIG_XEN_ACPI_PROCESSOR)	+= xen-acpi-processor.o
>  obj-$(CONFIG_XEN_EFI)			+= efi.o
>  obj-$(CONFIG_XEN_SCSI_BACKEND)		+= xen-scsiback.o
> -obj-$(CONFIG_XEN_AUTO_XLATE)		+= xlate_mmu.o
>  obj-$(CONFIG_XEN_PVCALLS_BACKEND)	+= pvcalls-back.o
>  obj-$(CONFIG_XEN_PVCALLS_FRONTEND)	+= pvcalls-front.o
>  xen-evtchn-y				:= evtchn.o
> diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
> index 725a49a0eee7..7cfc28f1bb86 100644
> --- a/drivers/xen/privcmd.c
> +++ b/drivers/xen/privcmd.c
> @@ -794,7 +794,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
>  		goto out;
>  	}
>  
> -	if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) && !xen_pv_domain()) {
> +	if (!xen_pv_domain()) {
>  		unsigned int nr = DIV_ROUND_UP(kdata.num, XEN_PFN_PER_PAGE);
>  		struct page **pages;
>  		unsigned int i;
> @@ -825,7 +825,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
>  	if (rc)
>  		goto out;
>  
> -	if (IS_ENABLED(CONFIG_XEN_AUTO_XLATE) && !xen_pv_domain()) {
> +	if (!xen_pv_domain()) {
>  		rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT);
>  	} else {
>  		unsigned int domid =
> diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
> index 496e6013c689..15e0c3f4b7bb 100644
> --- a/include/xen/xen-ops.h
> +++ b/include/xen/xen-ops.h
> @@ -59,7 +59,6 @@ static inline int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
>  
>  struct vm_area_struct;
>  
> -#ifdef CONFIG_XEN_AUTO_XLATE
>  int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
>  			      unsigned long addr,
>  			      xen_pfn_t *gfn, int nr,
> @@ -68,27 +67,6 @@ int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
>  			      struct page **pages);
>  int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
>  			      int nr, struct page **pages);
> -#else
> -/*
> - * These two functions are called from arch/x86/xen/mmu.c and so stubs
> - * are needed for a configuration not specifying CONFIG_XEN_AUTO_XLATE.
> - */
> -static inline int xen_xlate_remap_gfn_array(struct vm_area_struct *vma,
> -					    unsigned long addr,
> -					    xen_pfn_t *gfn, int nr,
> -					    int *err_ptr, pgprot_t prot,
> -					    unsigned int domid,
> -					    struct page **pages)
> -{
> -	return -EOPNOTSUPP;
> -}
> -
> -static inline int xen_xlate_unmap_gfn_range(struct vm_area_struct *vma,
> -					    int nr, struct page **pages)
> -{
> -	return -EOPNOTSUPP;
> -}
> -#endif
>  
>  int xen_remap_vma_range(struct vm_area_struct *vma, unsigned long addr,
>  			unsigned long len);
> -- 
> 2.55.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.