Re: [PATCH] powerpc/mm: fix a hardcode on memory boundary checking

2017-07-04 Thread Anshuman Khandual
On 01/12/2017 02:39 PM, Rui Teng wrote: > The offset of hugepage block will not be 16G, if the expected > page is more than one. Calculate the totol size instead of the > hardcode value. > > Signed-off-by: Rui Teng I have a redundant patch, this one is the original.

Re: [PATCH] powerpc/mm: Check gigantic page range correctly inside memblock

2017-07-04 Thread Aneesh Kumar K.V
On Monday 03 July 2017 01:01 PM, Anshuman Khandual wrote: The gigantic page range received from platform actually extends upto (block_size * expeted_pages) starting at any given address instead of just a single 16GB page. Fixes: 4792adbac9eb ("powerpc: Don't use a 16G page if beyond mem=

Re: [PATCH] powerpc/mm: Implemented default_hugepagesz verification for powerpc

2017-07-04 Thread Anshuman Khandual
On 07/04/2017 01:35 AM, Victor Aoqui wrote: > Implemented default hugepage size verification (default_hugepagesz=) > in order to allow allocation of defined number of pages (hugepages=) > only for supported hugepage sizes. > > Signed-off-by: Victor Aoqui > --- >

Re: [PATCH] powerpc/mm: Implemented default_hugepagesz verification for powerpc

2017-07-04 Thread Aneesh Kumar K.V
On Tuesday 04 July 2017 01:35 AM, Victor Aoqui wrote: Implemented default hugepage size verification (default_hugepagesz=) in order to allow allocation of defined number of pages (hugepages=) only for supported hugepage sizes. Signed-off-by: Victor Aoqui ---

Re: [PATCH 1/4] powerpc/powernv: handle the platform error reboot in ppc_md.restart

2017-07-04 Thread Nicholas Piggin
On Wed, 5 Jul 2017 14:04:19 +1000 Nicholas Piggin wrote: > Unrecovered MCE and HMI errors are sent through a special restart > OPAL call to log the platform error. The downside is that they don't > go through normal crash paths, so they don't give much information > to the

Re: [PATCH v2 1/3] powerpc: do not call ppc_md.panic in fadump panic notifier

2017-07-04 Thread Mahesh Jagannath Salgaonkar
On 07/05/2017 09:26 AM, Nicholas Piggin wrote: > If fadump is not registered, and no other crash or debug handlers are > registered, the powerpc panic handler stops the guest before the generic > panic code can push out debug information to the console. > > Currently, system reset injection

[PATCH 4/4] powerpc: machine check interrupt is a non-maskable interrupt

2017-07-04 Thread Nicholas Piggin
Use nmi_enter similarly to system reset interrupts. This uses NMI printk NMI buffers and turns off various debugging facilities that helps avoid tripping on ourselves or other CPUs. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/traps.c | 9 ++---

[PATCH 3/4] powernv/pseries: machine check use kernel crash path

2017-07-04 Thread Nicholas Piggin
Similarly to the powernv patch, pseries can recover from and/or print more error details from a recovered machine check if it goes via the kernel crash path rather than panic()ing in the case of MCE in kernel mode. Signed-off-by: Nicholas Piggin ---

[PATCH 2/4] powerpc/powernv: machine check use kernel crash path

2017-07-04 Thread Nicholas Piggin
Use the kernel crash path in cases of recovered machine checks that occur in kernel mode, because it gives much better Linux crash information, and can allow the offending process to be killed without completely taking down the system. As a test, when triggering an i-side 0111b error (ifetch

[PATCH 1/4] powerpc/powernv: handle the platform error reboot in ppc_md.restart

2017-07-04 Thread Nicholas Piggin
Unrecovered MCE and HMI errors are sent through a special restart OPAL call to log the platform error. The downside is that they don't go through normal crash paths, so they don't give much information to the Linux console. Change this by allowing them to set an error which then causes the normal

[PATCH 0/4] machine check handling improvements

2017-07-04 Thread Nicholas Piggin
These are some improvements to recoverability and debugability of machine check handling. Patch 2 depends on patch 1, but they are otherwise independent. Thanks, Nick Nicholas Piggin (4): powerpc/powernv: handle the platform error reboot in ppc_md.restart powerpc/powernv: machine check use

[PATCH v2 3/3] powerpc: do not send system reset request through the oops path

2017-07-04 Thread Nicholas Piggin
A system reset is a request to crash / debug the system rather than necessarily caused by encountering a BUG. So there is no need to serialize all CPUs behind the die lock, adding taints to all subsequent traces beyond the first, breaking console locks, etc. The system reset is NMI context which

[PATCH v2 2/3] powerpc/pseries/le: work around a firmware quirk

2017-07-04 Thread Nicholas Piggin
Some PowerVM firmware when delivering a system reset interrupt to a little endian OS will mess up SRR registers. They are byteswapped, and SRR1 is incorrect. An example from a crash: NIP: 14dd09c0 MSR: 10020080 It's possible to detect this pattern in SRR1 (that would never

[PATCH v2 1/3] powerpc: do not call ppc_md.panic in fadump panic notifier

2017-07-04 Thread Nicholas Piggin
If fadump is not registered, and no other crash or debug handlers are registered, the powerpc panic handler stops the guest before the generic panic code can push out debug information to the console. Currently, system reset injection causes the guest to silently stop. Stop calling ppc_md.panic

[PATCH 0/3] sreset debugging improvements

2017-07-04 Thread Nicholas Piggin
Since last time: - Fixed bug in the fadump patch noticed by Mahesh. - Removed ppc_md.panic completely. Nicholas Piggin (3): powerpc: do not call ppc_md.panic in fadump panic notifier powerpc/pseries/le: work around a firmware quirk powerpc: do not send system reset request through the oops

Re: [RFC] powerpc/mm: Enable gigantic HugeTLB page support for powernv

2017-07-04 Thread Anshuman Khandual
On 07/05/2017 09:12 AM, Aneesh Kumar K.V wrote: > > > On Tuesday 04 July 2017 04:16 PM, Anshuman Khandual wrote: >> All the functionality for memblock allocation during boot was >> already present in Book3e and embeded platforms. This change >> just moves around some code under config conditions

Re: [RFC] powerpc/mm: Enable gigantic HugeTLB page support for powernv

2017-07-04 Thread Aneesh Kumar K.V
On Tuesday 04 July 2017 04:16 PM, Anshuman Khandual wrote: All the functionality for memblock allocation during boot was already present in Book3e and embeded platforms. This change just moves around some code under config conditions to make the function happen on powernv platforms.

Re: [PATCH v2 6/6] ima: Support module-style appended signatures for appraisal

2017-07-04 Thread Thiago Jung Bauermann
Mimi Zohar writes: > On Wed, 2017-06-21 at 14:45 -0300, Thiago Jung Bauermann wrote: >> Mimi Zohar writes: >> > On Wed, 2017-06-07 at 22:49 -0300, Thiago Jung Bauermann wrote: >> >> @@ -267,11 +276,18 @@ int ima_appraise_measurement(enum

Re: [PATCH] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-07-04 Thread Michael Neuling
On Tue, 2017-07-04 at 16:45 -0400, Gustavo Romero wrote: > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > due to the fact vs0 is used to save FPSCR and vs32 is used to save VSCR. tm_reclaim() should have no state live in the registers once it returns. It should all

Re: [PATCH 1/3] powerpc: do not call ppc_md.panic in panic notifier if fadump not used

2017-07-04 Thread Nicholas Piggin
On Wed, 05 Jul 2017 09:42:46 +1000 Michael Ellerman wrote: > Nicholas Piggin writes: > > diff --git a/arch/powerpc/kernel/setup-common.c > > b/arch/powerpc/kernel/setup-common.c > > index 94a948207cd2..39ba09965b04 100644 > > ---

Re: [PATCH 1/3] powerpc: do not call ppc_md.panic in panic notifier if fadump not used

2017-07-04 Thread Michael Ellerman
Nicholas Piggin writes: > diff --git a/arch/powerpc/kernel/setup-common.c > b/arch/powerpc/kernel/setup-common.c > index 94a948207cd2..39ba09965b04 100644 > --- a/arch/powerpc/kernel/setup-common.c > +++ b/arch/powerpc/kernel/setup-common.c > @@ -707,12 +707,15 @@

Re: [linux-next] cpus stalls detected few hours after booting next kernel

2017-07-04 Thread Paul E. McKenney
On Tue, Jul 04, 2017 at 07:44:58PM +0530, Abdul Haleem wrote: > On Fri, 2017-06-30 at 17:28 +1000, Nicholas Piggin wrote: > > On Fri, 30 Jun 2017 10:52:18 +0530 > > Abdul Haleem wrote: > > > > > On Fri, 2017-06-30 at 00:45 +1000, Nicholas Piggin wrote: > > > > On

[PATCH] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-07-04 Thread Gustavo Romero
Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) due to the fact vs0 is used to save FPSCR and vs32 is used to save VSCR. Later, we recheckpoint trusting that the live state of FP and VEC are ok depending on the MSR.FP and MSR.VEC bits, i.e. if MSR.FP is enabled that

Re: [PATCH 1/3] powerpc: do not call ppc_md.panic in panic notifier if fadump not used

2017-07-04 Thread Mahesh Jagannath Salgaonkar
On 07/04/2017 03:39 PM, Nicholas Piggin wrote: > If fadump is not registered, and no other crash or debug handlers are > registered, the powerpc panic handler stops the guest before the generic > panic code can push out debug information to the console. > > Without this patch, system reset

[PATCH] cxl: Fix is_page_fault() for POWER9

2017-07-04 Thread Christophe Lombard
From: Christophe Lombard The function is_page_fault(), for POWER9, lists the Translation Checkout Responses where the page fault will be handled by copro_handle_mm_fault(). This list is too restrictive and not necessary. This patches removes this restriction and

Re: [linux-next] cpus stalls detected few hours after booting next kernel

2017-07-04 Thread Abdul Haleem
On Fri, 2017-06-30 at 17:28 +1000, Nicholas Piggin wrote: > On Fri, 30 Jun 2017 10:52:18 +0530 > Abdul Haleem wrote: > > > On Fri, 2017-06-30 at 00:45 +1000, Nicholas Piggin wrote: > > > On Thu, 29 Jun 2017 20:23:05 +1000 > > > Nicholas Piggin

Re: kworker with empty task->cpus_allowed (was Re: [v4.12-rc1 regression] mount ext4 fs results in kernel crash on PPC64le host)

2017-07-04 Thread Eryu Guan
On Tue, Jul 04, 2017 at 09:06:55PM +1000, Michael Ellerman wrote: > Eryu Guan writes: > > > On Tue, Jul 04, 2017 at 04:26:11PM +1000, Michael Ellerman wrote: > >> Eryu Guan writes: > >> > On Fri, Jun 30, 2017 at 08:07:02PM +1000, Michael Ellerman wrote: > >>

Re: kworker with empty task->cpus_allowed (was Re: [v4.12-rc1 regression] mount ext4 fs results in kernel crash on PPC64le host)

2017-07-04 Thread Michael Ellerman
Eryu Guan writes: > On Tue, Jul 04, 2017 at 04:26:11PM +1000, Michael Ellerman wrote: >> Eryu Guan writes: >> > On Fri, Jun 30, 2017 at 08:07:02PM +1000, Michael Ellerman wrote: >> >> >> >> Can you try this patch and see if it changes anything? (with the

Re: [v5, 1/7] powerpc64/elfv1: Only dereference function descriptor for non-text symbols

2017-07-04 Thread Michael Ellerman
On Thu, 2017-06-29 at 17:49:14 UTC, "Naveen N. Rao" wrote: > Currently, we assume that the function pointer we receive in > ppc_function_entry() points to a function descriptor. However, this is > not always the case. In particular, assembly symbols without the right > annotation do not have an

Re: [v6, 01/10] powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp()

2017-07-04 Thread Michael Ellerman
On Mon, 2017-07-03 at 13:01:45 UTC, Michael Ellerman wrote: > From: Balbir Singh > > Once upon a time there were only two PP (page protection) bits. In ISA > 2.03 an additional PP bit was added, but because of the layout of the > HPTE it could not be made contiguous with

Re: [V4] cxl: Export library to support IBM XSL

2017-07-04 Thread Michael Ellerman
On Thu, 2017-06-22 at 13:07:27 UTC, Christophe Lombard wrote: > This patch exports a in-kernel 'library' API which can be called by > other drivers to help interacting with an IBM XSL on a POWER9 system. > > The XSL (Translation Service Layer) is a stripped down version of the > PSL (Power

[RFC] powerpc/mm: Enable gigantic HugeTLB page support for powernv

2017-07-04 Thread Anshuman Khandual
All the functionality for memblock allocation during boot was already present in Book3e and embeded platforms. This change just moves around some code under config conditions to make the function happen on powernv platforms. Signed-off-by: Anshuman Khandual ---

[PATCH 3/3] powerpc: do not send system reset request through the oops path

2017-07-04 Thread Nicholas Piggin
A system reset is a request to crash / debug the system rather than necessarily caused by encountering a BUG. So there is no need to serialize all CPUs behind the die lock, adding taints to all subsequent traces beyond the first, breaking console locks, etc. The system reset is NMI context which

[PATCH 2/3] powerpc/pseries/le: work around a firmware quirk

2017-07-04 Thread Nicholas Piggin
Some PowerVM firmware when delivering a system reset interrupt to a little endian OS will mess up SRR registers. They are byteswapped, and SRR1 is incorrect. An example from a crash: NIP: 14dd09c0 MSR: 10020080 It's possible to detect this pattern in SRR1 (that would never

[PATCH 1/3] powerpc: do not call ppc_md.panic in panic notifier if fadump not used

2017-07-04 Thread Nicholas Piggin
If fadump is not registered, and no other crash or debug handlers are registered, the powerpc panic handler stops the guest before the generic panic code can push out debug information to the console. Without this patch, system reset injection to a guest causes the guest to silently stop.

[PATCH 0/3] sreset debugging improvements

2017-07-04 Thread Nicholas Piggin
These are a few independent patches I've accumulated that improve system reset handling a bit. The first 2 at least should be quite straight forward and hopefully can be merged for 4.13. Thanks, Nick Nicholas Piggin (3): powerpc: do not call ppc_md.panic in panic notifier if fadump not used

Re: kworker with empty task->cpus_allowed (was Re: [v4.12-rc1 regression] mount ext4 fs results in kernel crash on PPC64le host)

2017-07-04 Thread Eryu Guan
On Tue, Jul 04, 2017 at 04:26:11PM +1000, Michael Ellerman wrote: > Eryu Guan writes: > > On Fri, Jun 30, 2017 at 08:07:02PM +1000, Michael Ellerman wrote: > >> > >> Can you try this patch and see if it changes anything? (with the debug > >> still applied). > > > > This patch

Re: kworker with empty task->cpus_allowed (was Re: [v4.12-rc1 regression] mount ext4 fs results in kernel crash on PPC64le host)

2017-07-04 Thread Michael Ellerman
Eryu Guan writes: > On Fri, Jun 30, 2017 at 08:07:02PM +1000, Michael Ellerman wrote: >> >> Can you try this patch and see if it changes anything? (with the debug >> still applied). > > This patch fixes the crash for me. After appliying this patch (with all > other debug