Re: [PATCH] arm64: paravirt: remove conduit check in has_pv_steal_clock

2022-11-09 Thread Will Deacon
On Fri, 4 Nov 2022 06:16:59 +, Usama Arif wrote: > arm_smccc_1_1_invoke() which is called later on in the function > will return failure if there's no conduit (or pre-SMCCC 1.1), > hence the check is unnecessary. > > Applied to arm64 (for-next/trivial), thanks! [1/1] arm64: paravirt:

Re: [PATCH v7 4/5] iommu: Use EINVAL for incompatible device/domain in ->attach_dev

2022-11-08 Thread Will Deacon
On Mon, Nov 07, 2022 at 04:14:32PM -0800, Nicolin Chen wrote: > On Mon, Nov 07, 2022 at 03:26:45PM +, Will Deacon wrote: > > > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > > b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > > index

Re: [PATCH v7 4/5] iommu: Use EINVAL for incompatible device/domain in ->attach_dev

2022-11-07 Thread Will Deacon
smmu_domain->stall_enabled ? "enabled" : "disabled"); > ret = -EINVAL; > goto out_unlock; > } I think it would be helpful to preserve these messages using dev_err_ratelimited() so that attach failure can be diagnosed without having to hack the messages back into the driver. With that: Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-17 Thread Will Deacon
On Mon, Aug 08, 2022 at 08:45:48AM -0400, Michael S. Tsirkin wrote: > > > Also yes, I think it's a good idea to change crosvm anyway. While the > > > work around I describe might make sense upstream I don't think it's a > > > reasonable thing to do in stable kernels. > > > I think I'll prepare a

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Will Deacon
Hi Michael, On Sun, Aug 07, 2022 at 09:14:43AM -0400, Michael S. Tsirkin wrote: > Will, thanks very much for the analysis and the writeup! No problem, and thanks for following up. > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > So how should we fix this? One

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
On Sat, Aug 06, 2022 at 06:52:15AM -0400, Stefan Hajnoczi wrote: > On Sat, Aug 6, 2022 at 5:50 AM Will Deacon wrote: > > On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: > > > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > >

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > On Fri, Aug 5, 2022 at 11:11 AM Will Deacon wrote: > > > > [tl;dr a change from ~18 months ago breaks Android userspace and I don't > > know what to do about it] > > Augh. > > I had hoped that a

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
Hi Stefano, On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > The fundamental issue is, I think, that VIRTIO_F_ACCESS_PLATFORM is > > being used for two very different things within

IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-05 Thread Will Deacon
Hi folks, [tl;dr a change from ~18 months ago breaks Android userspace and I don't know what to do about it] As part of the development work for next year's Android, we've recently been bringing up a 5.15 KVM host and have observed that vsock no longer works for communicating with a guest

Re: [PATCH RESEND v5 1/5] iommu: Refactor iommu_group_store_type()

2022-07-06 Thread Will Deacon
On Wed, Jul 06, 2022 at 01:03:44PM +0100, John Garry wrote: > On 06/07/2022 13:00, Will Deacon wrote: > > On Mon, Apr 04, 2022 at 07:27:10PM +0800, John Garry wrote: > > > Function iommu_group_store_type() supports changing the default domain > > > of an IOMMU group. &

Re: [PATCH RESEND v5 2/5] iova: Allow rcache range upper limit to be flexible

2022-07-06 Thread Will Deacon
On Thu, Apr 07, 2022 at 03:52:53PM +0800, Leizhen (ThunderTown) wrote: > On 2022/4/4 19:27, John Garry wrote: > > Some low-level drivers may request DMA mappings whose IOVA length exceeds > > that of the current rcache upper limit. > > > > This means that allocations for those IOVAs will never be

Re: [PATCH RESEND v5 2/5] iova: Allow rcache range upper limit to be flexible

2022-07-06 Thread Will Deacon
@huawei.com/ > > Signed-off-by: John Garry > --- > drivers/iommu/iova.c | 20 ++-- > include/linux/iova.h | 3 +++ > 2 files changed, 13 insertions(+), 10 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH RESEND v5 1/5] iommu: Refactor iommu_group_store_type()

2022-07-06 Thread Will Deacon
hn Garry > --- > drivers/iommu/iommu.c | 96 --- > 1 file changed, 62 insertions(+), 34 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v3] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-17 Thread Will Deacon
On Fri, 13 May 2022 10:46:54 -0700, Elliot Berman wrote: > From: Prakruthi Deepak Heragu > > During hotplug, the stolen time data structure is unmapped and memset. > There is a possibility of the timer IRQ being triggered before memset > and stolen time is getting updated as part of this timer

Re: [PATCH v3] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-17 Thread Will Deacon
puhp_invoke_callback+0x248/0xc34 > > [ 3458.266842][C5] cpuhp_thread_fun+0x1c4/0x248 > > [ 3458.271696][C5] smpboot_thread_fn+0x1b0/0x400 > > [ 3458.276638][C5] kthread+0x17c/0x1e0 > > [ 3458.280691][C5] ret_from_fork+0x10/0x20 > > > > As a fix,

Re: [PATCH v2] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-05 Thread Will Deacon
Hi Elliot, On Thu, Apr 28, 2022 at 11:35:36AM -0700, Elliot Berman wrote: > From: Prakruthi Deepak Heragu > > During hotplug, the stolen time data structure is unmapped and memset. > There is a possibility of the timer IRQ being triggered before memset > and stolen time is getting updated as

Re: [PATCH v2] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-04 Thread Will Deacon
On Wed, May 04, 2022 at 03:38:47PM +0200, Juergen Gross wrote: > On 04.05.22 11:45, Will Deacon wrote: > > On Thu, Apr 28, 2022 at 11:35:36AM -0700, Elliot Berman wrote: > > > diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c > > > index 75fed4

Re: [PATCH v2] arm64: paravirt: Use RCU read locks to guard stolen_time

2022-05-04 Thread Will Deacon
On Thu, Apr 28, 2022 at 11:35:36AM -0700, Elliot Berman wrote: > From: Prakruthi Deepak Heragu > > During hotplug, the stolen time data structure is unmapped and memset. > There is a possibility of the timer IRQ being triggered before memset > and stolen time is getting updated as part of this

Re: [PATCH] arm64: paravirt: Disable IRQs during stolen_time_cpu_down_prepare

2022-04-21 Thread Will Deacon
On Thu, Apr 21, 2022 at 09:44:28AM +0200, Juergen Gross wrote: > On 20.04.22 22:44, Elliot Berman wrote: > > From: Prakruthi Deepak Heragu > > > > During hotplug, the stolen time data structure is unmapped and memset. > > There is a possibility of the timer IRQ being triggered before memset > >

[PATCH] virtio_ring: Fix querying of maximum DMA mapping size for virtio device

2021-12-01 Thread Will Deacon
code when calling into the DMA layer and pass the parent device to dma_max_mapping_size() instead. Cc: Marc Zyngier Cc: Quentin Perret Cc: "Michael S. Tsirkin" Cc: Jason Wang Signed-off-by: Will Deacon --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 0/5] iommu: Some IOVA code reorganisation

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:52PM +0800, John Garry wrote: > The IOVA domain structure is a bit overloaded, holding: > - IOVA tree management > - FQ control > - IOVA rcache memories > > Indeed only a couple of IOVA users use the rcache, and only dma-iommu.c > uses the FQ feature. > > This

Re: [PATCH 5/5] iommu/iova: Avoid double-negatives in magazine helpers

2021-10-04 Thread Will Deacon
On Fri, Sep 24, 2021 at 06:01:57PM +0800, John Garry wrote: > A similar crash to the following could be observed if initial CPU rcache > magazine allocations fail in init_iova_rcaches(): > > Unable to handle kernel NULL pointer dereference at virtual address > > Mem abort info:

Re: [PATCH 1/5] iova: Move fast alloc size roundup into alloc_iova_fast()

2021-10-04 Thread Will Deacon
gt; --- > drivers/iommu/dma-iommu.c| 8 > drivers/iommu/iova.c | 9 + > drivers/vdpa/vdpa_user/iova_domain.c | 8 > 3 files changed, 9 insertions(+), 16 deletions(-) Acked-by: Will Deacon Will

Re: [PATCH v11 01/12] iova: Export alloc_iova_fast() and free_iova_fast()

2021-08-25 Thread Will Deacon
pinlock in alloc_iova() and free_iova() > > during IOVA allocation. > > > > Signed-off-by: Xie Yongji > > > This needs ack from iommu maintainers. Guys? Looks fine to me: Acked-by: Will Deacon Will ___ Virtualization mailing list

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-04-01 Thread Will Deacon
On Thu, Apr 01, 2021 at 11:59:45AM +0200, Christoph Hellwig wrote: > For now I'll just pass the iommu_domain to iommu_get_dma_strict, > so that we can check for it. We can do additional cleanups on top > of that later. Sounds good to me, cheers! Will

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Will Deacon
On Wed, Mar 31, 2021 at 02:09:37PM +0100, Robin Murphy wrote: > On 2021-03-31 12:49, Will Deacon wrote: > > On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: > > > On 2021-03-30 14:58, Will Deacon wrote: > > > > On Tue, Mar 30, 2021 at 02:19:

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Will Deacon
On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: > On 2021-03-30 14:58, Will Deacon wrote: > > On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: > > > On 2021-03-30 14:11, Will Deacon wrote: > > > > On Tue, Mar 16, 2021 at 04:38:22PM

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Will Deacon
On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: > On 2021-03-30 14:11, Will Deacon wrote: > > On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: > > > From: Robin Murphy > > > > > > Instead make the global iommu_dma_

Re: [PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr

2021-03-30 Thread Will Deacon
--- > 2 files changed, 62 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-30 Thread Will Deacon
| 12 - > 6 files changed, 35 insertions(+), 63 deletions(-) I'm fine with this for now, although there has been talk about passing things other than boolean flags as page-table quirks. We can cross that bridge when we get there, so: Acked-by: Will Deacon Will ___

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: > From: Robin Murphy > > Instead make the global iommu_dma_strict paramete in iommu.c canonical by > exporting helpers to get and set it and use those directly in the drivers. > > This make sure that the iommu.strict parameter

Re: [PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:21PM +0100, Christoph Hellwig wrote: > Don't obsfucate the trivial bit flag check. > > Signed-off-by: Christoph Hellwig > --- > drivers/iommu/iommu.c | 23 +-- > 1 file changed, 5 insertions(+), 18 deletions(-) Ack

Re: [PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING

2021-03-30 Thread Will Deacon
> 6 files changed, 55 insertions(+), 68 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 13/18] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-30 Thread Will Deacon
- > drivers/vfio/vfio_iommu_type1.c | 26 -- > drivers/vhost/vdpa.c| 10 +++--- > include/linux/iommu.h | 1 - > 4 files changed, 18 insertions(+), 39 deletions(-) Acked-by: Will Deacon Will _

Re: [PATCH 12/18] iommu: remove DOMAIN_ATTR_PAGING

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:18PM +0100, Christoph Hellwig wrote: > DOMAIN_ATTR_PAGING is never used. > > Signed-off-by: Christoph Hellwig > Acked-by: Li Yang > --- > drivers/iommu/iommu.c | 5 - > include/linux/iommu.h | 1 - > 2 files changed, 6 deletions(-

Re: [PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-03-30 Thread Will Deacon
nged, 2 insertions(+), 4 deletions(-) pamu_config_ppaace() takes quite a few useless parameters at this stage, but anyway: Acked-by: Will Deacon Do you know if this driver is actually useful? Once the complexity has been stripped back, the stubs and default

Re: [PATCH 10/18] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-30 Thread Will Deacon
sl/qbman/qman_portal.c | 11 --- > include/linux/iommu.h | 1 - > 4 files changed, 3 insertions(+), 66 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 09/18] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-30 Thread Will Deacon
; 1 file changed, 20 insertions(+), 39 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:14PM +0100, Christoph Hellwig wrote: > Merge the two fuctions that configure the ppaace into a single coherent > function. I somehow doubt we need the two pamu_config_ppaace calls, > but keep the existing behavior just to be on the safe side. > > Signed-off-by:

Re: [PATCH 07/18] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-30 Thread Will Deacon
> 5 files changed, 9 insertions(+), 40 deletions(-) Heh, this thing is so over-engineered. Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-30 Thread Will Deacon
On Tue, Mar 16, 2021 at 04:38:12PM +0100, Christoph Hellwig wrote: > The only thing that fsl_pamu_window_enable does for the current caller > is to fill in the prot value in the only dma_window structure, and to > propagate a few values from the iommu_domain_geometry struture into the >

Re: [PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-03-30 Thread Will Deacon
stale ^^ > - struct dma_window *win_arr; > + struct dma_window win_arr[1]; > /* list of devices associated with the domain */ > struct list_headdevices; > /* dma_domain states: Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 04/18] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-30 Thread Will Deacon
hanged, 10 insertions(+), 24 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 03/18] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-30 Thread Will Deacon
changed, 5 insertions(+), 68 deletions(-) Took me a minute to track down the other magic '36' which ends up in aperture_end, but I found it eventually so: Acked-by: Will Deacon (It does make me wonder what all this glue was intended to be used for) Will

Re: [PATCH 02/18] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-30 Thread Will Deacon
- > drivers/iommu/fsl_pamu_domain.c | 30 -- > include/linux/iommu.h | 4 > 2 files changed, 34 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists

Re: [PATCH 01/18] iommu: remove the unused domain_window_disable method

2021-03-30 Thread Will Deacon
--- > include/linux/iommu.h | 2 -- > 2 files changed, 50 deletions(-) Acked-by: Will Deacon Will ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [Freedreno] [PATCH 16/17] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-10 Thread Will Deacon
On Wed, Mar 10, 2021 at 09:58:06AM +0100, Christoph Hellwig wrote: > On Fri, Mar 05, 2021 at 10:00:12AM +, Will Deacon wrote: > > > But one thing I'm not sure about is whether > > > IO_PGTABLE_QUIRK_ARM_OUTER_WBWA is something that other devices > > > *shou

Re: [Freedreno] [PATCH 16/17] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-05 Thread Will Deacon
On Thu, Mar 04, 2021 at 03:11:08PM -0800, Rob Clark wrote: > On Thu, Mar 4, 2021 at 7:48 AM Robin Murphy wrote: > > > > On 2021-03-01 08:42, Christoph Hellwig wrote: > > > Signed-off-by: Christoph Hellwig > > > > Moreso than the previous patch, where the feature is at least relatively > >

Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR

2020-07-24 Thread Will Deacon
On Thu, Jul 23, 2020 at 08:47:59PM +0200, pet...@infradead.org wrote: > On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: > > BTW, do you have any comment on my v2 lock holder cpu info qspinlock patch? > > I will have to update the patch to fix the reported 0-day test problem, but > > I

Re: [PATCH v3 02/19] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h

2020-07-20 Thread Will Deacon
On Mon, Jul 13, 2020 at 08:23:22PM +0800, boqun.f...@gmail.com wrote: > On Fri, Jul 10, 2020 at 05:51:46PM +0100, Will Deacon wrote: > > diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h > > new file mode 100644 > > index ..92cc2f223

Re: [PATCH v3 06/19] asm/rwonce: Don't pull into 'asm-generic/rwonce.h'

2020-07-10 Thread Will Deacon
On Fri, Jul 10, 2020 at 10:06:12AM -0700, Nick Desaulniers wrote: > On Fri, Jul 10, 2020 at 9:52 AM Will Deacon wrote: > > diff --git a/include/linux/nospec.h b/include/linux/nospec.h > > index 0c5ef54fd416..c1e79f72cd89 100644 > > --- a/include/linux/nospec.h > > +

[PATCH v3 17/19] arm64: cpufeatures: Add capability for LDAPR instruction

2020-07-10 Thread Will Deacon
the compiler is capable of breaking the dependencies. Since LDAPR is not available on all CPUs, add a cpufeature to detect it at runtime and allow the instruction to be used with alternative code patching. Signed-off-by: Will Deacon --- arch/arm64/Kconfig | 3 +++ arch/arm64/include/asm

[PATCH v3 04/19] alpha: Override READ_ONCE() with barriered implementation

2020-07-10 Thread Will Deacon
from the generic implementation. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- arch/alpha/include/asm/barrier.h | 59 +++- arch/alpha/include/asm/rwonce.h | 35 +++ 2 files changed, 40 insertions(+), 54 deletions(-) create mode 100644 arch

[PATCH v3 16/19] arm64: alternatives: Split up alternative.h

2020-07-10 Thread Will Deacon
-off-by: Will Deacon --- arch/arm64/include/asm/alternative-macros.h | 276 arch/arm64/include/asm/alternative.h| 267 +-- arch/arm64/include/asm/insn.h | 3 +- 3 files changed, 279 insertions(+), 267 deletions(-) create mode 100644 arch

[PATCH v3 12/19] tools/memory-model: Remove smp_read_barrier_depends() from informal doc

2020-07-10 Thread Will Deacon
smp_read_barrier_depends() has gone the way of mmiowb() and so many esoteric memory barriers before it. Drop the two mentions of this deceased barrier from the LKMM informal explanation document. Acked-by: Alan Stern Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- .../Documentation

[PATCH v3 19/19] arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y

2020-07-10 Thread Will Deacon
READ_ONCE() definition with one that provides acquire semantics when building with LTO. Signed-off-by: Will Deacon --- arch/arm64/include/asm/rwonce.h | 63 +++ arch/arm64/kernel/vdso/Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 3 files changed, 65

[PATCH v3 13/19] include/linux: Remove smp_read_barrier_depends() from comments

2020-07-10 Thread Will Deacon
smp_read_barrier_depends() doesn't exist any more, so reword the two comments that mention it to refer to "dependency ordering" instead. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/linux/percpu-refcount.h | 2 +- include/linux/ptr_ring.h| 2 +- 2 files

[PATCH v3 14/19] checkpatch: Remove checks relating to [smp_]read_barrier_depends()

2020-07-10 Thread Will Deacon
The [smp_]read_barrier_depends() macros no longer exist, so we don't need to deal with them in the checkpatch script. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- scripts/checkpatch.pl | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts

[PATCH v3 18/19] arm64: alternatives: Remove READ_ONCE() usage during patch operation

2020-07-10 Thread Will Deacon
In preparation for patching the internals of READ_ONCE() itself, replace its usage on the alternatives patching patch with a volatile variable instead. Signed-off-by: Will Deacon --- arch/arm64/kernel/alternative.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch

[PATCH v3 09/19] locking/barriers: Remove definitions for [smp_]read_barrier_depends()

2020-07-10 Thread Will Deacon
There are no remaining users of [smp_]read_barrier_depends(), so remove it from the generic implementation of 'barrier.h'. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/barrier.h | 17 - 1 file changed, 17 deletions(-) diff --git a/include/asm

[PATCH v3 11/19] Documentation/barriers/kokr: Remove references to [smp_]read_barrier_depends()

2020-07-10 Thread Will Deacon
From: SeongJae Park This commit translates commit ("Documentation/barriers: Remove references to [smp_]read_barrier_depends()") into Korean. Signed-off-by: SeongJae Park Reviewed-by: Yunjae Lee Signed-off-by: Will Deacon --- .../translations/ko_KR/memory-barriers.tx

[PATCH v3 15/19] arm64: Reduce the number of header files pulled into vmlinux.lds.S

2020-07-10 Thread Will Deacon
-ld:./arch/arm64/kernel/vmlinux.lds:1: syntax error In preparation for an arm64-private asm/rwonce.h implementation, which will end up pulling assembly macros into linux/compiler.h, reduce the number of headers we include directly and transitively in vmlinux.lds.S Signed-off-by: Will Deacon

[PATCH v3 10/19] Documentation/barriers: Remove references to [smp_]read_barrier_depends()

2020-07-10 Thread Will Deacon
rriers.txt' as it doesn't make any sense now that the dependency barriers have been removed. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/memory-barriers.txt | 156 +- 2 files changed, 9

[PATCH 00/18] Allow architectures to override __READ_ONCE()

2020-07-10 Thread Will Deacon
tion/barriers/kokr: Remove references to [smp_]read_barrier_depends() Will Deacon (18): tools: bpf: Use local copy of headers including uapi/linux/filter.h compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h asm/rwonce: Allow __READ_ONCE to be overridden by the architecture

[PATCH v3 08/19] alpha: Replace smp_read_barrier_depends() usage with smp_[r]mb()

2020-07-10 Thread Will Deacon
In preparation for removing smp_read_barrier_depends() altogether, move the Alpha code over to using smp_rmb() and smp_mb() directly. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- arch/alpha/include/asm/atomic.h | 16 arch/alpha/include/asm/pgtable.h | 10

[PATCH v3 01/19] tools: bpf: Use local copy of headers including uapi/linux/filter.h

2020-07-10 Thread Will Deacon
. Cc: Masahiro Yamada Acked-by: Alexei Starovoitov Suggested-by: Daniel Borkmann Reported-by: Xiao Yang Signed-off-by: Will Deacon --- tools/bpf/Makefile| 3 +- tools/include/uapi/linux/filter.h | 90 +++ 2 files changed, 92 insertions(+), 1

[PATCH v3 06/19] asm/rwonce: Don't pull into 'asm-generic/rwonce.h'

2020-07-10 Thread Will Deacon
Now that 'smp_read_barrier_depends()' has gone the way of the Norwegian Blue, drop the inclusion of in 'asm-generic/rwonce.h'. This requires fixups to some architecture vdso headers which were previously relying on 'asm/barrier.h' coming in via 'linux/compiler.h'. Signed-off-by: Will Deacon

[PATCH v3 05/19] asm/rwonce: Remove smp_read_barrier_depends() invocation

2020-07-10 Thread Will Deacon
Alpha overrides __READ_ONCE() directly, so there's no need to use smp_read_barrier_depends() in the core code. This also means that __READ_ONCE() can be relied upon to provide dependency ordering. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/rwonce.h | 19

[PATCH v3 03/19] asm/rwonce: Allow __READ_ONCE to be overridden by the architecture

2020-07-10 Thread Will Deacon
required. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/rwonce.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h index 92cc2f223cb3..f9dfa88fc04d 100644 --- a/include/asm-generic/rwonce.h +++ b/include

[PATCH v3 07/19] vhost: Remove redundant use of read_barrier_depends() barrier

2020-07-10 Thread Will Deacon
to | indirect->addr after avail idx is increased Remove the redundant barrier invocation. Suggested-by: Jason Wang Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- drivers/vhost/vhost.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/v

[PATCH v3 02/19] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h

2020-07-10 Thread Will Deacon
-by: Will Deacon --- include/asm-generic/Kbuild| 1 + include/asm-generic/barrier.h | 2 +- include/asm-generic/rwonce.h | 91 +++ include/linux/compiler.h | 83 +--- 4 files changed, 95 insertions(+), 82 deletions(-) create mode

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-06 Thread Will Deacon
On Mon, Jul 06, 2020 at 05:08:20PM +0100, Dave Martin wrote: > On Tue, Jun 30, 2020 at 06:37:34PM +0100, Will Deacon wrote: > > diff --git a/arch/arm64/include/asm/rwonce.h > > b/arch/arm64/include/asm/rwonce.h > > new file mode 100644 > > index ..515

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-06 Thread Will Deacon
On Mon, Jul 06, 2020 at 05:00:23PM +0100, Dave Martin wrote: > On Thu, Jul 02, 2020 at 08:23:02AM +0100, Will Deacon wrote: > > On Wed, Jul 01, 2020 at 06:07:25PM +0100, Dave P Martin wrote: > > > Also, can you illustrate code that can only be unsafe with Clang LTO? >

Re: [PATCH 04/18] alpha: Override READ_ONCE() with barriered implementation

2020-07-02 Thread Will Deacon
Hi Joel, On Thu, Jul 02, 2020 at 10:43:55AM -0400, Joel Fernandes wrote: > On Tue, Jun 30, 2020 at 1:38 PM Will Deacon wrote: > > diff --git a/arch/alpha/include/asm/barrier.h > > b/arch/alpha/include/asm/barrier.h > > index 92ec486a4f9e..2ecd068d91d1 100644 > > -

Re: [PATCH 04/18] alpha: Override READ_ONCE() with barriered implementation

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 12:08:41PM +0200, Arnd Bergmann wrote: > On Thu, Jul 2, 2020 at 11:48 AM Will Deacon wrote: > > On Thu, Jul 02, 2020 at 10:32:39AM +0100, Mark Rutland wrote: > > > On Tue, Jun 30, 2020 at 06:37:20PM +0100, Will Deacon wrote: > > > > -#define

Re: [PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 08:47:05PM +1000, Nicholas Piggin wrote: > Excerpts from Will Deacon's message of July 2, 2020 8:35 pm: > > On Thu, Jul 02, 2020 at 08:25:43PM +1000, Nicholas Piggin wrote: > >> Excerpts from Will Deacon's message of July 2, 2020 6:02 pm: > >> > On Thu, Jul 02, 2020 at

Re: [PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 08:25:43PM +1000, Nicholas Piggin wrote: > Excerpts from Will Deacon's message of July 2, 2020 6:02 pm: > > On Thu, Jul 02, 2020 at 05:48:36PM +1000, Nicholas Piggin wrote: > >> diff --git a/arch/powerpc/include/asm/qspinlock.h > >> b/arch/powerpc/include/asm/qspinlock.h >

Re: [PATCH 04/18] alpha: Override READ_ONCE() with barriered implementation

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 10:32:39AM +0100, Mark Rutland wrote: > On Tue, Jun 30, 2020 at 06:37:20PM +0100, Will Deacon wrote: > > -#define read_barrier_depends() __asm__ __volatile__("mb": : :"memory") >

Re: [PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 05:48:36PM +1000, Nicholas Piggin wrote: > diff --git a/arch/powerpc/include/asm/qspinlock.h > b/arch/powerpc/include/asm/qspinlock.h > new file mode 100644 > index ..f84da77b6bb7 > --- /dev/null > +++ b/arch/powerpc/include/asm/qspinlock.h > @@ -0,0 +1,20 @@ >

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-02 Thread Will Deacon
On Wed, Jul 01, 2020 at 06:07:25PM +0100, Dave P Martin wrote: > On Tue, Jun 30, 2020 at 06:37:34PM +0100, Will Deacon wrote: > > When building with LTO, there is an increased risk of the compiler > > converting an address dependency headed by a READ_ONCE() invocation > > into

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-01 Thread Will Deacon
On Tue, Jun 30, 2020 at 03:57:54PM -0700, Sami Tolvanen wrote: > On Tue, Jun 30, 2020 at 12:47 PM Marco Elver wrote: > > > > On Tue, 30 Jun 2020 at 19:39, Will Deacon wrote: > > > > > > When building with LTO, there is an increased risk of the compiler >

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-01 Thread Will Deacon
On Tue, Jun 30, 2020 at 09:47:30PM +0200, Marco Elver wrote: > On Tue, 30 Jun 2020 at 19:39, Will Deacon wrote: > > > > When building with LTO, there is an increased risk of the compiler > > converting an address dependency headed by a READ_ONCE() invocation > >

Re: [PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-07-01 Thread Will Deacon
On Tue, Jun 30, 2020 at 09:25:03PM +0200, Arnd Bergmann wrote: > On Tue, Jun 30, 2020 at 7:39 PM Will Deacon wrote: > > +#define __READ_ONCE(x) \ > > +({ \ > &g

Re: [PATCH 02/18] compiler.h: Split {READ,WRITE}_ONCE definitions out into rwonce.h

2020-07-01 Thread Will Deacon
Hi Arnd, On Tue, Jun 30, 2020 at 09:11:32PM +0200, Arnd Bergmann wrote: > On Tue, Jun 30, 2020 at 7:37 PM Will Deacon wrote: > > > > In preparation for allowing architectures to define their own > > implementation of the READ_ONCE() macro, move the generic > > {READ,WR

[PATCH 14/18] arm64: Reduce the number of header files pulled into vmlinux.lds.S

2020-06-30 Thread Will Deacon
-ld:./arch/arm64/kernel/vmlinux.lds:1: syntax error In preparation for an arm64-private asm/rwonce.h implementation, which will end up pulling assembly macros into linux/compiler.h, reduce the number of headers we include directly and transitively in vmlinux.lds.S Signed-off-by: Will Deacon

[PATCH 11/18] tools/memory-model: Remove smp_read_barrier_depends() from informal doc

2020-06-30 Thread Will Deacon
smp_read_barrier_depends() has gone the way of mmiowb() and so many esoteric memory barriers before it. Drop the two mentions of this deceased barrier from the LKMM informal explanation document. Acked-by: Alan Stern Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- .../Documentation

[PATCH 09/18] Documentation/barriers: Remove references to [smp_]read_barrier_depends()

2020-06-30 Thread Will Deacon
rriers.txt' as it doesn't make any sense now that the dependency barriers have been removed. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/memory-barriers.txt | 156 +- 2 files changed, 9

[PATCH 13/18] checkpatch: Remove checks relating to [smp_]read_barrier_depends()

2020-06-30 Thread Will Deacon
The [smp_]read_barrier_depends() macros no longer exist, so we don't need to deal with them in the checkpatch script. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- scripts/checkpatch.pl | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts

[PATCH 17/18] arm64: alternatives: Remove READ_ONCE() usage during patch operation

2020-06-30 Thread Will Deacon
In preparation for patching the internals of READ_ONCE() itself, replace its usage on the alternatives patching patch with a volatile variable instead. Signed-off-by: Will Deacon --- arch/arm64/kernel/alternative.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch

[PATCH 15/18] arm64: alternatives: Split up alternative.h

2020-06-30 Thread Will Deacon
-off-by: Will Deacon --- arch/arm64/include/asm/alternative-macros.h | 276 arch/arm64/include/asm/alternative.h| 267 +-- arch/arm64/include/asm/insn.h | 3 +- 3 files changed, 279 insertions(+), 267 deletions(-) create mode 100644 arch

[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y

2020-06-30 Thread Will Deacon
READ_ONCE() definition with one that provides acquire semantics when building with LTO. Signed-off-by: Will Deacon --- arch/arm64/include/asm/rwonce.h | 63 +++ arch/arm64/kernel/vdso/Makefile | 2 +- arch/arm64/kernel/vdso32/Makefile | 2 +- 3 files changed, 65

[PATCH 16/18] arm64: cpufeatures: Add capability for LDAPR instruction

2020-06-30 Thread Will Deacon
the compiler is capable of breaking the dependencies. Since LDAPR is not available on all CPUs, add a cpufeature to detect it at runtime and allow the instruction to be used with alternative code patching. Signed-off-by: Will Deacon --- arch/arm64/Kconfig | 3 +++ arch/arm64/include/asm

[PATCH 06/18] vhost: Remove redundant use of read_barrier_depends() barrier

2020-06-30 Thread Will Deacon
to | indirect->addr after avail idx is increased Remove the redundant barrier invocation. Suggested-by: Jason Wang Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- drivers/vhost/vhost.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/v

[PATCH 12/18] include/linux: Remove smp_read_barrier_depends() from comments

2020-06-30 Thread Will Deacon
smp_read_barrier_depends() doesn't exist any more, so reword the two comments that mention it to refer to "dependency ordering" instead. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/linux/percpu-refcount.h | 2 +- include/linux/ptr_ring.h| 2 +- 2 files

[PATCH 10/18] Documentation/barriers/kokr: Remove references to [smp_]read_barrier_depends()

2020-06-30 Thread Will Deacon
From: SeongJae Park This commit translates commit ("Documentation/barriers: Remove references to [smp_]read_barrier_depends()") into Korean. Signed-off-by: SeongJae Park Reviewed-by: Yunjae Lee Signed-off-by: Will Deacon --- .../translations/ko_KR/memory-barriers.tx

[PATCH 07/18] alpha: Replace smp_read_barrier_depends() usage with smp_[r]mb()

2020-06-30 Thread Will Deacon
In preparation for removing smp_read_barrier_depends() altogether, move the Alpha code over to using smp_rmb() and smp_mb() directly. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- arch/alpha/include/asm/atomic.h | 16 arch/alpha/include/asm/pgtable.h | 10

[PATCH 08/18] locking/barriers: Remove definitions for [smp_]read_barrier_depends()

2020-06-30 Thread Will Deacon
There are no remaining users of [smp_]read_barrier_depends(), so remove it from the generic implementation of 'barrier.h'. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/barrier.h | 17 - 1 file changed, 17 deletions(-) diff --git a/include/asm

[PATCH 05/18] asm/rwonce: Remove smp_read_barrier_depends() invocation

2020-06-30 Thread Will Deacon
Alpha overrides __READ_ONCE() directly, so there's no need to use smp_read_barrier_depends() in the core code. This also means that __READ_ONCE() can be relied upon to provide dependency ordering. Acked-by: Paul E. McKenney Signed-off-by: Will Deacon --- include/asm-generic/rwonce.h | 19

[PATCH 00/18] Allow architectures to override __READ_ONCE()

2020-06-30 Thread Will Deacon
l...@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Cc: kernel-t...@android.com --->8 SeongJae Park (1): Documentation/barriers/kokr: Remove references to [smp_]read_barrier_depends() Will Deacon (17): tools: bpf: Use local copy of headers including uapi/linux/filter.h com

[PATCH 02/18] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h

2020-06-30 Thread Will Deacon
-by: Will Deacon --- include/asm-generic/Kbuild | 1 + include/asm-generic/rwonce.h | 91 include/linux/compiler.h | 83 +--- 3 files changed, 94 insertions(+), 81 deletions(-) create mode 100644 include/asm-generic/rwonce.h diff

  1   2   >