Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/privcmd: drop "pages" parameter from xen_remap_pfn()

The function doesn't use it and all of its callers say in a comment that
their respective arguments are to be non-NULL only in auto-translated
mode. Since xen_remap_domain_mfn_array() isn't supposed to be used by
non-PV, drop the parameter there as well. It was bogusly passed as non-
NULL (PRIV_VMA_LOCKED) by its only caller anyway. For
xen_remap_domain_gfn_range(), otoh, it's not clear at all why this
wouldn't want / might not need to gain auto-translated support down the
road, so the parameter is retained there despite now remaining unused
(and the only caller passing NULL); correct a respective comment as
well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

Link: https://lore.kernel.org/r/036ad8a2-46f9-ac3d-6219-bdc93ab9e10b@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Jan Beulich and committed by
Juergen Gross
97315723 e11423d6

+9 -13
+1 -1
arch/x86/xen/mmu_pv.c
··· 2398 2398 2399 2399 int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr, 2400 2400 xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot, 2401 - unsigned int domid, bool no_translate, struct page **pages) 2401 + unsigned int domid, bool no_translate) 2402 2402 { 2403 2403 int err = 0; 2404 2404 struct remap_data rmd;
+2 -3
drivers/xen/privcmd.c
··· 257 257 LIST_HEAD(pagelist); 258 258 struct mmap_gfn_state state; 259 259 260 - /* We only support privcmd_ioctl_mmap_batch for auto translated. */ 260 + /* We only support privcmd_ioctl_mmap_batch for non-auto-translated. */ 261 261 if (xen_feature(XENFEAT_auto_translated_physmap)) 262 262 return -ENOSYS; 263 263 ··· 810 810 kdata.addr & PAGE_MASK, 811 811 pfns, kdata.num, errs, 812 812 vma->vm_page_prot, 813 - domid, 814 - vma->vm_private_data); 813 + domid); 815 814 if (num < 0) 816 815 rc = num; 817 816 else if (num != kdata.num) {
+6 -9
include/xen/xen-ops.h
··· 52 52 #if defined(CONFIG_XEN_PV) 53 53 int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr, 54 54 xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot, 55 - unsigned int domid, bool no_translate, struct page **pages); 55 + unsigned int domid, bool no_translate); 56 56 #else 57 57 static inline int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr, 58 58 xen_pfn_t *pfn, int nr, int *err_ptr, 59 59 pgprot_t prot, unsigned int domid, 60 - bool no_translate, struct page **pages) 60 + bool no_translate) 61 61 { 62 62 BUG(); 63 63 return 0; ··· 134 134 */ 135 135 BUG_ON(err_ptr == NULL); 136 136 return xen_remap_pfn(vma, addr, gfn, nr, err_ptr, prot, domid, 137 - false, pages); 137 + false); 138 138 } 139 139 140 140 /* ··· 146 146 * @err_ptr: Returns per-MFN error status. 147 147 * @prot: page protection mask 148 148 * @domid: Domain owning the pages 149 - * @pages: Array of pages if this domain has an auto-translated physmap 150 149 * 151 150 * @mfn and @err_ptr may point to the same buffer, the MFNs will be 152 151 * overwritten by the error codes after they are mapped. ··· 156 157 static inline int xen_remap_domain_mfn_array(struct vm_area_struct *vma, 157 158 unsigned long addr, xen_pfn_t *mfn, 158 159 int nr, int *err_ptr, 159 - pgprot_t prot, unsigned int domid, 160 - struct page **pages) 160 + pgprot_t prot, unsigned int domid) 161 161 { 162 162 if (xen_feature(XENFEAT_auto_translated_physmap)) 163 163 return -EOPNOTSUPP; 164 164 165 165 return xen_remap_pfn(vma, addr, mfn, nr, err_ptr, prot, domid, 166 - true, pages); 166 + true); 167 167 } 168 168 169 169 /* xen_remap_domain_gfn_range() - map a range of foreign frames ··· 186 188 if (xen_feature(XENFEAT_auto_translated_physmap)) 187 189 return -EOPNOTSUPP; 188 190 189 - return xen_remap_pfn(vma, addr, &gfn, nr, NULL, prot, domid, false, 190 - pages); 191 + return xen_remap_pfn(vma, addr, &gfn, nr, NULL, prot, domid, false); 191 192 } 192 193 193 194 int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,