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: <6b6f2af5-74b4-cf51-3c48-6ebc8c040885@caviumnetworks.com>
Date:   Tue, 17 Jan 2017 13:12:29 +0100
From:   Tomasz Nowicki <tnowicki@...iumnetworks.com>
To:     Eric Auger <eric.auger@...hat.com>, <eric.auger.pro@...il.com>,
        <christoffer.dall@...aro.org>, <marc.zyngier@....com>,
        <robin.murphy@....com>, <alex.williamson@...hat.com>,
        <will.deacon@....com>, <joro@...tes.org>, <tglx@...utronix.de>,
        <jason@...edaemon.net>, <linux-arm-kernel@...ts.infradead.org>
CC:     <drjones@...hat.com>, <kvm@...r.kernel.org>,
        <punit.agrawal@....com>, <linux-kernel@...r.kernel.org>,
        <geethasowjanya.akula@...il.com>, <diana.craciun@....com>,
        <iommu@...ts.linux-foundation.org>,
        <pranav.sawargaonkar@...il.com>, <bharat.bhushan@....com>,
        <shankerd@...eaurora.org>, <gpkulkarni@...il.com>
Subject: Re: [PATCH v8 04/18] iommu: iommu_alloc_resv_region

On 11.01.2017 10:41, Eric Auger wrote:
> Introduce a new helper serving the purpose to allocate a reserved
> region. This will be used in iommu driver implementing reserved
> region callbacks.
>
> Signed-off-by: Eric Auger <eric.auger@...hat.com>

Reviewed-by: Tomasz Nowicki <tomasz.nowicki@...iumnetworks.com>

Thanks,
Tomasz

>
> ---
>
> v3 -> v4:
> - add INIT_LIST_HEAD(&region->list)
> - use int for prot param and add int type param
> - remove implementation outside of CONFIG_IOMMU_API
> ---
>  drivers/iommu/iommu.c | 18 ++++++++++++++++++
>  include/linux/iommu.h |  2 ++
>  2 files changed, 20 insertions(+)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 1cee5c3..927878d 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1575,6 +1575,24 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list)
>  		ops->put_resv_regions(dev, list);
>  }
>
> +struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
> +						  size_t length,
> +						  int prot, int type)
> +{
> +	struct iommu_resv_region *region;
> +
> +	region = kzalloc(sizeof(*region), GFP_KERNEL);
> +	if (!region)
> +		return NULL;
> +
> +	INIT_LIST_HEAD(&region->list);
> +	region->start = start;
> +	region->length = length;
> +	region->prot = prot;
> +	region->type = type;
> +	return region;
> +}
> +
>  /* Request that a device is direct mapped by the IOMMU */
>  int iommu_request_dm_for_dev(struct device *dev)
>  {
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 233a6bf..f6bb55d3 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -244,6 +244,8 @@ extern void iommu_set_fault_handler(struct iommu_domain *domain,
>  extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
>  extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
>  extern int iommu_request_dm_for_dev(struct device *dev);
> +extern struct iommu_resv_region *
> +iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot, int type);
>
>  extern int iommu_attach_group(struct iommu_domain *domain,
>  			      struct iommu_group *group);
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ