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: <579b6a18-624d-8071-e326-fc69028d3fc5@quicinc.com>
Date:   Mon, 24 Apr 2023 18:17:25 -0700
From:   Wesley Cheng <quic_wcheng@...cinc.com>
To:     Mathias Nyman <mathias.nyman@...ux.intel.com>,
        <srinivas.kandagatla@...aro.org>, <mathias.nyman@...el.com>,
        <perex@...ex.cz>, <broonie@...nel.org>, <lgirdwood@...il.com>,
        <krzysztof.kozlowski+dt@...aro.org>, <agross@...nel.org>,
        <Thinh.Nguyen@...opsys.com>, <bgoswami@...cinc.com>,
        <andersson@...nel.org>, <robh+dt@...nel.org>,
        <gregkh@...uxfoundation.org>, <tiwai@...e.com>
CC:     <linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <alsa-devel@...a-project.org>, <devicetree@...r.kernel.org>,
        <linux-usb@...r.kernel.org>, <quic_jackp@...cinc.com>,
        <quic_plai@...cinc.com>
Subject: Re: [PATCH v3 01/28] xhci: Add support to allocate several
 interrupters

Hi Mathias,

On 3/13/2023 1:08 PM, Wesley Cheng wrote:
> Hi Mathias,
> 
> On 3/10/2023 7:07 AM, Mathias Nyman wrote:
>> On 9.3.2023 1.57, Wesley Cheng wrote:
>>> From: Mathias Nyman <mathias.nyman@...ux.intel.com>
>>>
>>> Introduce xHCI APIs to allow for clients to allocate and free
>>> interrupters.  This allocates an array of interrupters, which is 
>>> based on
>>> the max_interrupters parameter.  The primary interrupter is set as the
>>> first entry in the array, and secondary interrupters following after.
>>>
>>
>> I'm thinking about changing this offloading xHCI API
>> xhci should be aware and keep track of which devices and endpoints that
>> are offloaded to avoid device getting offloaded twice, avoid xhci driver
>> from queuing anything itself for these, and act properly if the offloaded
>> device or entire host is removed.
>>
>> So first thing audio side would need to do do is register/create an
>> offload entry for the device using the API:
>>
>> struct xhci_sideband *xhci_sideband_register(struct usb_device *udev)
>>
>> (xHCI specs calls offload sideband)
>> Then endpoints and interrupters can be added and removed from this
>> offload entry
>>
>> I have some early thoughts written as non-compiling code in:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git 
>> feature_interrupters
>> https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/log/?h=feature_interrupters 
>>
>>
>> Let me know what you think about this.
>>
> 
> The concept/framework you built looks good to me.  Makes sense to have 
> XHCI better maintain the offloading users.  One thing I would request is 
> to move xhci-sideband.h to the include directory since the class driver 
> levels would need to be able to reference the structure and APIs you've 
> exposed.
> 
> I have yet to try it with our implementation, but I'll work on plugging 
> it in and fix any issues I see along the way.

Sorry for the late reply on some of the efforts on adding your new 
xhci-sideband driver.

I saw your comments with respect to building the SG table for rings with 
multiple segments, ie stream xfer rings.  I had tried some things to 
achieve the page links, but after reviewing some of the Linux memory 
APIs, I'm not sure we can achieve it.  This is because we're not simply 
relying on the direct DMA ops here to build the SG table.  In the IOMMU 
mapped cases, it calls in iommu_dma_get_sgtable(), which has some 
convoluted logic to build the sgt.

Instead of allocating one sgt with multiple sgls (based on # of ring 
segments), would it make sense to just build multiple sgts for each ring 
segment?  The vendor class driver could still fetch the required memory 
information to translate each sgt to a physical address and ring segment 
linking can happen within the external DSP if it supports it.

Thanks
Wesley Cheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ