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]
Date:   Mon, 01 Mar 2021 14:33:09 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     Anton Yakovlev <anton.yakovlev@...nsynergy.com>
Cc:     <virtualization@...ts.linux-foundation.org>,
        <alsa-devel@...a-project.org>, <virtio-dev@...ts.oasis-open.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 6/9] ALSA: virtio: PCM substream operators

On Mon, 01 Mar 2021 10:29:24 +0100,
Anton Yakovlev wrote:
> 
> On 28.02.2021 12:32, Takashi Iwai wrote:
> > On Sat, 27 Feb 2021 09:59:53 +0100,
> > Anton Yakovlev wrote:
> >>
> 
> 
> [snip]
> 
> 
> >> +static snd_pcm_uframes_t
> >> +virtsnd_pcm_pointer(struct snd_pcm_substream *substream)
> >> +{
> >> +     struct virtio_pcm_substream *vss = snd_pcm_substream_chip(substream);
> >> +     snd_pcm_uframes_t hw_ptr = SNDRV_PCM_POS_XRUN;
> >> +     unsigned long flags;
> >> +
> >> +     spin_lock_irqsave(&vss->lock, flags);
> >> +     if (!vss->xfer_xrun)
> >> +             hw_ptr = bytes_to_frames(substream->runtime, vss->hw_ptr);
> >> +     spin_unlock_irqrestore(&vss->lock, flags);
> >
> > Oh, and if we drop nonatomc PCM, both trigger and pointer callbacks
> > are guaranteed to be called inside the spinlock, hence you can remove
> > *_irqsave() but just us spin_lock() in those two callbacks.
> 
> As I understand, spin_lock_irqsave() disables only local interrupts. But
> what about other CPU cores?

Those are already under spin_lock_irqsave() of the PCM substream
lock (in the case of normal PCM operation without nonatomic flag).


Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ