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: <20210113124209.GA1383@lst.de>
Date:   Wed, 13 Jan 2021 13:42:09 +0100
From:   Christoph Hellwig <hch@....de>
To:     Claire Chang <tientzu@...omium.org>
Cc:     robh+dt@...nel.org, mpe@...erman.id.au, benh@...nel.crashing.org,
        paulus@...ba.org, joro@...tes.org, will@...nel.org,
        frowand.list@...il.com, konrad.wilk@...cle.com,
        boris.ostrovsky@...cle.com, jgross@...e.com,
        sstabellini@...nel.org, hch@....de, m.szyprowski@...sung.com,
        robin.murphy@....com, grant.likely@....com, xypron.glpk@....de,
        treding@...dia.com, mingo@...nel.org, bauerman@...ux.ibm.com,
        peterz@...radead.org, gregkh@...uxfoundation.org,
        saravanak@...gle.com, rafael.j.wysocki@...el.com,
        heikki.krogerus@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
        rdunlap@...radead.org, dan.j.williams@...el.com,
        bgolaszewski@...libre.com, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
        iommu@...ts.linux-foundation.org, xen-devel@...ts.xenproject.org,
        tfiga@...omium.org, drinkcat@...omium.org
Subject: Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool

> +#ifdef CONFIG_SWIOTLB
> +	struct io_tlb_mem	*dma_io_tlb_mem;
>  #endif

Please add a new config option for this code instead of always building
it when swiotlb is enabled.

> +static int swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
> +				   size_t size)

Can you split the refactoring in swiotlb.c into one or more prep
patches?

> +static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
> +				    struct device *dev)
> +{
> +	struct io_tlb_mem *mem = rmem->priv;
> +	int ret;
> +
> +	if (dev->dma_io_tlb_mem)
> +		return -EBUSY;
> +
> +	if (!mem) {
> +		mem = kzalloc(sizeof(*mem), GFP_KERNEL);
> +		if (!mem)
> +			return -ENOMEM;

What is the calling convention here that allows for a NULL and non-NULL
private data?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ