Re: [PATCH v3] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Michael Ellerman
On Wed, 2016-06-08 at 15:59 +0200, Peter Zijlstra wrote: > On Wed, Jun 08, 2016 at 11:49:20PM +1000, Michael Ellerman wrote: > > > > Ok; what tree does this go in? I have this dependent series which I'd > > > like to get sorted and merged somewhere. > > > > Ah sorry, I didn't realise. I was going

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

2016-06-09 Thread Christophe Leroy
Le 09/06/2016 à 08:01, Chris Smart a écrit : 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 emulate these

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

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 17:26 +1000, Michael Neuling wrote: > On Thu, 2016-06-09 at 16:02 +1000, 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. > > It's probably overkill but we could check in the

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 10:48 +0200, Christian Zigotzky wrote: > Shall I modify the workaround? Is the workaround for lack of the device > tree the problem? I don't think so. You could try this patch to try and isolate it: diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h

Re: [PATCH 00/21] Delete CURRENT_TIME and CURRENT_TIME_SEC macros

2016-06-09 Thread Felipe Balbi
Hi, Deepa Dinamani writes: > drivers/usb/gadget/function/f_fs.c | 2 +- > drivers/usb/gadget/legacy/inode.c | 2 +- for drivers/usb/gadget: Acked-by: Felipe Balbi -- balbi signature.asc Description: PGP

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

2016-06-09 Thread Michael Neuling
On Thu, 2016-06-09 at 16:02 +1000, 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. It's probably overkill but we could check in the signal handler that the sigbus was on the instruction we actually cared

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Christian Zigotzky
Shall I modify the workaround? Is the workaround for lack of the device tree the problem? FYI: The SB600 doesn't follow normal PCIe address decoding rules, as in its original use as an AMD south bridge it was designed to appear as if it were integrated into the north bridge. What shall I

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Christian Zigotzky
Michael, Thank you for your patch. I was able to compile the kernel but unfortunately it doesn't boot. Do you have another hint or patch for me? Thanks in advance, Christian On 09 June 2016 at 1:15 PM, Michael Ellerman wrote: On Thu, 2016-06-09 at 10:48 +0200, Christian Zigotzky wrote:

Re: [PATCH v5 08/11] powerpc/powernv: Add platform support for stop instruction

2016-06-09 Thread Shreyas B Prabhu
On 06/09/2016 10:12 AM, Sam Bobroff wrote: > On Thu, Jun 02, 2016 at 07:38:58AM -0500, Shreyas B. Prabhu wrote: > > ... > >> +/* Power Management - PSSCR Fields */ > > It might be nice to give the full name of the register, as below with the > FPSCR. > I'll make the change while posting

Re: [PATCH 8/8] dmaengine: Remove site specific OOM error messages on kzalloc

2016-06-09 Thread Lee Jones
On Wed, 08 Jun 2016, Linus Walleij wrote: > On Tue, Jun 7, 2016 at 7:38 PM, Peter Griffin > wrote: > > > If kzalloc() fails it will issue it's own error message including > > a dump_stack(). So remove the site specific error messages. > > > > Signed-off-by: Peter

Re: [PATCH] powerpc/mm: Use jump label to speed up radix_enabled check

2016-06-09 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt writes: > On Wed, 2016-04-27 at 12:30 +0530, Aneesh Kumar K.V wrote: >> Benjamin Herrenschmidt writes: >> >> > >> > On Wed, 2016-04-27 at 11:00 +1000, Balbir Singh wrote: >> > > >> > > Just basic testing across CPUs

Re: [PATCH v3] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Boqun Feng
On Thu, Jun 09, 2016 at 10:23:28PM +1000, Michael Ellerman wrote: > On Wed, 2016-06-08 at 15:59 +0200, Peter Zijlstra wrote: > > On Wed, Jun 08, 2016 at 11:49:20PM +1000, Michael Ellerman wrote: > > > > > > Ok; what tree does this go in? I have this dependent series which I'd > > > > like to get

[PATCH v1 3/3] microblaze/PCI: Remove useless __pci_mmap_set_pgprot()

2016-06-09 Thread Bjorn Helgaas
The microblaze __pci_mmap_set_pgprot() was apparently copied from powerpc, where it computes either an uncacheable pgprot_t or a write-combining one. But on microblaze, we always use the regular uncacheable pgprot_t. Remove the useless code in __pci_mmap_set_pgprot() and inline the

[PATCH 00/14] run seccomp after ptrace

2016-06-09 Thread Kees Cook
There has been a long-standing (and documented) issue with seccomp where ptrace can be used to change a syscall out from under seccomp. This is a problem for containers and other wider seccomp filtered environments where ptrace needs to remain available, as it allows for an escape of the seccomp

[PATCH 01/14] seccomp: add tests for ptrace hole

2016-06-09 Thread Kees Cook
One problem with seccomp was that ptrace could be used to change a syscall after seccomp filtering had completed. This was a well documented limitation, and it was recommended to block ptrace when defining a filter to avoid this problem. This can be quite a limitation for containers or other

[PATCH 09/14] MIPS/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Ralf Baechle Cc: "Maciej W. Rozycki" Cc: James Hogan Cc: linux-m...@linux-mips.org ---

[PATCH 03/14] x86/entry: Get rid of two-phase syscall entry work

2016-06-09 Thread Kees Cook
From: Andy Lutomirski I added two-phase syscall entry work back when the entry slow path was very slow. Nowadays, the entry slow path is fast and two-phase entry work serves no purpose. Remove it. Signed-off-by: Andy Lutomirski Signed-off-by: Kees Cook

[PATCH 08/14] arm64/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: linux-arm-ker...@lists.infradead.org ---

[PATCH 07/14] arm/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Russell King Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/kernel/ptrace.c | 11 ++- 1 file changed, 6 insertions(+), 5

[PATCH 05/14] seccomp: recheck the syscall after RET_TRACE

2016-06-09 Thread Kees Cook
When RET_TRACE triggers, a tracer may change a syscall into something that should be filtered by seccomp. This re-runs seccomp after a trace event to make sure things continue to pass. Signed-off-by: Kees Cook Cc: Andy Lutomirski --- kernel/seccomp.c |

[PATCH 04/14] seccomp: remove 2-phase API

2016-06-09 Thread Kees Cook
Since nothing is using the 2-phase API, and it adds more complexity than benefit, remove it. Signed-off-by: Kees Cook Cc: Andy Lutomirski --- include/linux/seccomp.h | 6 --- kernel/seccomp.c| 129

[PATCH 10/14] parisc/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-par...@vger.kernel.org --- arch/parisc/kernel/ptrace.c | 9 + 1 file

[PATCH 11/14] s390/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: linux-s...@vger.kernel.org --- arch/s390/kernel/ptrace.c | 21

[PATCH 02/14] seccomp: Add a seccomp_data parameter secure_computing()

2016-06-09 Thread Kees Cook
From: Andy Lutomirski Currently, if arch code wants to supply seccomp_data directly to seccomp (which is generally much faster than having seccomp do it using the syscall_get_xyz() API), it has to use the two-phase seccomp hooks. Add it to the easy hooks, too. Cc:

[PATCH 06/14] x86/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
This moves seccomp after ptrace on x86 to that seccomp can catch changes made by ptrace. Emulation should skip the rest of processing too. We can get rid of test_thread_flag because there's no longer any opportunity for seccomp to mess with ptrace state before invoking ptrace. Suggested-by: Andy

[PATCH v1 0/3] PCI: Clean up write combining usage for user mmap

2016-06-09 Thread Bjorn Helgaas via Linuxppc-dev
These patches: - Enforce a "no write combining on I/O port space mapping" policy. This seems like an obviously good thing but was previously enforced only by powerpc. - Stop giving powerpc users write combining mappings of prefetchable memory they ask for write combining with the

[PATCH v1 2/3] powerpc/pci: Remove __pci_mmap_set_pgprot()

2016-06-09 Thread Bjorn Helgaas
From: Yinghai Lu The powerpc-specific __pci_mmap_set_pgprot() does two things: 1) Disables write combining for I/O port space mappings This only affects procfs mappings. The pci_mmap_resource() sysfs path only requests write combining for resources with

Re: [PATCH v3] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 19:50 +0200, Peter Zijlstra wrote: > On Thu, Jun 09, 2016 at 10:23:28PM +1000, Michael Ellerman wrote: > > Unfortunately the patch isn't 100%. > > So what I'll do; since my patch is trying to ensure all implementations > of spin_unlock_wait() provide ACQUIRE semantics, and

[PATCH 12/14] powerpc/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org ---

Re: [PATCH v12 01/15] PCI: Let pci_mmap_page_range() take extra resource pointer

2016-06-09 Thread Yinghai Lu
On Wed, Jun 8, 2016 at 5:00 PM, Yinghai Lu wrote: > On Wed, Jun 8, 2016 at 3:35 PM, Yinghai Lu wrote: > >> At the same time, can you kill __pci_mmap_set_pgprot() for powerpc. > > Can you please put your two patches and this attached one into to pci/next? >

Re: [PATCH 05/14] seccomp: recheck the syscall after RET_TRACE

2016-06-09 Thread Andy Lutomirski
On Thu, Jun 9, 2016 at 2:01 PM, Kees Cook wrote: > When RET_TRACE triggers, a tracer may change a syscall into something that > should be filtered by seccomp. This re-runs seccomp after a trace event > to make sure things continue to pass. > > Signed-off-by: Kees Cook

Re: [PATCH 06/14] x86/ptrace: run seccomp after ptrace

2016-06-09 Thread Andy Lutomirski
On Thu, Jun 9, 2016 at 2:01 PM, Kees Cook wrote: > This moves seccomp after ptrace on x86 to that seccomp can catch changes > made by ptrace. Emulation should skip the rest of processing too. > > We can get rid of test_thread_flag because there's no longer any > opportunity

[PATCH 14/14] um/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Jeff Dike Cc: Richard Weinberger Cc: user-mode-linux-de...@lists.sourceforge.net --- arch/um/kernel/skas/syscall.c | 9 - 1

[PATCH 13/14] tile/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
Close the hole where ptrace can change a syscall out from under seccomp. Signed-off-by: Kees Cook Cc: Chris Metcalf --- arch/tile/kernel/ptrace.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH v12.update2 02/15] PCI: Let pci_mmap_page_range() take resource address

2016-06-09 Thread Yinghai Lu
In 8c05cd08a7 ("PCI: fix offset check for sysfs mmapped files"), try to check exposed value with resource start/end in proc mmap path. |start = vma->vm_pgoff; |size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; |pci_start = (mmap_api == PCI_MMAP_PROCFS) ? |

Re: [PATCH] powerpc/nohash: Fix build break with 4K pages

2016-06-09 Thread Scott Wood
On Wed, 2016-06-08 at 23:21 +1000, Michael Ellerman wrote: > Commit 74701d5947a6 "powerpc/mm: Rename function to indicate we are > allocating fragments" renamed page_table_free() to pte_fragment_free(). > One occurrence was mistyped as pte_fragment_fre(). > > This only breaks the nohash 4K page

Re: [4/6] powerpc/mm/hash: Compute the segment size correctly for ISA 3.0

2016-06-09 Thread Michael Ellerman
On Thu, 2016-19-05 at 07:54:30 UTC, "Aneesh Kumar K.V" wrote: > PowerISA 3.0 encodes the segment size in the second half of hash page > table entry. Update hpte_decode accordingly. > > Fixes: 50de596de8be ("powerpc/mm/hash: Add support for Power9 Hash") > > Signed-off-by: Aneesh Kumar K.V

Re: powerpc/mm/radix: Make the pid unsigned long

2016-06-09 Thread Michael Ellerman
On Thu, 2016-02-06 at 09:44:48 UTC, "Aneesh Kumar K.V" wrote: > Semantic Issue: comparison of constant 18446744073709551615 with > expression of type 'unsigned int' is always false. > > Signed-off-by: Aneesh Kumar K.V > Reviewed-by: Balbir Singh

Re: of: fix autoloading due to broken modalias with no 'compatible'

2016-06-09 Thread Michael Ellerman
On Mon, 2016-06-06 at 16:48:38 UTC, Wolfram Sang wrote: > Because of an improper dereference, a stray 'C' character was output to > the modalias when no 'compatible' was specified. This is the case for > some old PowerMac drivers which only set the 'name' property. Fix it to > let them match

Re: [PATCH] powerpc/nohash: Fix build break with 4K pages

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 20:53 -0500, Scott Wood wrote: > On Wed, 2016-06-08 at 23:21 +1000, Michael Ellerman wrote: > > Commit 74701d5947a6 "powerpc/mm: Rename function to indicate we are > > allocating fragments" renamed page_table_free() to pte_fragment_free(). > > One occurrence was mistyped as

Re: [PATCH] powerpc/mm: Use jump label to speed up radix_enabled check

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 21:28 +0530, Aneesh Kumar K.V wrote: > Benjamin Herrenschmidt writes: > > On Wed, 2016-04-27 at 12:30 +0530, Aneesh Kumar K.V wrote: > > So how early can we call jump_label_init() ? What is the reason why we > do the existing feature fixups in

Re: [PATCH v10 09/18] powerpc/powernv: Extend PCI bridge resources

2016-06-09 Thread Gavin Shan
On Wed, Jun 08, 2016 at 01:47:16PM +1000, Alexey Kardashevskiy wrote: >On 20/05/16 16:41, Gavin Shan wrote: >> The PCI slots are associated with root port or downstream ports >> of the PCIe switch connected to root port. When adapter is hot >> added to the PCI slot, it usually requests more IO or

Re: [PATCH 06/14] x86/ptrace: run seccomp after ptrace

2016-06-09 Thread Kees Cook
On Thu, Jun 9, 2016 at 3:52 PM, Andy Lutomirski wrote: > On Thu, Jun 9, 2016 at 2:01 PM, Kees Cook wrote: >> This moves seccomp after ptrace on x86 to that seccomp can catch changes >> made by ptrace. Emulation should skip the rest of processing too.

Re: [PATCH v3] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Boqun Feng
On Fri, Jun 10, 2016 at 01:25:03AM +0800, Boqun Feng wrote: > On Thu, Jun 09, 2016 at 10:23:28PM +1000, Michael Ellerman wrote: > > On Wed, 2016-06-08 at 15:59 +0200, Peter Zijlstra wrote: > > > On Wed, Jun 08, 2016 at 11:49:20PM +1000, Michael Ellerman wrote: > > > > > > > > Ok; what tree does

[PATCH v4] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Boqun Feng
There is an ordering issue with spin_unlock_wait() on powerpc, because the spin_lock primitive is an ACQUIRE and an ACQUIRE is only ordering the load part of the operation with memory operations following it. Therefore the following event sequence can happen: CPU 1 CPU 2

Re: [PATCH v10 09/18] powerpc/powernv: Extend PCI bridge resources

2016-06-09 Thread Alexey Kardashevskiy
On 10/06/16 14:33, Gavin Shan wrote: > On Wed, Jun 08, 2016 at 01:47:16PM +1000, Alexey Kardashevskiy wrote: >> On 20/05/16 16:41, Gavin Shan wrote: >>> The PCI slots are associated with root port or downstream ports >>> of the PCIe switch connected to root port. When adapter is hot >>> added to

Re: [PATCH] powerpc/mm: Use jump label to speed up radix_enabled check

2016-06-09 Thread Benjamin Herrenschmidt
On Fri, 2016-06-10 at 14:16 +1000, Michael Ellerman wrote: > > It depends what that function does. It might work now, but it could break > later > when someone changes the jump label code, and it might work on some platforms > but not others. > > That is *really* early. We haven't looked at the

Re: powerpc/pseries: start rtasd before PCI probing

2016-06-09 Thread Michael Ellerman
On Mon, 2016-23-05 at 08:28:28 UTC, Greg Kurz wrote: > A strange behaviour is observed when comparing PCI hotplug in QEMU, between > x86 and pseries. If you consider the following steps: > - start a VM > - add a PCI device via the QEMU monitor before the rtasd has started (for > example starting

Re: [PATCH v10 09/18] powerpc/powernv: Extend PCI bridge resources

2016-06-09 Thread Benjamin Herrenschmidt
On Fri, 2016-06-10 at 15:28 +1000, Alexey Kardashevskiy wrote: > > Actually, it's likely caused by hardware defect > > - we can't set 2GB (0x8000 - 0x) to RC's memory window. > > Otherwise, it *seems* the window is disabled. I tried updating the > > window with (0x8000 -

Re: [PATCH 2/5] selftests/powerpc: Add test to check TM ucontext creation

2016-06-09 Thread Cyril Bur
On Thu, 09 Jun 2016 15:12:51 +1000 Daniel Axtens wrote: As stated in the cover-letter, this patch needs the most work and quite a lot too. Turns out the comment you took is wrong (the code actually does the opposite), once again, just sent the series to get eyes on the actual

Re: [PATCH v3] powerpc: spinlock: Fix spin_unlock_wait()

2016-06-09 Thread Peter Zijlstra
On Thu, Jun 09, 2016 at 10:23:28PM +1000, Michael Ellerman wrote: > Unfortunately the patch isn't 100%. So what I'll do; since my patch is trying to ensure all implementations of spin_unlock_wait() provide ACQUIRE semantics, and this patch does indeed do so, is skip touching PPC entirely and hope

[PATCH v1 1/3] PCI: Ignore write combining when mapping I/O port space

2016-06-09 Thread Bjorn Helgaas
PCI exposes files like /proc/bus/pci/00/00.0 in procfs. These files support operations like this: ioctl(fd, PCIIOC_MMAP_IS_IO); # request I/O port space ioctl(fd, PCIIOC_WRITE_COMBINE, 1); # request write-combining mmap(fd, ...) Write combining is useful on PCI memory space,

Re: [PATCH] powerpc/mm: Use jump label to speed up radix_enabled check

2016-06-09 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt writes: > On Wed, 2016-04-27 at 12:30 +0530, Aneesh Kumar K.V wrote: >> Benjamin Herrenschmidt writes: >> >> > >> > On Wed, 2016-04-27 at 11:00 +1000, Balbir Singh wrote: >> > > >> > > Just basic testing across CPUs

[PATCH 1/2] powerpc: Send SIGBUS on unaligned copy and paste

2016-06-09 Thread Chris Smart
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 emulate these because paste may contain additional metadata when

Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-09 Thread Naveen N. Rao
On 2016/06/08 10:19PM, Nilay Vaish wrote: > Naveen, can you point out where in the patch you update the variable: > idx, a member of codegen_contex structure? Somehow I am unable to > figure it out. I can only see that we set it to 0 in the > bpf_int_jit_compile function. Since all your test

[PATCH 2/2] selftests/powerpc: Test unaligned copy and paste

2016-06-09 Thread Chris Smart
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 --- tools/testing/selftests/powerpc/Makefile | 3 +- .../testing/selftests/powerpc/alignment/.gitignore | 4 ++

Re: [PATCH V2 08/10] powerpc/mm: Clear top 16 bits of va only on older cpus

2016-06-09 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > As per ISA, we need to do this only for architecture version 2.02 and > earlier. This continued to work even for 2.07. But let's not do this for > anything after 2.02 > > Signed-off-by: Aneesh Kumar K.V

Re: [PATCH kernel 9/9] KVM: PPC: VFIO device: support SPAPR TCE

2016-06-09 Thread Alexey Kardashevskiy
On 23/03/16 14:03, David Gibson wrote: > On Tue, Mar 22, 2016 at 11:34:55AM +1100, Alexey Kardashevskiy wrote: >> Uff, lost cc: list. Added back. Some comments below. >> >> >> On 03/21/2016 04:19 PM, David Gibson wrote: >>> On Fri, Mar 18, 2016 at 11:12:26PM +1100, Alexey Kardashevskiy wrote: