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:   Fri, 15 Jan 2021 08:32:51 +0800
From:   Peter Chen <hzpeterchen@...il.com>
To:     Alan Stern <stern@...land.harvard.edu>
Cc:     Daewoong Kim <daewoong00.kim@....com>,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        allen.lkml@...il.com, gustavoars@...nel.org,
        a.darwish@...utronix.de, romain.perier@...il.com,
        dvyukov@...gle.com, andreyknvl@...gle.com, mathias.nyman@...el.com,
        gregkh@...uxfoundation.org
Subject: Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping

On 21-01-14 13:00:21, Alan Stern wrote:
> On Thu, Jan 14, 2021 at 01:04:02PM +0800, Peter Chen wrote:
> > On 21-01-14 11:59:07, Daewoong Kim wrote:
> > > DMA mapping of urb->setup_packet is not necessary for xHCI host
> > > controllers. The xHCI specification says that Setup Stage TRB includes
> > > whole Setup Data; therefore, urb->setup_dma will not be used in the xhci
> > > HCD code.
> > > 
> > 
> > How about bypass map/unmap operation for xHCI control transfer directly?
> > 
> > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> > index 91ab81c3fc79..0a0ab14b7638 100644
> > --- a/drivers/usb/host/xhci.c
> > +++ b/drivers/usb/host/xhci.c
> > @@ -1374,7 +1374,8 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
> >  
> >  	xhci = hcd_to_xhci(hcd);
> >  
> > -	if (xhci_urb_suitable_for_idt(urb))
> > +	if (xhci_urb_suitable_for_idt(urb) ||
> > +		(usb_endpoint_xfer_control(&urb->ep->desc)))
> >  		return 0;
> 
> Would this affect the map/unmap operations for the DATA packets in a 
> control transfer, along with the SETUP packet?
> 

Oh, you are right, Alan. We do need map/unmap operation for DATA
packet in control transfer.

-- 

Thanks,
Peter Chen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ