lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10a7ced9-33f2-47a0-b368-a6fecad6a842@redhat.com>
Date: Fri, 4 Jul 2025 10:46:18 +0200
From: David Hildenbrand <david@...hat.com>
To: lizhe.67@...edance.com, alex.williamson@...hat.com,
 akpm@...ux-foundation.org, peterx@...hat.com, jgg@...pe.ca
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v2 4/5] vfio/type1: introduce a new member has_rsvd for
 struct vfio_dma

On 04.07.25 08:26, lizhe.67@...edance.com wrote:
> From: Li Zhe <lizhe.67@...edance.com>
> 
> Introduce a new member has_rsvd for struct vfio_dma. This member is
> used to indicate whether there are any reserved or invalid pfns in
> the region represented by this vfio_dma. If it is true, it indicates
> that there is at least one pfn in this region that is either reserved
> or invalid.
> 
> Signed-off-by: Li Zhe <lizhe.67@...edance.com>
> ---
>   drivers/vfio/vfio_iommu_type1.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
> index b770eb1c4e07..13c5667d431c 100644
> --- a/drivers/vfio/vfio_iommu_type1.c
> +++ b/drivers/vfio/vfio_iommu_type1.c
> @@ -92,6 +92,7 @@ struct vfio_dma {
>   	bool			iommu_mapped;
>   	bool			lock_cap;	/* capable(CAP_IPC_LOCK) */
>   	bool			vaddr_invalid;
> +	bool			has_rsvd;	/* has 1 or more rsvd pfns */
>   	struct task_struct	*task;
>   	struct rb_root		pfn_list;	/* Ex-user pinned pfn list */
>   	unsigned long		*bitmap;
> @@ -774,6 +775,7 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr,
>   	}
>   
>   out:
> +	dma->has_rsvd |= rsvd;
>   	ret = vfio_lock_acct(dma, lock_acct, false);
>   
>   unpin_out:

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ