Re: [PATCH RFC] powerpc/32: fix handling of stack protector with recent GCC

2017-01-18 Thread Christian Kujau
On Mon, 16 Jan 2017, Christophe Leroy wrote: > Christian, can you test it ? OK, so with that applied to v4.10-rc4, compilation still fails with GCC 4.9.2 and CC_STACKPROTECTOR_STRONG=y, see below. But it compiles just fine with CC_STACKPROTECTOR_REGULAR=y and boots to! Cross-compiling the same

[PATCH] powerpc: Ignore reserved field in DCSR and PVR reads and writes

2017-01-18 Thread Anton Blanchard
From: Anton Blanchard IBM bit 31 (for the rest of us - bit 0) is a reserved field in the instruction definition of mtspr and mfspr. Hardware is encouraged to (and does) ignore it. As a result, if userspace executes an mtspr DSCR with the reserved bit set, we get a DSCR facility unavailable excep

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Linus Torvalds
On Wed, Jan 18, 2017 at 2:37 PM, Ard Biesheuvel wrote: > > For a ballpark number of 10,000 CRCs in the core kernel, this would > increase the size of the image by 40 KB for 32-bit architectures (and > if saving 40 KB is essential, chances are you won't be using > modversions in the first place).

[PATCH] powerpc/powernv: Validate memcons descriptor and output buffer

2017-01-18 Thread Gavin Shan
Currently, it's assumed that memcons and its output buffer are included in the linear mapping. It's not true when "mem=384M" is included in bootargs. The system runs into kernel crash eventually. # od -x /proc/device-tree/ibm,opal/ibm,opal-memcons 000 0b30 0010 010 This

[PATCH v2] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-18 Thread Gavin Shan
In __eeh_clear_pe_frozen_state(), we should pass the flag's value instead of its address to eeh_unfreeze_pe(). The isolated flag is cleared if no error returned from __eeh_clear_pe_frozen_state(). We never observed the error from the function. So the isolated flag should have been always cleared, n

Re: [PATCH] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-18 Thread Gavin Shan
On Wed, Jan 18, 2017 at 04:49:58PM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >> In __eeh_clear_pe_frozen_state(), we should pass the flag's value >> instead of its address to eeh_unfreeze_pe(). This doesn't introduce >> any problems, but the code is just wrong. > >It means any caller th

[RFC PATCH] modversions: redefine kcrctab entries as relative CRC pointers

2017-01-18 Thread Ard Biesheuvel
The modversion symbol CRCs are emitted as ELF symbols, which allows us to easily populate the kcrctab sections by relying on the linker to associate each kcrctab slot with the correct value. This has a couple of downsides: - Given that the CRCs are treated as memory addresses, we waste 4 bytes f

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Ard Biesheuvel
On 18 January 2017 at 18:35, Linus Torvalds wrote: > On Wed, Jan 18, 2017 at 10:27 AM, Linus Torvalds > wrote: >> >> I wonder what happened to gold, and why it didn't take over. I'm >> assuming it had _other_ bugs.. Oh well. > > Google for gold problems, I note that it has been reported to get >

Re: [PATCH 30/37] dt-bindings: PCI: dra7xx: Add dt bindings to enable legacy mode

2017-01-18 Thread Rob Herring
On Thu, Jan 12, 2017 at 03:56:19PM +0530, Kishon Vijay Abraham I wrote: > Update device tree binding documentation of TI's dra7xx PCI > controller to include property for enabling legacy mode. > > Signed-off-by: Kishon Vijay Abraham I > --- > Documentation/devicetree/bindings/pci/ti-pci.txt |

Re: [PATCH 28/37] dt-bindings: PCI: dra7xx: Add dt bindings for pci dra7xx EP mode

2017-01-18 Thread Rob Herring
On Thu, Jan 12, 2017 at 03:56:17PM +0530, Kishon Vijay Abraham I wrote: > Add device tree binding documentation for pci dra7xx EP mode. > > Signed-off-by: Kishon Vijay Abraham I > --- > Documentation/devicetree/bindings/pci/ti-pci.txt | 37 > ++ > 1 file changed, 30 insert

Re: [PATCH 25/37] dt-bindings: PCI: Add dt bindings for pci designware EP mode

2017-01-18 Thread Rob Herring
On Thu, Jan 12, 2017 at 03:56:14PM +0530, Kishon Vijay Abraham I wrote: > Add device tree binding documentation for pci designware EP mode. > > Signed-off-by: Kishon Vijay Abraham I > --- > .../devicetree/bindings/pci/designware-pcie.txt| 26 > ++-- > 1 file changed, 18 in

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Linus Torvalds
On Wed, Jan 18, 2017 at 10:27 AM, Linus Torvalds wrote: > > I wonder what happened to gold, and why it didn't take over. I'm > assuming it had _other_ bugs.. Oh well. Google for gold problems, I note that it has been reported to get "internal error"s during kernel builds - and at least some of th

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Linus Torvalds
On Wed, Jan 18, 2017 at 5:52 AM, Ard Biesheuvel wrote: > > It turns out that this odd treatment of absolute symbols (i.e., > symbols having section number SHN_ABS) is a known issue in GNU ld > > https://sourceware.org/ml/binutils/2012-05/msg00019.html Ugh. I hate the GNU linker. It's slow, it doe

Re: [PATCH v4 2/3] powerpc/reloc64: add support for 32-bit CRC pseudo-symbols

2017-01-18 Thread Ard Biesheuvel
On 17 January 2017 at 19:26, Ard Biesheuvel wrote: > In preparation of modifying the core modversions code to emit the CRCs > as 32-bit quantities, ensure that 64-bit PowerPC will be able to deal > with this when CONFIG_RELOCATABLE=y, in which case the CRCs will be > emitted into the final ELF bin

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Ard Biesheuvel
On 18 January 2017 at 11:37, Ard Biesheuvel wrote: > On 17 January 2017 at 23:47, Linus Torvalds > wrote: >> On Tue, Jan 17, 2017 at 11:26 AM, Ard Biesheuvel >> wrote: >>> The modversion symbol CRCs are emitted as ELF symbols, which allows us to >>> easily populate the kcrctab sections by relyin

Re: [v2] powerpc/perf: use MSR to report privilege level on P9 DD1

2017-01-18 Thread Michael Ellerman
On Wed, 2017-01-18 at 03:42:56 UTC, Madhavan Srinivasan wrote: > Since SIER and SIAR updates are not valid for some > samples, patch forces the use of MSR and regs->nip instead > for misc_flag updates. This is done by adding a new ppmu > flag and updating user_siar value in perf_read_regs() accordi

Re: selftest/powerpc: Wrong PMC initialized in pmc56_overflow test

2017-01-18 Thread Michael Ellerman
On Mon, 2016-12-19 at 12:16:53 UTC, Madhavan Srinivasan wrote: > Test uses PMC2 to count the event. But PMC1 is being initialized. > Patch to fix it. > > Fixes: 3752e453f6ba ('selftests/powerpc: Add tests of PMU EBBs') > Signed-off-by: Madhavan Srinivasan Applied to powerpc fixes, thanks. https

Re: powerpc: fix pgtable pmd cache init

2017-01-18 Thread Michael Ellerman
On Tue, 2017-01-03 at 15:55:17 UTC, Nicholas Piggin wrote: > Commit 9b081e10805cd ("powerpc: port 64 bits pgtable_cache to 32 bits") > mixed up PMD_INDEX_SIZE and PMD_CACHE_INDEX a couple of times. This > resulted in 64s/hash/4k configs to panic at boot with a false positive > error check. > > Fix

Re: powerpc/icp-opal: Fix missing KVM case and harden replay

2017-01-18 Thread Michael Ellerman
On Mon, 2017-01-16 at 17:58:53 UTC, Benjamin Herrenschmidt wrote: > The icp-opal call is missing the code from icp-native to recover > interrupts snatched by KVM. Without that, when running KVM, we can > get into a situation where an interrupt is lost and the CPU stuck > with an elevated CPPR. > >

Re: powerpc/mm: fix memory hotplug BUG() on radix

2017-01-18 Thread Michael Ellerman
On Tue, 2017-01-03 at 20:39:51 UTC, Reza Arbab wrote: > Memory hotplug is leading to hash page table calls, even on radix: > > ... > arch_add_memory > create_section_mapping > htab_bolt_mapping > BUG_ON(!ppc_md.hpte_insert); >

Re: powerpc/mm: Fix little-endian 4K hugetlb

2017-01-18 Thread Michael Ellerman
On Wed, 2016-12-14 at 04:37:53 UTC, "Aneesh Kumar K.V" wrote: > When we switched to big endian page table, we never updated > the hugepd format such that it can work for both big endian and > little endian config. This patch series update hugepd format > such that it is looked at as __be64 value in

Re: powerpc/eeh: Enable IO path on permanent error

2017-01-18 Thread Michael Ellerman
On Thu, 2017-01-05 at 23:39:49 UTC, Gavin Shan wrote: > We give up recovery on permanent error, simply shutdown the affected > devices and remove them. If the devices can't be put into quiet state, > they spew more traffic that is likely to cause another unexpected EEH > error. This was observed on

Re: powerpc/mm/hugetlb: Don't panic if we don't find the default huge page size

2017-01-18 Thread Michael Ellerman
On Tue, 2016-12-13 at 14:04:11 UTC, "Aneesh Kumar K.V" wrote: > generic hugetlbfs can handle that condition correctly. With HPAGE_SHIFT = 0 > we get > [0.241333] hugetlbfs: disabling because there are no supported hugepage sizes > > bash-4.2# echo 30 > /proc/sys/vm/nr_hugepages > bash: echo: write

Re: [2/2] powerpc/perf: fix PM_BR_CMPL event code for power9

2017-01-18 Thread Michael Ellerman
On Mon, 2017-01-09 at 13:30:15 UTC, Madhavan Srinivasan wrote: > Use 0x10012 event code for PM_BR_CMPL event in > power9 event list instead of current 0x40060. > > Fixes:34922527a2bcb ('powerpc/perf: Add power9 event list macros for generic > and cache events') > Signed-off-by: Madhavan Srinivasa

Re: [PATCH v4 3/3] modversions: treat symbol CRCs as 32 bit quantities on 64 bit archs

2017-01-18 Thread Ard Biesheuvel
On 17 January 2017 at 23:47, Linus Torvalds wrote: > On Tue, Jan 17, 2017 at 11:26 AM, Ard Biesheuvel > wrote: >> The modversion symbol CRCs are emitted as ELF symbols, which allows us to >> easily populate the kcrctab sections by relying on the linker to associate >> each kcrctab slot with the c