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] [day] [month] [year] [list]
Message-ID: <1698457540.127802-1-xuanzhuo@linux.alibaba.com>
Date:   Sat, 28 Oct 2023 09:45:40 +0800
From:   Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
To:     Jakub Sitnicki <jakub@...udflare.com>
Cc:     virtualization@...ts.linux-foundation.org,
        Jason Wang <jasowang@...hat.com>, linux-kernel@...r.kernel.org,
        kernel-team@...udflare.com, "Michael S. Tsirkin" <mst@...hat.com>
Subject: Re: [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint

On Fri, 27 Oct 2023 12:03:17 +0200, Jakub Sitnicki <jakub@...udflare.com> wrote:
> On Thu, Oct 26, 2023 at 01:20 PM -04, Michael S. Tsirkin wrote:
> > On Thu, Oct 26, 2023 at 06:25:08PM +0200, Jakub Sitnicki wrote:
> >> On Wed, Oct 25, 2023 at 04:53 PM +02, Jakub Sitnicki wrote:
> >> > Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity
> >> > hints") irq_set_affinity_hint is being phased out.
> >> >
> >> > Switch to new interfaces for setting and applying irq affinity hints.
> >> >
> >> > Signed-off-by: Jakub Sitnicki <jakub@...udflare.com>
> >> > ---
> >> > v2:
> >> >  - Leave cpumask_copy as is. We can't pass pointer to stack memory as hint.
> >> >    Proposed a change to IRQ affinity interface to address this limitation:
> >> >    https://lore.kernel.org/r/20231025141517.375378-1-jakub@cloudflare.com
> >>
> >> Just a note to the ^ - if we wanted to get rid of msix_affinity_masks,
> >> we could call irq_set_affinity directly, instead of calling it through
> >> irq_set_affinity[_and]_hint.
> >>
> >> The hint wouldn't be available any more in /proc/irq/N/affinity_hint,
> >> but the same information can be gathered from /proc/irq/N/smp_affinity.
> >>
> >> [...]
> >
> >
> > So we are potentially breaking some userspace - what's the value we
> > gain?  Is there some way we can make disable_irq/enable_irq work?
> > That would have a lot of value.
> > There is an actual need for that in virtio for coco but we can't use
> > these APIs with affinity managed IRQs.
>
> Sorry, that is beyond my ken today.
>
> I saw the comment in vp_modern_disable_vq_and_reset:
>
> 	/* For the case where vq has an exclusive irq, call synchronize_irq() to
> 	 * wait for completion.
> 	 *
> 	 * note: We can't use disable_irq() since it conflicts with the affinity
> 	 * managed IRQ that is used by some drivers.
> 	 */
>
> ... but I fail to follow how the two conflict.
>
> Perhaps Xuah could shed some light here.

I forgot which device that manages the irq by it self. If we disable the irq,
then the device will lost the irq, so we must not call disable_irq().

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ