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]
Date:	Tue, 11 Nov 2014 11:07:32 +0000
From:	Stefano Stabellini <stefano.stabellini@...citrix.com>
To:	Catalin Marinas <catalin.marinas@....com>
CC:	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
	"Ian.Campbell@...rix.com" <Ian.Campbell@...rix.com>,
	"david.vrabel@...rix.com" <david.vrabel@...rix.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v8 03/13] xen/arm: if(pfn_valid(pfn)) call native
 dma_ops

On Mon, 10 Nov 2014, Catalin Marinas wrote:
> On Mon, Nov 10, 2014 at 04:13:55PM +0000, Stefano Stabellini wrote:
> >  void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
> >  		size_t size, enum dma_data_direction dir,
> > -		struct dma_attrs *attrs);
> > +		struct dma_attrs *attrs)
> > +{
> > +	unsigned long pfn = PFN_DOWN(handle);
> > +	/* Dom0 is mapped 1:1, so calling pfn_valid on a foreign mfn will
> > +	 * always return false. If the page is local we can safely call the
> > +	 * native dma_ops function, otherwise we call the xen specific
> > +	 * function. */
> > +	if (pfn_valid(pfn)) {
> > +		if (__generic_dma_ops(hwdev)->unmap_page)
> > +			__generic_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);
> 
> Similarly here, do we need the unmap_page check? dma_map_page() does not
> do it.

I think we do not need the map_page check, because that's always
implemented, but we need the unmap_page check. In fact
arm_coherent_dma_ops doesn't have unmap_page for example.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ