Re: [RFC PATCH] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-18 Thread Segher Boessenkool
Hi Christophe, On Sat, Aug 17, 2019 at 06:37:50PM +, Christophe Leroy wrote: > #define BUG() do { \ > + __builtin_trap(); \ GCC will optimise away all code after this, it knows it is unreachable. But you

Re: [PATCH] powerpc: optimise WARN_ON()

2019-08-18 Thread Segher Boessenkool
On Sat, Aug 17, 2019 at 09:04:42AM +, Christophe Leroy wrote: > Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger > of the t(d/w)nei instruction instead of using directly the > value of x. > > This leads to GCC adding unnecessary pair of addic/subfe. And it has to, it is passed as an

[PATCH] powerpc: Don't add -mabi= flags when building with Clang

2019-08-18 Thread Nathan Chancellor
When building pseries_defconfig, building vdso32 errors out: error: unknown target ABI 'elfv1' Commit 4dc831aa8813 ("powerpc: Fix compiling a BE kernel with a powerpc64le toolchain") added these flags to fix building GCC but clang is multitargeted and does not need these flags. The ABI is

Re: [PATCH 2/3] powerpc/64s/radix: all CPUs should flush local translation structure before turning MMU on

2019-08-18 Thread Michael Ellerman
Nicholas Piggin writes: > Rather than sprinkle various translation structure invalidations > around different places in early boot, have each CPU flush everything > from its local translation structures before enabling its MMU. > > Radix guests can execute tlbie(l), so have them tlbiel_all in the

Re: [PATCH v4 1/3] kasan: support backing vmalloc space with real shadow memory

2019-08-18 Thread Daniel Axtens
>> > Instead, share backing space across multiple mappings. Allocate >> > a backing page the first time a mapping in vmalloc space uses a >> > particular page of the shadow region. Keep this page around >> > regardless of whether the mapping is later freed - in the mean time >> > the page could

[PATCH kernel] KVM: PPC: vfio/spapr_tce: Split out TCE invalidation from TCE updates

2019-08-18 Thread Alexey Kardashevskiy
The VFIO IOMMU implementation on SPAPR uses iommu_table::exchange() hook to update hardware TCE tables (a table where an index is a IOBA>>pageshift and the value is a host physical address). Each TCE update requires TCE cache invalidation, both at the PHB and NPU levels. The invalidation interface

[PATCH kernel] vfio/spapr_tce: Fix incorrect tce_iommu_group memory free

2019-08-18 Thread Alexey Kardashevskiy
The @tcegrp variable is used in 1) a loop over attached groups 2) it stores a pointer to a newly allocated tce_iommu_group if 1) found nothing. However the error handler does not distinguish how we got there and incorrectly releases memory for a found+incompatible group. This fixes it by adding

Re: [PATCH 0/6] drm+dma: cache support for arm, etc

2019-08-18 Thread Christoph Hellwig
On Fri, Aug 16, 2019 at 02:04:35PM -0700, Rob Clark wrote: > I don't disagree about needing an API to get uncached memory (or > ideally just something outside of the linear map). But I think this > is a separate problem. > > What I was hoping for, for v5.4, is a way to stop abusing dma_map/sync

Re: [PATCH] powerpc: optimise WARN_ON()

2019-08-18 Thread Christophe Leroy
Le 18/08/2019 à 14:01, Segher Boessenkool a écrit : On Sat, Aug 17, 2019 at 09:04:42AM +, Christophe Leroy wrote: Unlike BUG_ON(x), WARN_ON(x) uses !!(x) as the trigger of the t(d/w)nei instruction instead of using directly the value of x. This leads to GCC adding unnecessary pair of

Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition

2019-08-18 Thread Masahiro Yamada
Hi, On Fri, Jul 19, 2019 at 12:43 PM Michael Ellerman wrote: > > Segher Boessenkool writes: > > On Thu, Jul 18, 2019 at 11:19:58AM +0900, Masahiro Yamada wrote: > >> On Thu, Jul 18, 2019 at 1:46 AM Segher Boessenkool > >> wrote: > >> Kbuild always uses thin archives as far as vmlinux is