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>
This commit is contained in:
committed by
Juergen Gross
parent
e11423d672
commit
97315723c4
@ -2398,7 +2398,7 @@ static int remap_area_pfn_pte_fn(pte_t *ptep, unsigned long addr, void *data)
|
|||||||
|
|
||||||
int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
||||||
xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot,
|
xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot,
|
||||||
unsigned int domid, bool no_translate, struct page **pages)
|
unsigned int domid, bool no_translate)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct remap_data rmd;
|
struct remap_data rmd;
|
||||||
|
@ -257,7 +257,7 @@ static long privcmd_ioctl_mmap(struct file *file, void __user *udata)
|
|||||||
LIST_HEAD(pagelist);
|
LIST_HEAD(pagelist);
|
||||||
struct mmap_gfn_state state;
|
struct mmap_gfn_state state;
|
||||||
|
|
||||||
/* We only support privcmd_ioctl_mmap_batch for auto translated. */
|
/* We only support privcmd_ioctl_mmap_batch for non-auto-translated. */
|
||||||
if (xen_feature(XENFEAT_auto_translated_physmap))
|
if (xen_feature(XENFEAT_auto_translated_physmap))
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
@ -810,8 +810,7 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
|
|||||||
kdata.addr & PAGE_MASK,
|
kdata.addr & PAGE_MASK,
|
||||||
pfns, kdata.num, errs,
|
pfns, kdata.num, errs,
|
||||||
vma->vm_page_prot,
|
vma->vm_page_prot,
|
||||||
domid,
|
domid);
|
||||||
vma->vm_private_data);
|
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
rc = num;
|
rc = num;
|
||||||
else if (num != kdata.num) {
|
else if (num != kdata.num) {
|
||||||
|
@ -52,12 +52,12 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order);
|
|||||||
#if defined(CONFIG_XEN_PV)
|
#if defined(CONFIG_XEN_PV)
|
||||||
int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
||||||
xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot,
|
xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot,
|
||||||
unsigned int domid, bool no_translate, struct page **pages);
|
unsigned int domid, bool no_translate);
|
||||||
#else
|
#else
|
||||||
static inline int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
static inline int xen_remap_pfn(struct vm_area_struct *vma, unsigned long addr,
|
||||||
xen_pfn_t *pfn, int nr, int *err_ptr,
|
xen_pfn_t *pfn, int nr, int *err_ptr,
|
||||||
pgprot_t prot, unsigned int domid,
|
pgprot_t prot, unsigned int domid,
|
||||||
bool no_translate, struct page **pages)
|
bool no_translate)
|
||||||
{
|
{
|
||||||
BUG();
|
BUG();
|
||||||
return 0;
|
return 0;
|
||||||
@ -134,7 +134,7 @@ static inline int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
|
|||||||
*/
|
*/
|
||||||
BUG_ON(err_ptr == NULL);
|
BUG_ON(err_ptr == NULL);
|
||||||
return xen_remap_pfn(vma, addr, gfn, nr, err_ptr, prot, domid,
|
return xen_remap_pfn(vma, addr, gfn, nr, err_ptr, prot, domid,
|
||||||
false, pages);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -146,7 +146,6 @@ static inline int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
|
|||||||
* @err_ptr: Returns per-MFN error status.
|
* @err_ptr: Returns per-MFN error status.
|
||||||
* @prot: page protection mask
|
* @prot: page protection mask
|
||||||
* @domid: Domain owning the pages
|
* @domid: Domain owning the pages
|
||||||
* @pages: Array of pages if this domain has an auto-translated physmap
|
|
||||||
*
|
*
|
||||||
* @mfn and @err_ptr may point to the same buffer, the MFNs will be
|
* @mfn and @err_ptr may point to the same buffer, the MFNs will be
|
||||||
* overwritten by the error codes after they are mapped.
|
* overwritten by the error codes after they are mapped.
|
||||||
@ -157,14 +156,13 @@ static inline int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
|
|||||||
static inline int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
|
static inline int xen_remap_domain_mfn_array(struct vm_area_struct *vma,
|
||||||
unsigned long addr, xen_pfn_t *mfn,
|
unsigned long addr, xen_pfn_t *mfn,
|
||||||
int nr, int *err_ptr,
|
int nr, int *err_ptr,
|
||||||
pgprot_t prot, unsigned int domid,
|
pgprot_t prot, unsigned int domid)
|
||||||
struct page **pages)
|
|
||||||
{
|
{
|
||||||
if (xen_feature(XENFEAT_auto_translated_physmap))
|
if (xen_feature(XENFEAT_auto_translated_physmap))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
return xen_remap_pfn(vma, addr, mfn, nr, err_ptr, prot, domid,
|
return xen_remap_pfn(vma, addr, mfn, nr, err_ptr, prot, domid,
|
||||||
true, pages);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* xen_remap_domain_gfn_range() - map a range of foreign frames
|
/* xen_remap_domain_gfn_range() - map a range of foreign frames
|
||||||
@ -188,8 +186,7 @@ static inline int xen_remap_domain_gfn_range(struct vm_area_struct *vma,
|
|||||||
if (xen_feature(XENFEAT_auto_translated_physmap))
|
if (xen_feature(XENFEAT_auto_translated_physmap))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
return xen_remap_pfn(vma, addr, &gfn, nr, NULL, prot, domid, false,
|
return xen_remap_pfn(vma, addr, &gfn, nr, NULL, prot, domid, false);
|
||||||
pages);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
|
int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,
|
||||||
|
Reference in New Issue
Block a user