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: <1398152333.723.27.camel@shinybook.infradead.org>
Date:	Tue, 22 Apr 2014 08:38:53 +0100
From:	David Woodhouse <dwmw2@...radead.org>
To:	Jiang Liu <jiang.liu@...ux.intel.com>
Cc:	Joerg Roedel <joro@...tes.org>, Yinghai Lu <yinghai@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Vinod Koul <vinod.koul@...el.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
	Ashok Raj <ashok.raj@...el.com>,
	Yijing Wang <wangyijing@...wei.com>,
	Tony Luck <tony.luck@...el.com>,
	iommu@...ts.linux-foundation.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org
Subject: Re: [Patch Part3 V1 19/22] iommu/vt-d: simplify intel_unmap_sg()
 and kill duplicated code

On Tue, 2014-04-22 at 15:07 +0800, Jiang Liu wrote:
> +       size_t size = 0;
> +#if 0
> +       /* current the third argument of intel_unmap_page is unsued */
> +       int i;
> +       struct scatterlist *sg;
>  
> -       freelist = domain_unmap(domain, start_pfn, last_pfn);
> +       for_each_sg(sglist, sg, nelems, i)
> +               size += sg->length;
> +#endif

Please don't do that. If you want to rely on the fact that
intel_unmap_page() currently just uses the size from the IOVA it finds,
then split it out into a separate function which explicitly does
precisely that. And call that new function from both intel_unmap_sg()
and intel_unmap_page().

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@...el.com                              Intel Corporation

Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5745 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ