[PATCH v4 3/3] powerpc/mm/hugetlb: Allow runtime allocation of 16G.

2017-07-27 Thread Aneesh Kumar K.V
Now that we have GIGANTIC_PAGE enabled on powerpc, use this for 16G hugepages with hash translation mode. Depending on the total system memory we have, we may be able to allocate 16G hugepages runtime. This also remove the hugetlb setup difference between hash/radix translation mode.

[PATCH v4 2/3] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line

2017-07-27 Thread Aneesh Kumar K.V
With commit aa888a74977a8 ("hugetlb: support larger than MAX_ORDER") we added support for allocating gigantic hugepages via kernel command line. Switch ppc64 arch specific code to use that. W.r.t FSL support, we now limit our allocation range using BOOTMEM_ALLOC_ACCESSIBLE. We use the kernel

[PATCH v4 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Aneesh Kumar K.V
When running in guest mode ppc64 supports a different mechanism for hugetlb allocation/reservation. The LPAR management application called HMC can be used to reserve a set of hugepages and we pass the details of reserved pages via device tree to the guest. (more details in

Re: [PATCH V8 3/3] powernv: Add support to clear sensor groups data

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > Adds support for clearing different sensor groups. OCC inband sensor > groups like CSM, Profiler, Job Scheduler can be cleared using this > driver. The min/max of all sensors belonging to these sensor groups > will be cleared. > Hi

Re: [PATCH V8 2/3] powernv: Add support to set power-shifting-ratio

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > This patch adds support to set power-shifting-ratio for CPU-GPU which > is used by OCC power capping algorithm. > > Signed-off-by: Shilpasri G Bhat Hi Shilpasri, I started looking though this - a lot

Re: [PATCH V8 1/3] powernv: powercap: Add support for powercap framework

2017-07-27 Thread Shilpasri G Bhat
Hi Cyril, On 07/28/2017 07:09 AM, Cyril Bur wrote: > Is there any reason that pcap_attrs needs to be contiguous? If not, I > feel like you could eliminate the entire loop below (and the last one > as well maybe) and just do the assignment of pattr_groups[].attrs[] up > there. > > In fact do you

Re: [PATCH v2] powerpc/mm: Fix pmd/pte_devmap() on non-leaf entries

2017-07-27 Thread Aneesh Kumar K.V
Michael Ellerman writes: > From: Oliver O'Halloran > > The Radix MMU translation tree as defined in ISA v3.0 contains two > different types of entry, directories and leaves. Leaves are > identified by _PAGE_PTE being set. > > The formats of the two entries

[PATCH v2] powerpc/mm: Fix pmd/pte_devmap() on non-leaf entries

2017-07-27 Thread Michael Ellerman
From: Oliver O'Halloran The Radix MMU translation tree as defined in ISA v3.0 contains two different types of entry, directories and leaves. Leaves are identified by _PAGE_PTE being set. The formats of the two entries are different, with the directory entries containing no

Re: [PATCH V8 1/3] powernv: powercap: Add support for powercap framework

2017-07-27 Thread Cyril Bur
On Wed, 2017-07-26 at 10:35 +0530, Shilpasri G Bhat wrote: > Adds a generic powercap framework to change the system powercap > inband through OPAL-OCC command/response interface. > > Signed-off-by: Shilpasri G Bhat > --- > Changes from V7: > - Replaced sscanf with

Re: [PATCH v3 4/5] powerpc/lib/sstep: Add prty instruction emulation

2017-07-27 Thread Michael Ellerman
Matt Brown writes: > On Thu, Jul 27, 2017 at 11:26 AM, Michael Ellerman > wrote: >> Segher Boessenkool writes: >> >>> On Wed, Jul 26, 2017 at 08:03:30PM +1000, Michael Ellerman wrote: Segher Boessenkool

Re: [PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap()

2017-07-27 Thread Suraj Jitindar Singh
On Fri, 2017-07-28 at 01:35 +1000, Oliver O'Halloran wrote: > The ISA radix translation tree contains two different types of entry, s/entry/entries > > directories and leaves. The formats of the two entries are > different > with the directory entries containing no spare bits for use by >

Re: [PATCH] powerpc/powernv/pci: Return failure for some uses of dma_set_mask()

2017-07-27 Thread Russell Currey
On Wed, 2017-07-26 at 15:26 +1000, Alistair Popple wrote: > Commit 8e3f1b1d8255 ("powerpc/powernv/pci: Enable 64-bit devices to access > > 4GB DMA space") introduced the ability for PCI device drivers to request a > > DMA mask between 64 and 32 bits and actually get a mask greater than > 32-bits.

Re: [PATCH v3 4/5] powerpc/lib/sstep: Add prty instruction emulation

2017-07-27 Thread Matt Brown
On Thu, Jul 27, 2017 at 11:26 AM, Michael Ellerman wrote: > Segher Boessenkool writes: > >> On Wed, Jul 26, 2017 at 08:03:30PM +1000, Michael Ellerman wrote: >>> Segher Boessenkool writes: >>> > A general question

Re: [PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap()

2017-07-27 Thread joserz
On Fri, Jul 28, 2017 at 01:35:53AM +1000, Oliver O'Halloran wrote: > The ISA radix translation tree contains two different types of entry, > directories and leaves. The formats of the two entries are different > with the directory entries containing no spare bits for use by software. > As a result

Re: [PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Liam R. Howlett
* Aneesh Kumar K.V [170727 12:12]: > > > On 07/27/2017 08:55 PM, Liam R. Howlett wrote: > > * Aneesh Kumar K.V [170727 02:18]: > > > For ppc64, we want to call this function when we are not running as guest. > > > Also, if we

Re: [PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Liam R. Howlett
* Aneesh Kumar K.V [170727 02:18]: > For ppc64, we want to call this function when we are not running as guest. > Also, if we failed to allocate hugepages, let the user know. > [...] > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index bc48ee783dd9..a3a7a7e6339e

Re: [RFC v6 15/62] powerpc: helper functions to initialize AMR, IAMR and UMOR registers

2017-07-27 Thread Thiago Jung Bauermann
Ram Pai writes: > Introduce helper functions that can initialize the bits in the AMR, > IAMR and UMOR register; the bits that correspond to the given pkey. > > Signed-off-by: Ram Pai s/UMOR/UAMOR/ here and in the subject as well. > ---

Re: [PATCH v2] include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH

2017-07-27 Thread Murilo Opsfelder Araújo
On 07/26/2017 04:37 PM, Alex Williamson wrote: [...] > Applied to my for-linus branch with David and Alexey's R-b for v4.13. > Thanks, > > Alex Thank you all! -- Murilo

Re: [PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap()

2017-07-27 Thread Laurent Vivier
On 27/07/2017 17:35, ooh...@gmail.com (Oliver O'Halloran) wrote: > The ISA radix translation tree contains two different types of entry, > directories and leaves. The formats of the two entries are different > with the directory entries containing no spare bits for use by software. > As a result

Re: [PATCH 2/4] pseries/drc-info: Search DRC properties for CPU indexes

2017-07-27 Thread Nathan Fontenot
On 07/27/2017 11:10 AM, Michael Bringmann wrote: > > pseries/drc-info: Provide parallel routines to convert between > drc_index and CPU numbers at runtime, using the older device-tree > properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" > and "ibm,drc-power-domains"), or the new

Re: [RFC v6 20/62] powerpc: store and restore the pkey state across context switches

2017-07-27 Thread Thiago Jung Bauermann
Ram Pai writes: > Store and restore the AMR, IAMR and UMOR register state of the task > before scheduling out and after scheduling in, respectively. > > Signed-off-by: Ram Pai s/UMOR/UAMOR/ > diff --git a/arch/powerpc/kernel/process.c

Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-07-27 Thread Paul E. McKenney
On Thu, Jul 27, 2017 at 05:39:23PM +0100, Jonathan Cameron wrote: > On Thu, 27 Jul 2017 14:49:03 +0100 > Jonathan Cameron wrote: > > > On Thu, 27 Jul 2017 05:49:13 -0700 > > "Paul E. McKenney" wrote: > > > > > On Thu, Jul 27, 2017 at

Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-07-27 Thread Jonathan Cameron
On Thu, 27 Jul 2017 14:49:03 +0100 Jonathan Cameron wrote: > On Thu, 27 Jul 2017 05:49:13 -0700 > "Paul E. McKenney" wrote: > > > On Thu, Jul 27, 2017 at 02:34:00PM +1000, Nicholas Piggin wrote: > > > On Wed, 26 Jul 2017 18:42:14 -0700

Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage

2017-07-27 Thread Jens Axboe
On 07/27/2017 08:47 AM, Bart Van Assche wrote: > On Thu, 2017-07-27 at 08:02 -0600, Jens Axboe wrote: >> The bug looks like SCSI running the queue inline from IRQ >> context, that's not a good idea. Can you confirm the below works for >> you? >> >> >> diff --git a/drivers/scsi/scsi_lib.c

Re: [PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 06:31 PM, Michal Hocko wrote: On Thu 27-07-17 11:48:26, Aneesh Kumar K.V wrote: For ppc64, we want to call this function when we are not running as guest. What does this mean? ppc64 guest (aka LPAR) support a different mechanism for hugetlb allocation/reservation. The LPAR

Re: [PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 08:55 PM, Liam R. Howlett wrote: * Aneesh Kumar K.V [170727 02:18]: For ppc64, we want to call this function when we are not running as guest. Also, if we failed to allocate hugepages, let the user know. [...] diff --git a/mm/hugetlb.c

[PATCH V2 3/4] hotplug/drc-info: Add code to search ibm,drc-info property

2017-07-27 Thread Michael Bringmann
rpadlpar_core.c: Provide parallel routines to search the older device- tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". The interface to examine the DRC information is changed from a "get" function that returns

[PATCH V2 4/4] powerpc: Enable support for ibm,drc-info devtree property

2017-07-27 Thread Michael Bringmann
prom_init.c: Enable support for new DRC device tree property "ibm,drc-info" in initial handshake between the Linux kernel and the front end processor. Signed-off-by: Michael Bringmann --- arch/powerpc/kernel/prom_init.c |1 + 1 file changed, 1 insertion(+) diff

[PATCH 2/4] pseries/drc-info: Search DRC properties for CPU indexes

2017-07-27 Thread Michael Bringmann
pseries/drc-info: Provide parallel routines to convert between drc_index and CPU numbers at runtime, using the older device-tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". Signed-off-by: Michael Bringmann

[PATCH V2 1/4] powerpc/firmware: Add definitions for new drc-info firmware feature

2017-07-27 Thread Michael Bringmann
Firmware Features: Define new bit flag representing the presence of new device tree property "ibm,drc-info". The flag is used to tell the front end processor when the Linux kernel supports the new properties, and by the front end processor to tell the Linux kernel that the new property is

[PATCH V2 0/4] powerpc/devtree: Add support for 'ibm,drc-info' property

2017-07-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the

Re: [RFC PATCH 3/3] mm/hugetlb: Remove pmd_huge_split_prepare

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 06:27 PM, Michal Hocko wrote: On Thu 27-07-17 14:07:56, Aneesh Kumar K.V wrote: Instead of marking the pmd ready for split, invalidate the pmd. This should take care of powerpc requirement. which is? I can add the commit which explain details here. Or add more details from

Re: [RFC PATCH 2/3] powerpc/mm: Implement pmdp_establish for ppc64

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 06:26 PM, Michal Hocko wrote: On Thu 27-07-17 14:07:55, Aneesh Kumar K.V wrote: We can now use this to set pmd page table entries to absolute values. THP need to ensure that we always update pmd PTE entries such that we never mark the pmd none. pmdp_establish helps in

Re: [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 06:24 PM, Michal Hocko wrote: EMISSING_CHANGELOG besides that no user actually uses the return value. Please fold this into the patch which uses the new functionality. The patch series was suppose to help Kirill to make progress with the his series at

[PATCH v2] powerpc/mm: Check for _PAGE_PTE in *_devmap()

2017-07-27 Thread Oliver O'Halloran
The ISA radix translation tree contains two different types of entry, directories and leaves. The formats of the two entries are different with the directory entries containing no spare bits for use by software. As a result we need to ensure that the *_devmap() family of functions check fail for

Re: [RFC v6 19/62] powerpc: ability to create execute-disabled pkeys

2017-07-27 Thread Thiago Jung Bauermann
Thiago Jung Bauermann writes: > diff --git a/arch/powerpc/include/asm/pkeys.h > b/arch/powerpc/include/asm/pkeys.h > index e31f5ee8e81f..67e6a3a343ae 100644 > --- a/arch/powerpc/include/asm/pkeys.h > +++ b/arch/powerpc/include/asm/pkeys.h > @@ -4,17 +4,6 @@ >

Re: [PATCH] soc: Convert to using %pOF instead of full_name

2017-07-27 Thread Simon Horman
On Tue, Jul 18, 2017 at 04:43:29PM -0500, Rob Herring wrote: > Now that we have a custom printf format specifier, convert users of > full_name to use %pOF instead. This is preparation to remove storing > of the full path string for each node. > > Signed-off-by: Rob Herring > Cc:

Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage

2017-07-27 Thread Bart Van Assche
On Thu, 2017-07-27 at 08:02 -0600, Jens Axboe wrote: > The bug looks like SCSI running the queue inline from IRQ > context, that's not a good idea. Can you confirm the below works for > you? > > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index f6097b89d5d3..78740ebf966c

Re: [RFC Part1 PATCH v3 07/17] x86/mm: Include SEV for encryption memory attribute changes

2017-07-27 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 02:07:47PM -0500, Brijesh Singh wrote: > From: Tom Lendacky > > The current code checks only for sme_active() when determining whether > to perform the encryption attribute change. Include sev_active() in this > check so that memory attribute

Re: [RFC v6 19/62] powerpc: ability to create execute-disabled pkeys

2017-07-27 Thread Thiago Jung Bauermann
Ram Pai writes: > --- a/arch/powerpc/include/asm/pkeys.h > +++ b/arch/powerpc/include/asm/pkeys.h > @@ -2,6 +2,18 @@ > #define _ASM_PPC64_PKEYS_H > > extern bool pkey_inited; > +/* override any generic PKEY Permission defines */ > +#undef PKEY_DISABLE_ACCESS > +#define

[PATCH] powerpc/mm: Check for _PAGE_PTE in *_devmap()

2017-07-27 Thread Oliver O'Halloran
The ISA radix translation tree contains two different types of entry, directories and leaves. The formats of the two entries are different with the directory entries containing no spare bits for use by software. As a result we need to ensure that the *_devmap() family of functions check fail for

Re: [RFC v6 17/62] powerpc: implementation for arch_set_user_pkey_access()

2017-07-27 Thread Thiago Jung Bauermann
Ram Pai writes: > @@ -113,10 +117,14 @@ static inline int arch_override_mprotect_pkey(struct > vm_area_struct *vma, > return 0; > } > > +extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey, > + unsigned long init_val); > static

Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage

2017-07-27 Thread Jens Axboe
On 07/26/2017 11:10 PM, Michael Ellerman wrote: > Hi Jens, > > I'm seeing the lockdep warning below on shutdown on a Power8 machine > using IPR. > > If I'm reading it right it looks like the spin_lock() (non-irq) in > blk_mq_sched_insert_request() is the immediate cause. All the users of

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

2017-07-27 Thread Thiago Jung Bauermann
Hello Ram, I'm still going through the patches and haven't formed a full picture of the feature in my mind yet, so my comments today won't be particularly insightful... But hopefully the comments that I currently have will be helpful anyway. Ram Pai writes: > diff --git

Re: [PATCH] powerpc/smp: Call smp_ops->setup_cpu() directly on the boot CPU

2017-07-27 Thread Thomas Gleixner
On Thu, 27 Jul 2017, Michael Ellerman wrote: > In smp_cpus_done() we need to call smp_ops->setup_cpu() for the boot > CPU, which means it has to run *on* the boot CPU. > > In the past we ensured it ran on the boot CPU by changing the CPU > affinity mask of current directly. That was removed in

Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-07-27 Thread Jonathan Cameron
On Thu, 27 Jul 2017 05:49:13 -0700 "Paul E. McKenney" wrote: > On Thu, Jul 27, 2017 at 02:34:00PM +1000, Nicholas Piggin wrote: > > On Wed, 26 Jul 2017 18:42:14 -0700 > > "Paul E. McKenney" wrote: > > > > > On Wed, Jul 26, 2017 at

Re: [RFC Part1 PATCH v3 03/17] x86/mm: Secure Encrypted Virtualization (SEV) support

2017-07-27 Thread Borislav Petkov
On Wed, Jul 26, 2017 at 11:47:32AM -0500, Tom Lendacky wrote: > If it's made static then the sme_active()/sev_active() inline functions > would need to be turned into functions within the mem_encrypt.c file. So > there's a trade-off to do that, which is the better one? Simple: why do we have

Re: [RFC Part1 PATCH v3 06/17] x86/mm: Use encrypted access of boot related data with SEV

2017-07-27 Thread Borislav Petkov
On Mon, Jul 24, 2017 at 02:07:46PM -0500, Brijesh Singh wrote: > From: Tom Lendacky > > When Secure Encrypted Virtualization (SEV) is active, boot data (such as > EFI related data, setup data) is encrypted and needs to be accessed as > such when mapped. Update the

Re: Possible circular locking dependency detected between cpu_hotplug_lock.rw_sem and wfc.work

2017-07-27 Thread Thomas Gleixner
On Thu, 27 Jul 2017, Thomas Gleixner wrote: > On Thu, 27 Jul 2017, Michael Ellerman wrote: > > Thomas Gleixner writes: > > > > > On Wed, 26 Jul 2017, Michael Ellerman wrote: > > > > > >> Hi Thomas, > > >> > > >> I'm seeing the lockdep barf below on some bare metal Power8

Re: Possible circular locking dependency detected between cpu_hotplug_lock.rw_sem and wfc.work

2017-07-27 Thread Thomas Gleixner
On Thu, 27 Jul 2017, Michael Ellerman wrote: > Thomas Gleixner writes: > > > On Wed, 26 Jul 2017, Michael Ellerman wrote: > > > >> Hi Thomas, > >> > >> I'm seeing the lockdep barf below on some bare metal Power8 machines. > >> > >> This seems to be caused by our

[PATCH] powerpc/smp: Call smp_ops->setup_cpu() directly on the boot CPU

2017-07-27 Thread Michael Ellerman
In smp_cpus_done() we need to call smp_ops->setup_cpu() for the boot CPU, which means it has to run *on* the boot CPU. In the past we ensured it ran on the boot CPU by changing the CPU affinity mask of current directly. That was removed in commit 6d11b87d55eb ("powerpc/smp: Replace open coded

Re: Possible circular locking dependency detected between cpu_hotplug_lock.rw_sem and wfc.work

2017-07-27 Thread Michael Ellerman
Thomas Gleixner writes: > On Wed, 26 Jul 2017, Michael Ellerman wrote: > >> Hi Thomas, >> >> I'm seeing the lockdep barf below on some bare metal Power8 machines. >> >> This seems to be caused by our smp_cpus_done(), which does: >> >> void __init smp_cpus_done(unsigned

Re: [PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Michal Hocko
On Thu 27-07-17 11:48:26, Aneesh Kumar K.V wrote: > For ppc64, we want to call this function when we are not running as guest. What does this mean? > Also, if we failed to allocate hugepages, let the user know. > > Signed-off-by: Aneesh Kumar K.V > --- >

Re: [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value

2017-07-27 Thread Kirill A. Shutemov
On Thu, Jul 27, 2017 at 02:54:49PM +0200, Michal Hocko wrote: > EMISSING_CHANGELOG > > besides that no user actually uses the return value. Please fold this > into the patch which uses the new functionality. That's for patchset I'm working on[1]. [1]

Re: [RFC PATCH 3/3] mm/hugetlb: Remove pmd_huge_split_prepare

2017-07-27 Thread Michal Hocko
On Thu 27-07-17 14:07:56, Aneesh Kumar K.V wrote: > Instead of marking the pmd ready for split, invalidate the pmd. This should > take care of powerpc requirement. which is? > Only side effect is that we mark the pmd > invalid early. This can result in us blocking access to the page a bit longer

Re: [RFC PATCH 2/3] powerpc/mm: Implement pmdp_establish for ppc64

2017-07-27 Thread Michal Hocko
On Thu 27-07-17 14:07:55, Aneesh Kumar K.V wrote: > We can now use this to set pmd page table entries to absolute values. THP > need to ensure that we always update pmd PTE entries such that we never mark > the pmd none. pmdp_establish helps in implementing that. > > This doesn't flush the tlb.

Re: [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value

2017-07-27 Thread Michal Hocko
EMISSING_CHANGELOG besides that no user actually uses the return value. Please fold this into the patch which uses the new functionality. On Thu 27-07-17 14:07:54, Aneesh Kumar K.V wrote: > Signed-off-by: Aneesh Kumar K.V > --- >

New "merge" branch in the powerpc repo

2017-07-27 Thread Michael Ellerman
Hi folks, tldr: There's a new branch in the powerpc repo called "merge", and if you're doing work that's targeting the powerpc tree then it is probably a good base to work on top of. It's a merge of Linus' master branch, my current fixes branch, and my current next branch. If we have

Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-07-27 Thread Paul E. McKenney
On Thu, Jul 27, 2017 at 02:34:00PM +1000, Nicholas Piggin wrote: > On Wed, 26 Jul 2017 18:42:14 -0700 > "Paul E. McKenney" wrote: > > > On Wed, Jul 26, 2017 at 04:22:00PM -0700, David Miller wrote: > > > > Indeed, that really wouldn't explain how we end up with a RCU

Re: powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain

2017-07-27 Thread Michael Ellerman
On Wed, 2017-07-26 at 13:18:31 UTC, Michael Ellerman wrote: > In commit efe0160cfd40 ("powerpc/64: Linker on-demand sfpr functions > for modules"), we added an ld version check early in the powerpc > top-level Makefile. > > Because the Makefile runs before the kernel config is setup, the > checks

Re: [v6] powerpc/mm/radix: Workaround prefetch issue with KVM

2017-07-27 Thread Michael Ellerman
On Tue, 2017-07-25 at 11:47:42 UTC, Michael Ellerman wrote: > From: Benjamin Herrenschmidt > > There's a somewhat architectural issue with Radix MMU and KVM. > > When coming out of a guest with AIL (Alternate Interrupt Location, ie, > MMU enabled), we start executing

Re: powerpc/pseries: Fix of_node_put() underflow during pseries remove

2017-07-27 Thread Michael Ellerman
On Fri, 2017-07-21 at 14:51:39 UTC, Laurent Vivier wrote: > As for commit 68baf692c435 ("powerpc/pseries: Fix of_node_put() > underflow during DLPAR remove"), the call to of_node_put() > must be removed from pSeries_reconfig_remove_node(). > > dlpar_detach_node() and

Re: powerpc/mm/hash: Free the subpage_prot_table correctly

2017-07-27 Thread Michael Ellerman
On Sat, 2017-06-17 at 14:30:55 UTC, "Aneesh Kumar K.V" wrote: > Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to > take care of 64TB") > Signed-off-by: Aneesh Kumar K.V > Tested-by: Ram Pai Applied to powerpc

Re: [v13,1/5] powerpc/platform/powernv: Update IMC OPAL APIs

2017-07-27 Thread Michael Ellerman
On Tue, 2017-07-18 at 21:36:32 UTC, Madhavan Srinivasan wrote: > In-Memory Collection (IMC) counters are performance monitoring infrastrcuture. > These counters need special sequence of scoms to init/start/stop which is > handled > by OPAL. And OPAL provides three APIs to init and control these

Re: [v2] powerpc: allow compiling with GENERIC_MSI_IRQ_DOMAIN

2017-07-27 Thread Michael Ellerman
On Mon, 2017-07-17 at 13:12:43 UTC, laurentiu.tu...@nxp.com wrote: > From: Laurentiu Tudor > > This allows building powerpc with the GENERIC_MSI_IRQ_DOMAIN > Kconfig by enabling the asm-generic msi.h in Kbuild. Without > this, there's a compilation error [1] because

Re: powerpc/smp: Get cpu only after validity check

2017-07-27 Thread Michael Ellerman
On Tue, 2017-07-04 at 04:22:46 UTC, Santosh Sivaraj wrote: > Check for validity of cpu before calling get_hard_smp_processor_id. > > Found with coverity. > > Signed-off-by: Santosh Sivaraj Applied to powerpc next, thanks.

Re: powerpc: Build fix for non SPARSEMEM_VMEMAP config

2017-07-27 Thread Michael Ellerman
On Wed, 2017-06-28 at 06:09:28 UTC, "Aneesh Kumar K.V" wrote: > We can use pfn_to_page in realmode for other configs. Hence remove the > CONFIG_FLATMEM ifdef > > Fixes: 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU > map/unmap) > > Cc: Alexey Kardashevskiy

Re: powerpc/ipic: Support edge on IRQ0

2017-07-27 Thread Michael Ellerman
On Sun, 2017-06-25 at 02:39:05 UTC, Scott Wood wrote: > External IRQ0 has the same capabilities as the other IRQ1-7 and is > handled by the same register IPIC_SEPNR. When this register is not > specified for "ack" in "ipic_info", you cannot configure this IRQ as > IRQ_TYPE_EDGE_FALLING. This

Re: powerpc/pseries: use memdup_user_nul

2017-07-27 Thread Michael Ellerman
On Sat, 2017-04-29 at 01:45:15 UTC, Geliang Tang wrote: > Use memdup_user_nul() helper instead of open-coding to simplify the code. > > Signed-off-by: Geliang Tang Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/3783225130f01ea86fc0ee477a0e72 cheers

Re: powerpc/powernv: use memdup_user

2017-07-27 Thread Michael Ellerman
On Sat, 2017-04-29 at 01:45:14 UTC, Geliang Tang wrote: > Use memdup_user() helper instead of open-coding to simplify the code. > > Signed-off-by: Geliang Tang Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/5588b29a5cd34aec747202e95f328a cheers

Re: KVM guests freeze under upstream kernel

2017-07-27 Thread Michael Ellerman
Suraj Jitindar Singh writes: > ... > kernel BUG at > /scratch/surajjs/linux/arch/powerpc/include/asm/book3s/64/radix.h:260! Next thing to try would be something like below. cheers diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h

Re: [RFC PATCH 3/3] mm/hugetlb: Remove pmd_huge_split_prepare

2017-07-27 Thread Aneesh Kumar K.V
On 07/27/2017 02:07 PM, Aneesh Kumar K.V wrote: diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h b/arch/powerpc/include/asm/book3s/64/hash-64k.h index 8c8fb6fbdabe..b856e130c678 100644 --- a/arch/powerpc/include/asm/book3s/64/hash-64k.h +++

[RFC PATCH 3/3] mm/hugetlb: Remove pmd_huge_split_prepare

2017-07-27 Thread Aneesh Kumar K.V
Instead of marking the pmd ready for split, invalidate the pmd. This should take care of powerpc requirement. Only side effect is that we mark the pmd invalid early. This can result in us blocking access to the page a bit longer if we race against a thp split. Signed-off-by: Aneesh Kumar K.V

[RFC PATCH 2/3] powerpc/mm: Implement pmdp_establish for ppc64

2017-07-27 Thread Aneesh Kumar K.V
We can now use this to set pmd page table entries to absolute values. THP need to ensure that we always update pmd PTE entries such that we never mark the pmd none. pmdp_establish helps in implementing that. This doesn't flush the tlb. Based on the old_pmd value returned caller can decide to call

[RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value

2017-07-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 4 ++-- arch/powerpc/mm/pgtable-book3s64.c | 9 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h

Re: [PATCH 1/6] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-07-27 Thread Ram Pai
On Thu, Jul 27, 2017 at 07:29:32AM +0530, Aneesh Kumar K.V wrote: > > > On 07/26/2017 09:36 PM, Ram Pai wrote: > >On Wed, Jul 26, 2017 at 04:05:48PM +0530, Aneesh Kumar K.V wrote: > >>Ram Pai writes: > >> > > >>>diff --git a/arch/powerpc/include/asm/book3s/64/hash-64k.h >

RE: [RFC Part1 PATCH v3 13/17] x86/io: Unroll string I/O when SEV is active

2017-07-27 Thread David Laight
From: Brijesh Singh > Sent: 26 July 2017 21:07 ... > I am not sure if I understand your concern. > > Are you commenting on amount of code duplication ? If so, I can certainly > improve > and use the similar macro used into header file to generate the functions > body. If you are careful the

Re: RCU lockup issues when CONFIG_SOFTLOCKUP_DETECTOR=n - any one else seeing this?

2017-07-27 Thread Jonathan Cameron
On Wed, 26 Jul 2017 18:13:12 +0100 Jonathan Cameron wrote: > On Wed, 26 Jul 2017 09:54:32 -0700 > David Miller wrote: > > > From: "Paul E. McKenney" > > Date: Wed, 26 Jul 2017 08:49:00 -0700 > > > > > On Wed, Jul

Re: KVM guests freeze under upstream kernel

2017-07-27 Thread Suraj Jitindar Singh
On Thu, 2017-07-27 at 13:14 +1000, Michael Ellerman wrote: > jos...@linux.vnet.ibm.com writes: > > On Thu, Jul 20, 2017 at 10:18:18PM -0300, jos...@linux.vnet.ibm.com > > wrote: > > > On Thu, Jul 20, 2017 at 03:21:59PM +1000, Paul Mackerras wrote: > > > > > > > > Did you check the host kernel

[PATCH v3 3/3] powerpc/mm/cxl: Add the fault handling cpu to mm cpumask

2017-07-27 Thread Aneesh Kumar K.V
We use mm cpumask for serializing against lockless page table walk. Anybody who is doing a lockless page table walk is expected to disable irq and only cpus in mm cpumask is expected do the lockless walk. This ensure that a THP split can send IPI to only cpus in the mm cpumask, to make sure there

[PATCH v3 2/3] powerpc/mm: Don't send IPI to all cpus on THP updates

2017-07-27 Thread Aneesh Kumar K.V
Now that we made sure that lockless walk of linux page table is mostly limitted to current task(current->mm->pgdir) we can update the THP update sequence to only send IPI to cpus on which this task has run. This helps in reducing the IPI overload on systems with large number of CPUs. W.r.t kvm

[PATCH v3 1/3] powerpc/mm: Rename find_linux_pte_or_hugepte

2017-07-27 Thread Aneesh Kumar K.V
Add newer helpers to make the function usage simpler. It is always recommended to use find_current_mm_pte() for walking the page table. If we cannot use find_current_mm_pte(), it should be documented why the said usage of __find_linux_pte() is safe against a parallel THP split. For now we have

[PATCH v3 3/3] powerpc/mm/hugetlb: Allow runtime allocation of 16G.

2017-07-27 Thread Aneesh Kumar K.V
We now have GIGANTIC_PAGE on powerpc. Currently this is enabled only on radix with 1G as gigantic hugepage size. Enable this with hash translation mode too (ie, with 16G hugepage size). Depending on the total system memory we may be able to allocate 16G hugepage size. This bring parity between

[PATCH v3 2/3] powerpc/mm/hugetlb: Add support for reserving gigantic huge pages via kernel command line

2017-07-27 Thread Aneesh Kumar K.V
With commit aa888a74977a8 ("hugetlb: support larger than MAX_ORDER") we added support for allocating gigantic hugepages via kernel command line. Switch ppc64 arch specific code to use that. W.r.t FSL support, we now limit our allocation range using BOOTMEM_ALLOC_ACCESSIBLE. We use the kernel

[PATCH v3 1/3] mm/hugetlb: Allow arch to override and call the weak function

2017-07-27 Thread Aneesh Kumar K.V
For ppc64, we want to call this function when we are not running as guest. Also, if we failed to allocate hugepages, let the user know. Signed-off-by: Aneesh Kumar K.V --- include/linux/hugetlb.h | 1 + mm/hugetlb.c| 5 - 2 files changed, 5