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, 6 Jun 2023 17:43:05 +0100
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Yicong Yang <yangyicong@...wei.com>
CC:     <mathieu.poirier@...aro.org>, <suzuki.poulose@....com>,
        <corbet@....net>, <linux-kernel@...r.kernel.org>,
        <linux-doc@...r.kernel.org>, <alexander.shishkin@...ux.intel.com>,
        <helgaas@...nel.org>, <linux-pci@...r.kernel.org>,
        <prime.zeng@...wei.com>, <linuxarm@...wei.com>,
        <yangyicong@...ilicon.com>
Subject: Re: [PATCH v4 5/5] hwtracing: hisi_ptt: Fix potential sleep in
 atomic context

On Tue, 6 Jun 2023 22:22:44 +0800
Yicong Yang <yangyicong@...wei.com> wrote:

> From: Yicong Yang <yangyicong@...ilicon.com>
> 
> We're using pci_irq_vector() to obtain the interrupt number and then
> bind it to the CPU start perf under the protection of spinlock in
> pmu::start(). pci_irq_vector() might sleep since [1] because it will
> call msi_domain_get_virq() to get the MSI interrupt number and it
> needs to acquire dev->msi.data->mutex. Getting a mutex will sleep on
> contention. So use pci_irq_vector() in an atomic context is problematic.
> 
> This patch cached the interrupt number in the probe() and uses the
> cached data instead to avoid potential sleep.
> 
> [1] commit 82ff8e6b78fc ("PCI/MSI: Use msi_get_virq() in pci_get_vector()")
> Fixes: ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device")
> Signed-off-by: Yicong Yang <yangyicong@...ilicon.com>

LGTM

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ