Re: [PATCH kernel v4 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread David Gibson
On Fri, Jul 06, 2018 at 04:00:30PM +1000, Michael Ellerman wrote: > Alexey Kardashevskiy writes: > > > diff --git a/arch/powerpc/mm/mmu_context_iommu.c > > b/arch/powerpc/mm/mmu_context_iommu.c > > index abb4364..11e1029 100644 > > --- a/arch/powerpc/mm/mmu_context_iommu.c > > +++ b/arch/powerpc

Re: [PATCH kernel v4 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread Michael Ellerman
Alexey Kardashevskiy writes: > diff --git a/arch/powerpc/mm/mmu_context_iommu.c > b/arch/powerpc/mm/mmu_context_iommu.c > index abb4364..11e1029 100644 > --- a/arch/powerpc/mm/mmu_context_iommu.c > +++ b/arch/powerpc/mm/mmu_context_iommu.c > @@ -159,6 +161,7 @@ long mm_iommu_get(struct mm_struct

Re: [PATCH kernel v4 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread David Gibson
On Thu, Jul 05, 2018 at 06:01:33PM +1000, Alexey Kardashevskiy wrote: > A VM which has: > - a DMA capable device passed through to it (eg. network card); > - running a malicious kernel that ignores H_PUT_TCE failure; > - capability of using IOMMU pages bigger that physical pages > can create an

Re: [PATCH kernel v3 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread David Gibson
On Thu, Jul 05, 2018 at 03:19:04PM +1000, Alexey Kardashevskiy wrote: > On Thu, 5 Jul 2018 12:42:20 +1000 > David Gibson wrote: > > > On Wed, Jul 04, 2018 at 03:00:52PM +1000, Alexey Kardashevskiy wrote: > > > A VM which has: > > > - a DMA capable device passed through to it (eg. network card);

Re: [PATCHv3 2/4] drivers/base: utilize device tree info to shutdown devices

2018-07-05 Thread Pingfan Liu
On Thu, Jul 5, 2018 at 6:13 PM Rafael J. Wysocki wrote: > > On Tuesday, July 3, 2018 8:50:40 AM CEST Pingfan Liu wrote: > > commit 52cdbdd49853 ("driver core: correct device's shutdown order") > > places an assumption of supplier<-consumer order on the process of probe. > > But it turns out to bre

[PATCHv6 4/4] arm64: Add build salt to the vDSO

2018-07-05 Thread Laura Abbott
The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Acked-by: Will Deacon Signed-off-by: Laura Abbott --- v6: Remove the semi-colon, Ack from Will --- arch/arm64/kernel/vdso/note.S | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCHv6 3/4] powerpc: Add build salt to the vDSO

2018-07-05 Thread Laura Abbott
The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Signed-off-by: Laura Abbott --- v6: Remove semi-colon --- arch/powerpc/kernel/vdso32/note.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/vdso32/note.S

[PATCHv6 2/4] x86: Add build salt to the vDSO

2018-07-05 Thread Laura Abbott
The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Acked-by: Andy Lutomirski Signed-off-by: Laura Abbott --- v6: Ack from Andy --- arch/x86/entry/vdso/vdso-note.S | 3 +++ arch/x86/entry/vdso/vdso32/note.S | 3 +++ 2 files chang

[PATCHv6 1/4] kbuild: Add build salt to the kernel and modules

2018-07-05 Thread Laura Abbott
In Fedora, the debug information is packaged separately (foo-debuginfo) and can be installed separately. There's been a long standing issue where only one version of a debuginfo info package can be installed at a time. There's been an effort for Fedora for parallel debuginfo to rectify this probl

[PATCHv6 0/4] Salted build ids via ELF notes

2018-07-05 Thread Laura Abbott
Hi, This is v6 of the series to allow unique build ids. v6 is mostly minor fixups and Acks for this to go through the kbuild tree. Thanks, Laura Laura Abbott (4): kbuild: Add build salt to the kernel and modules x86: Add build salt to the vDSO powerpc: Add build salt to the vDSO arm64: A

Re: [PATCHv5 2/4] x86: Add build salt to the vDSO

2018-07-05 Thread Andy Lutomirski
Sure. On Thu, Jul 5, 2018 at 12:08 PM, Laura Abbott wrote: > On 07/05/2018 08:58 AM, Andy Lutomirski wrote: >> >> On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott wrote: >>> >>> >>> The vDSO needs to have a unique build id in a similar manner >>> to the kernel and modules. Use the build salt macro.

powerpc: 32BIT vs. 64BIT (PPC32 vs. PPC64)

2018-07-05 Thread Randy Dunlap
Hi, Is there a good way (or a shortcut) to do something like: $ make ARCH=powerpc O=PPC32 [other_options] allmodconfig to get a PPC32/32BIT allmodconfig and also be able to do: $make ARCH=powerpc O=PPC64 [other_options] allmodconfig to get a PPC64/64BIT allmodconfig? Note that arch/x86, a

Re: [RFC PATCH 2/2] dma-mapping: Clean up dma_get_required_mask() hooks

2018-07-05 Thread Christoph Hellwig
On Wed, Jul 04, 2018 at 06:50:12PM +0100, Robin Murphy wrote: > As for the other mask-related hooks, standardise the arch override into > a Kconfig option, and also pull the generic implementation into the DMA > mapping code rather than having it hide away in the platform bus code. Heh, I have a s

Re: [RFC PATCH 1/2] dma-mapping: Clean up dma_set_*mask() hooks

2018-07-05 Thread Christoph Hellwig
On Wed, Jul 04, 2018 at 06:50:11PM +0100, Robin Murphy wrote: > Arch-specific implementions for dma_set_{coherent_,}mask() currently > rely on an inconsistent mix of arch-defined Kconfig symbols and macro > overrides. Now that we have a nice centralised home for DMA API gubbins, > let's consolidate

Re: [PATCHv5 1/4] kbuild: Add build salt to the kernel and modules

2018-07-05 Thread Laura Abbott
On 07/03/2018 08:59 PM, Masahiro Yamada wrote: Hi. Thanks for the update. 2018-07-04 8:34 GMT+09:00 Laura Abbott : The build id generated from --build-id can be generated in several different ways, with the default being the sha1 on the output of the linked file. For distributions, it can be

Re: [PATCHv5 2/4] x86: Add build salt to the vDSO

2018-07-05 Thread Laura Abbott
On 07/05/2018 08:58 AM, Andy Lutomirski wrote: On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott wrote: The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Looks good to me. I have no idea whose tree these would go through. I was

Re: [PATCHv5 4/4] arm64: Add build salt to the vDSO

2018-07-05 Thread Laura Abbott
On 07/03/2018 08:55 PM, Masahiro Yamada wrote: Hi. 2018-07-04 8:34 GMT+09:00 Laura Abbott : The vDSO needs to have a unique build id in a similar manner to the kernel and modules. Use the build salt macro. Signed-off-by: Laura Abbott --- v5: I was previously focused on x86 only but since pow

Re: [PATCH v3 2/3] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups

2018-07-05 Thread Shilpasri G Bhat
Hi, On 07/05/2018 09:07 PM, Guenter Roeck wrote: > On 07/05/2018 06:51 AM, Shilpasri G Bhat wrote: >> On-Chip-Controller(OCC) is an embedded micro-processor in POWER9 chip >> which measures various system and chip level sensors. These sensors >> comprises of environmental sensors (like power, temp

Re: [PATCH V2 00/10] KASan ppc64 support

2018-07-05 Thread Christophe LEROY
Hi Aneesh, Are you still working on support for KASan for ppc64 ? Thanks, Christophe Le 26/08/2015 à 19:14, Aneesh Kumar K.V a écrit : Andrey Ryabinin writes: 2015-08-26 11:26 GMT+03:00 Aneesh Kumar K.V : Hi, This patchset implements kernel address sanitizer for ppc64. Since ppc64 virtua

Re: [RFC PATCH v1] powerpc/radix/kasan: KASAN support for Radix

2018-07-05 Thread Christophe LEROY
Hello Balbir, Are you still working on KASAN support ? Thanks, Christophe Le 08/08/2017 à 03:18, Balbir Singh a écrit : On Mon, Aug 7, 2017 at 10:30 PM, Andrey Ryabinin wrote: On 07/29/2017 05:09 PM, Balbir Singh wrote: This is the first attempt to implement KASAN for radix on powerpc64. An

[PATCH v3 16/16] powerpc: split asm/tlbflush.h

2018-07-05 Thread Christophe Leroy
Split asm/tlbflush.h into: asm/nohash/tlbflush.h asm/book3s/32/tlbflush.h asm/book3s/64/tlbflush.h (already existing) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/tlbflush.h| 25 +++ arch/powerpc/include/asm/book3s/tlbflush.h | 11 +++ arch/powerpc/include

[PATCH v3 15/16] powerpc: remove unnecessary inclusion of asm/tlbflush.h

2018-07-05 Thread Christophe Leroy
asm/tlbflush.h is only needed for: - using functions xxx_flush_tlb_xxx() - using MMU_NO_CONTEXT - including asm-generic/pgtable.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/highmem.h| 2 +- arch/powerpc/include/asm/tlb.h| 1 - arch/powerpc/kvm/book3s.c |

[PATCH v3 14/16] powerpc: Split synch.h in two parts

2018-07-05 Thread Christophe Leroy
move feature-fixups related stuff from synch.h to synch-ftr.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/atomic.h | 1 + arch/powerpc/include/asm/barrier.h| 1 + arch/powerpc/include/asm/bitops.h | 1 + arch/powerpc/include/asm

[PATCH v3 13/16] powerpc: split reg.h in two parts

2018-07-05 Thread Christophe Leroy
Move all macros involving feature-fixups in a new file reg-ftr.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/exception-64s.h | 1 + arch/powerpc/include/asm/reg-ftr.h | 71 arch/powerpc/include/asm/reg.h | 42 ---

[PATCH v3 12/16] powerpc/44x: remove page.h from mmu-44x.h

2018-07-05 Thread Christophe Leroy
mmu-44x.h doesn't need asm/page.h if PAGE_SHIFT are replaced by CONFIG_PPC_XX_PAGES Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu-44x.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/

[PATCH v3 11/16] powerpc/nohash: fix hash related comments in pgtable.h

2018-07-05 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 4 arch/powerpc/include/asm/nohash/64/pgtable.h | 18 -- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/as

[PATCH v3 10/16] powerpc: fix includes in asm/processor.h

2018-07-05 Thread Christophe Leroy
Remove superflous includes and add missing ones Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hw_breakpoint.h | 1 + arch/powerpc/include/asm/processor.h | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/

[PATCH v3 09/16] powerpc/book3s: Remove PPC_PIN_SIZE

2018-07-05 Thread Christophe Leroy
PPC_PIN_SIZE is specific to the 44x and is defined in mmu.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 5 - arch/powerpc/include/asm/nohash/32/pgtable.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/book

[PATCH v3 08/16] powerpc: declare set_breakpoint() static

2018-07-05 Thread Christophe Leroy
set_breakpoint() is only used in process.c so make it static Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/debug.h | 1 - arch/powerpc/kernel/process.c| 14 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/debug.h b/arch/p

[PATCH v3 07/16] powerpc: remove superflous inclusions of asm/fixmap.h

2018-07-05 Thread Christophe Leroy
Files not using fixmap consts or functions don't need asm/fixmap.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/fixmap.h| 2 -- arch/powerpc/kernel/head_8xx.S | 1 - arch/powerpc/mm/dump_hashpagetable.c | 1 - arch/powerpc/sysdev/cpm_common.c | 1 - 4 files changed,

[PATCH v3 06/16] powerpc: clean inclusions of asm/feature-fixups.h

2018-07-05 Thread Christophe Leroy
files not using feature fixup don't need asm/feature-fixups.h files using feature fixup need asm/feature-fixups.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cputable.h| 1 - arch/powerpc/include/asm/dbell.h | 1 + arch/powerpc/include/asm/dt_cpu_ftrs.h

[PATCH v3 05/16] powerpc: clean the inclusion of stringify.h

2018-07-05 Thread Christophe Leroy
Only include linux/stringify.h is files using __stringify() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/dcr-native.h| 1 + arch/powerpc/include/asm/ppc-opcode.h| 1 - arch/powerpc/include/asm/reg_fsl_emb.h | 2 ++ arch/powerpc/include/asm/synch.h

[PATCH v3 04/16] powerpc: move ASM_CONST and stringify_in_c() into asm-const.h

2018-07-05 Thread Christophe Leroy
This patch moves ASM_CONST() and stringify_in_c() into dedicated asm-const.h, then cleans all related inclusions. Signed-off-by: Christophe Leroy --- arch/powerpc/crypto/md5-asm.S | 1 + arch/powerpc/crypto/sha1-powerpc-asm.S | 1 + arch/powerpc/include/asm/asm-compat.

[PATCH v3 03/16] powerpc/405: move PPC405_ERR77 in asm-405.h

2018-07-05 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/asm-405.h | 19 +++ arch/powerpc/include/asm/asm-compat.h| 13 - arch/powerpc/include/asm/atomic.h| 1 + arch/powerpc/include/asm/bitops.h| 1 + arch/powerpc/includ

[PATCH v3 02/16] powerpc: remove unneeded inclusions of cpu_has_feature.h

2018-07-05 Thread Christophe Leroy
Files not using cpu_has_feature() don't need cpu_has_feature.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cacheflush.h | 1 - arch/powerpc/include/asm/cputime.h| 1 - arch/powerpc/include/asm/dbell.h | 1 - arch/powerpc/kernel/vdso.c| 1 - 4 files changed,

[PATCH v3 01/16] powerpc: remove kdump.h from page.h

2018-07-05 Thread Christophe Leroy
page.h doesn't need kdump.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/page.h | 1 - arch/powerpc/kernel/crash.c | 1 - arch/powerpc/kernel/machine_kexec.c | 1 + arch/powerpc/kernel/setup_32.c | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v3 00/16] Remove unneccessary included headers

2018-07-05 Thread Christophe Leroy
The purpose of this serie is to limit the number of includes to only the necessary ones in order to reduce the number of files recompiled everytime a header file is modified. Compilation test: see http://kisskb.ellerman.id.au/kisskb/head/14261/ Among the 4 failures, one is compiler bug that I don'

Re: [PATCHv5 2/4] x86: Add build salt to the vDSO

2018-07-05 Thread Andy Lutomirski
On Tue, Jul 3, 2018 at 4:34 PM, Laura Abbott wrote: > > The vDSO needs to have a unique build id in a similar manner > to the kernel and modules. Use the build salt macro. > Looks good to me. I have no idea whose tree these would go through. > Signed-off-by: Laura Abbott > --- > v5: Switched t

RE: [PATCH] powerpc/mpic: Cleanup irq vector accounting

2018-07-05 Thread Bharat Bhushan
> -Original Message- > From: Michael Ellerman [mailto:m...@ellerman.id.au] > Sent: Wednesday, July 4, 2018 6:57 PM > To: Bharat Bhushan ; > b...@kernel.crashing.org; pau...@samba.org; r...@kernel.org; > ge...@infradead.org; tyr...@linux.vnet.ibm.com; linuxppc- > d...@lists.ozlabs.org; li

Re: [PATCH v3 2/3] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups

2018-07-05 Thread Guenter Roeck
On 07/05/2018 06:51 AM, Shilpasri G Bhat wrote: On-Chip-Controller(OCC) is an embedded micro-processor in POWER9 chip which measures various system and chip level sensors. These sensors comprises of environmental sensors (like power, temperature, current and voltage) and performance sensors (like

Re: [PATCH v3 3/3] hwmon: Document the sensor enable attribute and update ibmpowernv

2018-07-05 Thread Guenter Roeck
On 07/05/2018 06:51 AM, Shilpasri G Bhat wrote: Signed-off-by: Shilpasri G Bhat --- Documentation/hwmon/ibmpowernv | 35 +++- Documentation/hwmon/sysfs-interface | 82 + I guess I wasn't specific enough. The sysfs ABI change must be a sepa

[PATCH v3 3/3] hwmon: Document the sensor enable attribute and update ibmpowernv

2018-07-05 Thread Shilpasri G Bhat
Signed-off-by: Shilpasri G Bhat --- Documentation/hwmon/ibmpowernv | 35 +++- Documentation/hwmon/sysfs-interface | 82 + 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/Documentation/hwmon/ibmpowernv b/Documentation/hwmon/ibmp

[PATCH v3 2/3] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups

2018-07-05 Thread Shilpasri G Bhat
On-Chip-Controller(OCC) is an embedded micro-processor in POWER9 chip which measures various system and chip level sensors. These sensors comprises of environmental sensors (like power, temperature, current and voltage) and performance sensors (like utilization, frequency). All these sensors are co

[PATCH v3 1/3] powernv:opal-sensor-groups: Add support to enable sensor groups

2018-07-05 Thread Shilpasri G Bhat
Adds support to enable/disable a sensor group at runtime. This can be used to select the sensor groups that needs to be copied to main memory by OCC. Sensor groups like power, temperature, current, voltage, frequency, utilization can be enabled/disabled at runtime. Signed-off-by: Shilpasri G Bhat

[PATCH v3 0/3] hwmon: Add attributes to enable/disable sensors

2018-07-05 Thread Shilpasri G Bhat
This patch series adds new attribute to enable or disable a sensor in runtime. v2 : https://lkml.org/lkml/2018/7/4/263 v1 : https://lkml.org/lkml/2018/3/22/214 Shilpasri G Bhat (3): powernv:opal-sensor-groups: Add support to enable sensor groups hwmon: ibmpowernv: Add attributes to enable/dis

Re: [PATCH v2 3/3] powerpc/fsl: Implement cpu_show_spectre_v1/v2 for NXP PowerPC Book3E

2018-07-05 Thread Diana Madalina Craciun
On 07/03/2018 10:26 AM, Michael Ellerman wrote: > Michal Suchánek writes: >> On Tue, 12 Jun 2018 02:59:11 + >> Bharat Bhushan wrote: >> >>> Hi Diana, >>> -Original Message- From: Diana Craciun [mailto:diana.crac...@nxp.com] Sent: Monday, June 11, 2018 6:23 PM To: l

Re: [PATCH v2 2/3] powerpc/fsl: Add barrier_nospec implementation for NXP PowerPC Book3E

2018-07-05 Thread Diana Madalina Craciun
Hi Michael, Thank you for the review. On 07/03/2018 10:26 AM, Michael Ellerman wrote: > Hi Diana, > > A few comments below ... > > Diana Craciun writes: >> Implement the barrier_nospec as a isync;sync instruction sequence. >> The implementation uses the infrastructure built for BOOK3S 64. > Do y

Re: [PATCH 15/26] ppc: Convert vas ID allocation to new IDA API

2018-07-05 Thread Matthew Wilcox
On Thu, Jun 21, 2018 at 02:28:24PM -0700, Matthew Wilcox wrote: > Removes a custom spinlock and simplifies the code. I took a closer look at this patch as part of fixing the typo *ahem*. The original code is buggy at the limit: - if (winid > VAS_WINDOWS_PER_CHIP) { - pr_err("

[PATCH v4 2/2] powernv/cpuidle: Use parsed device tree values for cpuidle_init

2018-07-05 Thread Akshay Adiga
Export pnv_idle_states and nr_pnv_idle_states so that its accessible to cpuidle driver. Use properties from pnv_idle_states structure for powernv cpuidle_init. Signed-off-by: Akshay Adiga Reviewed-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy --- arch/powerpc/include/asm/cpuidle.h | 2 +

[PATCH v4 1/2] powernv/cpuidle: Parse dt idle properties into global structure

2018-07-05 Thread Akshay Adiga
Device-tree parsing happens twice, once while deciding idle state to be used for hotplug and once during cpuidle init. Hence, parsing the device tree and caching it will reduce code duplication. Parsing code has been moved to pnv_parse_cpuidle_dt() from pnv_probe_idle_states(). In addition to the p

[PATCH v4 0/2] powernv/cpuidle Device-tree parsing cleanup

2018-07-05 Thread Akshay Adiga
Device-tree parsed multiple time in powernv cpuidle and powernv hotplug code. First to identify supported flags. Second time, to identify deepest_state and first deep state. Third time, during cpuidle init to find the available idle states. Any change in device-tree format will lead to make change

[PATCH v4 11/11] hugetlb: Introduce generic version of huge_ptep_get

2018-07-05 Thread Alexandre Ghiti
ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the same version of huge_ptep_get, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb-3level.h | 1 + arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/

[PATCH v4 10/11] hugetlb: Introduce generic version of huge_ptep_set_access_flags

2018-07-05 Thread Alexandre Ghiti
arm, ia64, sh, x86 architectures use the same version of huge_ptep_set_access_flags, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb-3level.h | 7 --- arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/includ

[PATCH v4 09/11] hugetlb: Introduce generic version of huge_ptep_set_wrprotect

2018-07-05 Thread Alexandre Ghiti
arm, ia64, mips, sh, x86 architectures use the same version of huge_ptep_set_wrprotect, so move this generic implementation into asm-generic/hugetlb.h. Note: powerpc uses twice for book3s/32 and nohash/32 the same version as the above architectures, but the modification was not straightforward and

[PATCH v4 08/11] hugetlb: Introduce generic version of prepare_hugepage_range

2018-07-05 Thread Alexandre Ghiti
arm, arm64, powerpc, sparc, x86 architectures use the same version of prepare_hugepage_range, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb.h | 11 --- arch/arm64/include/asm/hugetlb.h | 11 --

[PATCH v4 07/11] hugetlb: Introduce generic version of huge_pte_wrprotect

2018-07-05 Thread Alexandre Ghiti
arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the same version of huge_pte_wrprotect, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb.h | 5 - arch/arm64/include/asm/hugetlb.h |

[PATCH v4 06/11] hugetlb: Introduce generic version of huge_pte_none

2018-07-05 Thread Alexandre Ghiti
arm, arm64, ia64, parisc, powerpc, sh, sparc, x86 architectures use the same version of huge_pte_none, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb.h | 5 - arch/arm64/include/asm/hugetlb.h | 5 - ar

[PATCH v4 03/11] hugetlb: Introduce generic version of set_huge_pte_at

2018-07-05 Thread Alexandre Ghiti
arm, ia64, mips, powerpc, sh, x86 architectures use the same version of set_huge_pte_at, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb-3level.h | 6 -- arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/inc

[PATCH v4 05/11] hugetlb: Introduce generic version of huge_ptep_clear_flush

2018-07-05 Thread Alexandre Ghiti
arm, x86 architectures use the same version of huge_ptep_clear_flush, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb-3level.h | 6 -- arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/asm/hugetlb.h

[PATCH v4 04/11] hugetlb: Introduce generic version of huge_ptep_get_and_clear

2018-07-05 Thread Alexandre Ghiti
arm, ia64, sh, x86 architectures use the same version of huge_ptep_get_and_clear, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb-3level.h | 6 -- arch/arm64/include/asm/hugetlb.h | 1 + arch/ia64/include/as

[PATCH v4 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range

2018-07-05 Thread Alexandre Ghiti
arm, arm64, mips, parisc, sh, x86 architectures use the same version of hugetlb_free_pgd_range, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti --- arch/arm/include/asm/hugetlb.h | 12 ++-- arch/arm64/include/asm/hugetlb.h | 10 ---

[PATCH v4 01/11] hugetlb: Harmonize hugetlb.h arch specific defines with pgtable.h

2018-07-05 Thread Alexandre Ghiti
asm-generic/hugetlb.h proposes generic implementations of hugetlb related functions: use __HAVE_ARCH_HUGE* defines in order to make arch specific implementations of hugetlb functions consistent with pgtable.h scheme. Signed-off-by: Alexandre Ghiti --- arch/arm64/include/asm/hugetlb.h | 2 +- inc

[PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives

2018-07-05 Thread Alexandre Ghiti
In order to reduce copy/paste of functions across architectures and then make riscv hugetlb port (and future ports) simpler and smaller, this patchset intends to factorize the numerous hugetlb primitives that are defined across all the architectures. Except for prepare_hugepage_range, this patchse

Re: [PATCH v3 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range

2018-07-05 Thread Alex Ghiti
My bad, when I moved the #include at the bottom of the file, I did not pay attention to that #ifdef. I'm going to fix powerpc and check other architectures if I did not make the same mistake. I'll send a v4 as soon as possible. Thanks for your comment, Alex On 07/05/2018 10:22 AM, Christophe

Re: [PATCH v3 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range

2018-07-05 Thread Christophe Leroy
On 07/05/2018 05:16 AM, Alexandre Ghiti wrote: arm, arm64, mips, parisc, sh, x86 architectures use the same version of hugetlb_free_pgd_range, so move this generic implementation into asm-generic/hugetlb.h. Signed-off-by: Alexandre Ghiti Build failure on mpc885_ads_defconfig CC arc

Re: [PATCHv3 2/4] drivers/base: utilize device tree info to shutdown devices

2018-07-05 Thread Rafael J. Wysocki
On Tuesday, July 3, 2018 8:50:40 AM CEST Pingfan Liu wrote: > commit 52cdbdd49853 ("driver core: correct device's shutdown order") > places an assumption of supplier<-consumer order on the process of probe. > But it turns out to break down the parent <- child order in some scene. > E.g in pci, a br

Re: [PATCH v6 1/4] resource: Move reparent_resources() to kernel/resource.c and make it public

2018-07-05 Thread Baoquan He
On 07/04/18 at 07:46pm, Andy Shevchenko wrote: > On Wed, Jul 4, 2018 at 7:10 AM, Baoquan He wrote: > > reparent_resources() is duplicated in arch/microblaze/pci/pci-common.c > > and arch/powerpc/kernel/pci-common.c, so move it to kernel/resource.c > > so that it's shared. > > With couple of comme

Applied "ASoC: fsl_spdif: Use 64-bit arithmetic instead of 32-bit" to the asoc tree

2018-07-05 Thread Mark Brown
The patch ASoC: fsl_spdif: Use 64-bit arithmetic instead of 32-bit has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours)

Re: [PATCH v3 08/11] hugetlb: Introduce generic version of prepare_hugepage_range

2018-07-05 Thread kbuild test robot
/0day-ci/linux/commits/Alexandre-Ghiti/hugetlb-Factorize-hugetlb-architecture-primitives/20180705-135909 config: powerpc-mpc8540_ads_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master

Re: [PATCHv3 0/4] drivers/base: bugfix for supplier<-consumer ordering in device_kset

2018-07-05 Thread Rafael J. Wysocki
On Thu, Jul 5, 2018 at 4:44 AM, Pingfan Liu wrote: > On Wed, Jul 4, 2018 at 6:23 PM Rafael J. Wysocki wrote: >> >> On Wednesday, July 4, 2018 4:47:07 AM CEST Pingfan Liu wrote: >> > On Tue, Jul 3, 2018 at 10:36 PM Rafael J. Wysocki >> > wrote: >> > > >> > > On Tuesday, July 3, 2018 8:50:38 AM C

[RFC PATCH 3/3] powerpc/lib: Optimised strlen() for POWER6+

2018-07-05 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- Untested arch/powerpc/lib/strlen_64.S | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/lib/strlen_64.S b/arch/powerpc/lib/strlen_64.S index c9704f2b697d..3f756902653c 100644 --- a/arch/power

[RFC PATCH 1/3] powerpc/lib: implement strlen() in assembly for PPC64

2018-07-05 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. strlen() selftest on an provides the following values: Before the patch (ie with the

[RFC PATCH 2/3] selftests/powerpc: update strlen() test to test the new assembly function for PPC64

2018-07-05 Thread Christophe Leroy
This patch adds a test for testing the new assembly strlen() for PPC64 Signed-off-by: Christophe Leroy --- Untested tools/testing/selftests/powerpc/stringloops/Makefile | 5 - tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h | 12 tools/testing/selftests/powerpc

[PATCH] powerpc/64s: remove POWER9 DD1 support

2018-07-05 Thread Nicholas Piggin
POWER9 DD1 was never a product. It is no longer supported by upstream firmware, and it is not effectively supported in Linux due to lack of testing. Signed-off-by: Nicholas Piggin --- Since RFC: - Change xive comments to explain why the DD1 cases are being kept, from Ben. arch/powerpc/includ

Re: [PATCH v3 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range

2018-07-05 Thread kbuild test robot
/linux/commits/Alexandre-Ghiti/hugetlb-Factorize-hugetlb-architecture-primitives/20180705-135909 config: powerpc-mpc8540_ads_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin

[PATCH v7 4/4] selftests/powerpc: update strlen() test to test the new assembly function for PPC32

2018-07-05 Thread Christophe Leroy
This patch adds a test for testing the new assembly strlen() for PPC32 Signed-off-by: Christophe Leroy --- v7: reduced the scope to PPC32 v6: added additional necessary defines in ppc_asm.h v5: no change v4: new tools/testing/selftests/powerpc/stringloops/Makefile | 5 - tools/tes

[PATCH v7 3/4] powerpc/lib: implement strlen() in assembly for PPC32

2018-07-05 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. On a 8xx the time spent in strlen is reduced by 3/4 for long strings. strlen() selftest on an

[PATCH v7 2/4] selftests/powerpc: Add test for strlen()

2018-07-05 Thread Christophe Leroy
This patch adds a test for strlen() string.c contains a copy of strlen() from lib/string.c The test first tests the correctness of strlen() by comparing the result with libc strlen(). It tests all cases of alignment. It them tests the duration of an aligned strlen() on a 4 bytes string, on a 16

[PATCH v7 1/4] selftests/powerpc: add test for 32 bits memcmp

2018-07-05 Thread Christophe Leroy
This patch renames memcmp test to memcmp_64 and adds a memcmp_32 test for testing the 32 bits version of memcmp() Signed-off-by: Christophe Leroy --- v7: no change v6: no change v5: no change v4: new tools/testing/selftests/powerpc/stringloops/Makefile| 14 +++--- tools/testing/

Re: [PATCH kernel v3 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread Alexey Kardashevskiy
On Thu, 5 Jul 2018 15:19:04 +1000 Alexey Kardashevskiy wrote: > On Thu, 5 Jul 2018 12:42:20 +1000 > David Gibson wrote: > > > On Wed, Jul 04, 2018 at 03:00:52PM +1000, Alexey Kardashevskiy wrote: > > > A VM which has: > > > - a DMA capable device passed through to it (eg. network card); > >

[PATCH kernel v4 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread Alexey Kardashevskiy
A VM which has: - a DMA capable device passed through to it (eg. network card); - running a malicious kernel that ignores H_PUT_TCE failure; - capability of using IOMMU pages bigger that physical pages can create an IOMMU mapping that exposes (for example) 16MB of the host physical memory to the

[PATCH kernel v4 0/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-05 Thread Alexey Kardashevskiy
This is to improve page boundaries checking and should probably be cc:stable. I came accross this while debugging nvlink2 passthrough but the lack of checking might be exploited by the existing userspace. Changes: v4: * 2/2: implemented less strict but still safe max pageshift as David suggested

[PATCH kernel v4 1/2] vfio/spapr: Use IOMMU pageshift rather than pagesize

2018-07-05 Thread Alexey Kardashevskiy
The size is always equal to 1 page so let's use this. Later on this will be used for other checks which use page shifts to check the granularity of access. This should cause no behavioral change. Reviewed-by: David Gibson Acked-by: Alex Williamson Signed-off-by: Alexey Kardashevskiy --- As Al

Re: [PATCH] cxl: Fix wrong comparison in cxl_adapter_context_get()

2018-07-05 Thread Frederic Barrat
Le 04/07/2018 à 17:28, Vaibhav Jain a écrit : Function atomic_inc_unless_negative() returns a bool to indicate success/failure. However cxl_adapter_context_get() wrongly compares the return value against '>=0' which will always be true. The patch fixes this comparison to '==0' there by also fi