Re: [v2,1/2] refactor code parsing size based on memory range

2016-07-05 Thread Hari Bathini
On 07/05/2016 10:48 AM, Michael Ellerman wrote: On 06/24/2016 10:56 AM, Michael Ellerman wrote: On Wed, 2016-22-06 at 19:25:26 UTC, Hari Bathini wrote: ... While the code is moved to kernel/params.c file, there is no change in logic for crashkernel parameter parsing as the moved code is invo

Re: [RFC] arm64: kexec_file_load support

2016-07-05 Thread AKASHI Takahiro
Hi Dave, On Tue, Jul 05, 2016 at 09:25:56AM +0800, Dave Young wrote: > On 07/04/16 at 03:58pm, AKASHI Takahiro wrote: > > Hi, > > > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > > Am Freitag, 01 Juli 2016, 14:11:12 schrieb AKASHI Takahiro: > > > > I'm not sure wheth

Re: [RFC] arm64: kexec_file_load support

2016-07-05 Thread AKASHI Takahiro
On Mon, Jul 04, 2016 at 07:50:19PM -0300, Thiago Jung Bauermann wrote: > Hello, > > Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro: > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > > I agree that it would be better if we could have a system call where a > >

Re: [v3] powerpc/boot: Add OPAL console to epapr wrappers

2016-07-05 Thread Michael Ellerman
On Thu, 2016-30-06 at 14:34:37 UTC, Oliver O'Halloran wrote: > This patch adds an OPAL console backend to the powerpc boot wrapper so > that decompression failures inside the wrapper can be reported to the > user. This is important since it typically indicates data corruption in > the firmware and

Re: [RESEND, v2] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-05 Thread Simon Guo
Hi Michael, On Tue, Jul 05, 2016 at 03:40:40PM +1000, Michael Ellerman wrote: > On Wed, 2016-06-04 at 07:00:12 UTC, Simon Guo wrote: > > These 2 fields track whether user process has used Altivec/VSX > > registers or not. They are used by kernel to setup signal frame > > on user stack correctly reg

[PATCH v3] cxl: Refine slice error debug messages

2016-07-05 Thread Philippe Bergheaud
The PSL Slice Error Register (PSL_SERR_An) reports implementation dependent AFU errors, in the form of a bitmap. The PSL_SERR_An register content is printed in the form of hex dump debug message. This patch decodes the PSL_ERR_An register contents, and prints a specific error message for each poss

Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check

2016-07-05 Thread Wanpeng Li
Hi Xinhui, 2016-06-28 22:43 GMT+08:00 Pan Xinhui : > This is to fix some lock holder preemption issues. Some other locks > implementation do a spin loop before acquiring the lock itself. Currently > kernel has an interface of bool vcpu_is_preempted(int cpu). It take the cpu > as parameter and retur

RE: [PATCH 2/2] qe/ic: refactor qe_ic to simplify

2016-07-05 Thread Qiang Zhao
On 07/05/2016 11:51 AM, Jason Cooper wrote: > -Original Message- > From: Jason Cooper [mailto:ja...@lakedaemon.net] > Sent: Tuesday, July 05, 2016 11:51 AM > To: Qiang Zhao > Cc: o...@buserror.net; t...@linutronix.de; marc.zyng...@arm.com; linuxppc- > d...@lists.ozlabs.org; linux-ker...@

RE: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip

2016-07-05 Thread Qiang Zhao
On 07/05/2016 11:19 AM, Jason Cooper wrote: > -Original Message- > From: Jason Cooper [mailto:ja...@lakedaemon.net] > Sent: Tuesday, July 05, 2016 11:19 AM > To: Qiang Zhao > Cc: o...@buserror.net; t...@linutronix.de; marc.zyng...@arm.com; linuxppc- > d...@lists.ozlabs.org; linux-ker...@v

Re: [PATCH] powerpc: fix oops in pcibios_release_device() after pcibios_free_controller()

2016-07-05 Thread Mauricio Faria de Oliveira
On 07/04/2016 11:55 PM, Benjamin Herrenschmidt wrote: Have you considered instead adding a kref to the PHB and only freeing it when all devices have been freed ? Or it's too hard to tract device creation ? Yes, considered it, but felt leery of possibly leaving the PHB unfreed (or block until it

Re: [PATCH 2/2] qe/ic: refactor qe_ic to simplify

2016-07-05 Thread Jason Cooper
Morning! On Tue, Jul 05, 2016 at 07:38:49AM +, Qiang Zhao wrote: > On 07/05/2016 11:51 AM, Jason Cooper wrote: > > On Tue, Jul 05, 2016 at 09:46:59AM +0800, Zhao Qiang wrote: ... > > > > > > Signed-off-by: Zhao Qiang > > > --- > > > drivers/irqchip/qe_ic.c| 83 > > > +++

Re: [v2,1/2] powerpc: Send SIGBUS on unaligned copy and paste

2016-07-05 Thread Michael Ellerman
On Thu, 2016-16-06 at 23:33:45 UTC, Chris Smart wrote: > Calling ISA 3.0 instructions copy, copy_first, paste and paste_last > generates an alignment fault when copying or pasting unaligned > data (128 byte). We catch this and send SIGBUS to the userspace > process that caused it. > > We do not em

Re: [1/2] selftests/powerpc: benchmarks/context_switch.c improve usage message

2016-07-05 Thread Michael Ellerman
On Thu, 2016-03-03 at 23:06:39 UTC, Cyril Bur wrote: > Signed-off-by: Cyril Bur Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/94fa56a96a39914551694673fd cheers ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lis

Re: [1/6] powerpc/perf: factor out power8 pmu macros and defines

2016-07-05 Thread Michael Ellerman
On Sun, 2016-26-06 at 17:37:04 UTC, Madhavan Srinivasan wrote: > Factor out some of the power8 pmu macros to > new a header file to share with power9 pmu code. > Just code movement and no logic change. > > Signed-off-by: Madhavan Srinivasan Series applied to powerpc next, thanks. https://git.ke

Re: [2/2] selftests/powerpc: benchmarks/context_switch.c use vector instructions/types

2016-07-05 Thread Michael Ellerman
On Thu, 2016-03-03 at 23:06:40 UTC, Cyril Bur wrote: > Currently it doesn't appear the resulting binary actually uses any Altivec > or VSX instructions the solution is to explicitly tell GCC to use vector > instructions and use vector types in the code. > > Part of this this issue can be GCC versi

Re: [v2,2/2] selftests/powerpc: Test unaligned copy and paste

2016-07-05 Thread Michael Ellerman
On Thu, 2016-16-06 at 23:34:47 UTC, Chris Smart wrote: > Test that an ISA 3.0 compliant machine performing an unaligned copy, > copy_first, paste or paste_last is sent a SIGBUS. > > Signed-off-by: Chris Smart Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/4375088072295b09cc5d

Re: [v2] powerpc/mm: Add a parameter to disable 1TB segs

2016-07-05 Thread Michael Ellerman
On Tue, 2016-05-07 at 01:43:21 UTC, Oliver O'Halloran wrote: > This patch adds the kernel command line parameter "no_tb_segs" which > forces the kernel to use 256MB rather than 1TB segments. Forcing the use > of 256MB segments makes it considerably easier to test code that depends > on an SLB miss

Re: [v3] powerpc/boot: Add OPAL console to epapr wrappers

2016-07-05 Thread Michael Ellerman
On Thu, 2016-30-06 at 14:34:37 UTC, Oliver O'Halloran wrote: > This patch adds an OPAL console backend to the powerpc boot wrapper so > that decompression failures inside the wrapper can be reported to the > user. This is important since it typically indicates data corruption in > the firmware and

Re: powerpc/rtas: fix array overrun in ppc_rtas() syscall

2016-07-05 Thread Michael Ellerman
On Fri, 2016-18-03 at 06:36:33 UTC, Andrew Donnellan wrote: > If ppc_rtas() is called with args.nargs == 16 and args.nret == 0, args.rets > is set to point to &args.args[16], which is beyond the end of the args.args > array. This results in a minor read overrun of the array when we check the > firs

Re: powerpc/pseries: fix error return value in cmm_mem_going_offline

2016-07-05 Thread Michael Ellerman
On Tue, 2016-08-03 at 21:26:17 UTC, Rasmus Villemoes wrote: > cmm_mem_going_offline is (only) called from cmm_memory_cb(), which > sends the return value through notifier_from_errno(). The latter > expects 0 or -errno (notifier_to_errno(notifier_from_errno(x)) is 0 > for any x >= 0, so passing a po

Re: powerpc: Avoid -maltivec when using clang integrated assembler

2016-07-05 Thread Michael Ellerman
On Wed, 2015-25-11 at 23:45:49 UTC, Anton Blanchard wrote: > Check the assembler supports -maltivec by wrapping it with > call as-option. > > Signed-off-by: Anton Blanchard Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/9ddf0075f9184f1e1dabf7bfea cheers _

Re: [v6] powerpc/timer - large decrementer support

2016-07-05 Thread Michael Ellerman
On Fri, 2016-01-07 at 06:20:39 UTC, Oliver O'Halloran wrote: > Power ISAv3 adds a large decrementer (LD) mode which increases the size > of the decrementer register. The size of the enlarged decrementer > register is between 32 and 64 bits with the exact size being dependent > on the implementation

Re: selftests/powerpc: Import Anton's mmap & futex micro benchmarks

2016-07-05 Thread Michael Ellerman
On Thu, 2016-02-06 at 12:02:01 UTC, Michael Ellerman wrote: > These are useful little loops for smoke testing performance. > > Signed-off-by: Michael Ellerman Applied to powerpc next. https://git.kernel.org/powerpc/c/0c63e8b7b97fb72ef38c8edbfb cheers ___

Re: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip

2016-07-05 Thread Jason Cooper
On Tue, Jul 05, 2016 at 07:27:21AM +, Qiang Zhao wrote: > On 07/05/2016 11:19 AM, Jason Cooper wrote: > > -Original Message- > > From: Jason Cooper [mailto:ja...@lakedaemon.net] > > Sent: Tuesday, July 05, 2016 11:19 AM > > To: Qiang Zhao > > Cc: o...@buserror.net; t...@linutronix.de;

Re: selftests/powerpc: PMU libs: use signed long to read perf_event_paranoid

2016-07-05 Thread Michael Ellerman
On Tue, 2016-01-03 at 04:26:36 UTC, Cyril Bur wrote: > Excerpt from man 2 perf_event_open: > > /proc/sys/kernel/perf_event_paranoid > The perf_event_paranoid file can be set to restrict access to the > performance counters. > 2 allow only user-space measurements. > 1 allow both kernel

Re: [PATCH 2/2] crypto: powerpc: Add POWER8 optimised crc32c

2016-07-05 Thread Herbert Xu
On Fri, Jul 01, 2016 at 08:19:45AM +1000, Anton Blanchard wrote: > From: Anton Blanchard > > Use the vector polynomial multiply-sum instructions in POWER8 to > speed up crc32c. > > This is just over 41x faster than the slice-by-8 method that it > replaces. Measurements on a 4.1 GHz POWER8 show i

Re: [PATCH v3] cxl: Refine slice error debug messages

2016-07-05 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip

2016-07-05 Thread Qiang Zhao
On 07/05/2016 11:19 AM, Jason Cooper wrote: > -Original Message- > From: Jason Cooper [mailto:ja...@lakedaemon.net] > Sent: Tuesday, July 05, 2016 10:22 PM > To: Qiang Zhao > Cc: o...@buserror.net; t...@linutronix.de; marc.zyng...@arm.com; linuxppc- > d...@lists.ozlabs.org; linux-ker...@

Re: [PATCH 02/14] cxl: Add cxl_slot_is_supported API

2016-07-05 Thread Andrew Donnellan
On 04/07/16 23:22, Ian Munsie wrote: From: Ian Munsie This extends the check that the adapter is in a CAPI capable slot so that it may be called by external users in the kernel API. This will be used by the upcoming Mellanox CX4 support, which needs to know ahead of time if the card can be swit

Re: [PATCH 01/14] powerpc/powernv: Split cxl code out into a separate file

2016-07-05 Thread Andrew Donnellan
On 04/07/16 23:21, Ian Munsie wrote: From: Ian Munsie The support for using the Mellanox CX4 in cxl mode will require additions to the PHB code. In preparation for this, move the existing cxl code out of pci-ioda.c into a separate pci-cxl.c file to keep things more organised. Signed-off-by: Ia

Re: [PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

2016-07-05 Thread Andrew Donnellan
On 04/07/16 23:22, Ian Munsie wrote: +static int setup_cxl_protocol_area(struct pci_dev *dev) +{ + u8 val; + int rc; + int vsec = find_cxl_vsec(dev); + + if (!vsec) { + dev_info(&dev->dev, "CXL VSEC not found\n"); + return -ENODEV; + } + +

Re: [PATCH 03/14] cxl: Enable bus mastering for devices using CAPP DMA mode

2016-07-05 Thread Andrew Donnellan
On 04/07/16 23:22, Ian Munsie wrote: From: Ian Munsie Devices that use CAPP DMA mode (such as the Mellanox CX4) require bus master to be enabled in order for the CAPI traffic to flow. This should be harmless to enable for other cxl devices, so unconditionally enable it in the adapter init flow.

[RFC/PATCH 1/4] powerpc/64/kexec: NULL check "clear_all" in kexec_sequence

2016-07-05 Thread Benjamin Herrenschmidt
With Radix, it can be NULL even on !BOOKE these days so replace the ifdef with a NULL check which is cleaner anyway. Signed-off-by: Benjamin Herrenschmidt --- Currently only compile tested arch/powerpc/kernel/misc_64.S | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/a

[RFC/PATCH 2/4] powerpc/64/kexec: Fix MMU cleanup on radix

2016-07-05 Thread Benjamin Herrenschmidt
Just using the hash ops won't work anymore since radix will have NULL in there. Instead create an mmu_cleanup_all() function which will do the right thing based on the MMU mode. For Radix, for now I clear UPRT and the PTCR, effectively switching back to Radix with no partition table setup. Curren

[RFC/PATCH 3/4] powerpc/64/kexec: Copy image with MMU off when possible

2016-07-05 Thread Benjamin Herrenschmidt
Currently we turn the MMU off after copying the image, and we make sure there is no overlap between the hash table and the target pages in that case. That doesn't work for Radix however. In that case, the page tables are scattered and we can't really enforce that the target of the image isn't over

[RFC/PATCH 4/4] powerpc/64/kexec: Remove BookE special default_machine_kexec_prepare()

2016-07-05 Thread Benjamin Herrenschmidt
The only difference is now the TCE table check which doesn't need to be ifdef'ed out, it will basically do nothing on BookE (it is only useful for ancient IBM machines). Signed-off-by: Benjamin Herrenschmidt --- Currently only compile tested arch/powerpc/kernel/machine_kexec_64.c | 16 -

Re: [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-05 Thread Sam Bobroff
On Tue, Jul 05, 2016 at 04:05:58PM +1000, David Gibson wrote: > On Tue, Jul 05, 2016 at 03:19:23PM +1000, Sam Bobroff wrote: > > Signed-off-by: Sam Bobroff > > Ok, so the usual procedure for updates to linux-headers is this: >1. Get the change merged on the kernel side > >2. Use scripts/

Re: [PATCH 11/14] cxl: Workaround PE=0 hardware limitation in Mellanox CX4

2016-07-05 Thread Andrew Donnellan
On 04/07/16 23:22, Ian Munsie wrote: From: Ian Munsie The CX4 card cannot cope with a context with PE=0 due to a hardware limitation, resulting in: [ 34.166577] command failed, status limits exceeded(0x8), syndrome 0x5a7939 [ 34.166580] mlx5_core :01:00.1: Failed allocating uar, aborti

[PATCH] powerpc/tm: Fix stack pointer corruption in __tm_recheckpoint

2016-07-05 Thread Michael Neuling
At the start of __tm_recheckpoint we save the kernel stack pointer (r1) in SPRG SCRATCH0 (SPRG2) so that we can restore it after the trecheckpoint. Unfortunately, the same SPRG is used in the SLB miss handler. If an SLB miss is taken between the save and restore of r1 to the SPRG, the SPRG is cha

Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check

2016-07-05 Thread xinhui
Hi, wanpeng On 2016年07月05日 17:57, Wanpeng Li wrote: Hi Xinhui, 2016-06-28 22:43 GMT+08:00 Pan Xinhui : This is to fix some lock holder preemption issues. Some other locks implementation do a spin loop before acquiring the lock itself. Currently kernel has an interface of bool vcpu_is_preempted(

Re: [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-05 Thread David Gibson
On Wed, Jul 06, 2016 at 02:41:52PM +1000, Sam Bobroff wrote: > On Tue, Jul 05, 2016 at 04:05:58PM +1000, David Gibson wrote: > > On Tue, Jul 05, 2016 at 03:19:23PM +1000, Sam Bobroff wrote: > > > Signed-off-by: Sam Bobroff > > > > Ok, so the usual procedure for updates to linux-headers is this: >

[PATCH] selftests/powerpc: Use "Delta" rather than "Error" in normal output

2016-07-05 Thread Michael Ellerman
Use "Delta" to refer to the difference between measurements, rather than "Error", so scripts that look for "Error" aren't confused into thinking there was a failure. Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/pmu/ebb/instruction_count_test.c | 2 +- 1 file changed, 1 ins

[PATCH v2 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-05 Thread Sam Bobroff
There are a few issues with our handling of the ibm,pa-features HTM bit: - We don't support transactional memory in PR KVM, so don't tell the OS that we do. - In full emulation we have a minimal implementation of HTM that always fails, so for performance reasons lets not tell the OS that we

[PATCH v2 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-05 Thread Sam Bobroff
Signed-off-by: Sam Bobroff --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index e60e21b..37cb3e8 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -866,6 +866,7 @@ struct kvm_ppc_smmu_

[PATCH v2 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-05 Thread Sam Bobroff
Advertise HTM support in ibm, pa-features if KVM indicates support when queried via a new capability (KVM_CAP_PPC_HTM). If KVM returns false for the capability (which may indicate that the host kernel doesn't support the capability itself) attempt to determine availability using a fallback method

[PATCH v2 0/3] Rework spapr: Better handling of ibm, pa-features TM bit

2016-07-05 Thread Sam Bobroff
Here's version 2. Changes v1 -> v2: Patch 2/3: spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM * Improve readability of HTM bit set code. * Move the test for KVM into kvmppc_get_htm_support(). Sam Bobroff (3): spapr: Disable ibm, pa-features HTM bit Add KVM_CAP_PPC_HTM to linux/kvm.h

[PATCH 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-05 Thread Sam Bobroff
Introduce a new KVM capability, KVM_CAP_PPC_HTM, that can be queried to determine if a PowerPC KVM guest should use HTM (Hardware Transactional Memory). This will be used by QEMU to populate the pa-features bits in the guest's device tree. Signed-off-by: Sam Bobroff --- arch/powerpc/kvm/powerp

[PATCH v2 1/2] irqchip/qeic: merge qeic init code from platforms to a common function

2016-07-05 Thread Zhao Qiang
The codes of qe_ic init from a variety of platforms are redundant, merge them to a common function and put it to irqchip/qe_ic.c For non-p1021_mds mpc85xx_mds boards, use "qe_ic_init(np, 0, qe_ic_cascade_low_mpic, qe_ic_cascade_high_mpic);" instead of "qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, N

[PATCH v2 1/2] irqchip/qeic: merge qeic init code from platforms to a common function

2016-07-05 Thread Zhao Qiang
The codes of qe_ic init from a variety of platforms are redundant, merge them to a common function and put it to irqchip/qe_ic.c For non-p1021_mds mpc85xx_mds boards, use "qe_ic_init(np, 0, qe_ic_cascade_low_mpic, qe_ic_cascade_high_mpic);" instead of "qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, N

[PATCH v2 2/2] irqchip/qeic: merge qeic_of_init into qe_ic_init

2016-07-05 Thread Zhao Qiang
qeic_of_init just get device_node of qeic from dtb and call qe_ic_init, pass the device_node to qe_ic_init. So merge qeic_of_init into qe_ic_init to get the qeic node in qe_ic_init. Signed-off-by: Zhao Qiang --- Changes for v2: - modify subject and commit msg - return 0 and add pu

Re: [PATCH v2 2/4] powerpc/spinlock: support vcpu preempted check

2016-07-05 Thread Wanpeng Li
Cc Paolo, kvm ml 2016-07-06 12:58 GMT+08:00 xinhui : > Hi, wanpeng > > On 2016年07月05日 17:57, Wanpeng Li wrote: >> >> Hi Xinhui, >> 2016-06-28 22:43 GMT+08:00 Pan Xinhui : >>> >>> This is to fix some lock holder preemption issues. Some other locks >>> implementation do a spin loop before acquiring t

Re: [PATCH v2 0/4] implement vcpu preempted check

2016-07-05 Thread Peter Zijlstra
On Tue, Jun 28, 2016 at 10:43:07AM -0400, Pan Xinhui wrote: > change fomr v1: > a simplier definition of default vcpu_is_preempted > skip mahcine type check on ppc, and add config. remove dedicated macro. > add one patch to drop overload of rwsem_spin_on_owner and > mutex_spin_on