Re: [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode

2016-04-04 Thread David Gibson
On Tue, Apr 05, 2016 at 12:12:01PM +1000, Paul Mackerras wrote: > On Mon, Apr 04, 2016 at 09:09:28PM +1000, Anton Blanchard wrote: > > We don't support transactional memory in PR KVM, so don't tell > > the OS that we do. > > This assumes PR KVM won't ever support TM, which is hopefully not > true.

Re: [PATCH 03/65] powerpc/mm/subpage: Clear RWX bit to indicate no access

2016-04-04 Thread Balbir Singh
On 05/04/16 00:59, Aneesh Kumar K.V wrote: > Balbir Singh writes: > >> [ text/plain ] >> >> >> On 27/03/16 19:23, Aneesh Kumar K.V wrote: >>> Subpage protection used to depend on _PAGE_USER bit to implement no >>> access mode. This patch switch that to use _PAGE_RWX. We clear READ, >>> Write and

Re: [PATCH 02/65] powerpc/mm: use _PAGE_READ to indicate Read access

2016-04-04 Thread Balbir Singh
On 05/04/16 00:55, Aneesh Kumar K.V wrote: > Balbir Singh writes: > >> [ text/plain ] >> >> >> On 27/03/16 19:23, Aneesh Kumar K.V wrote: >>> This split _PAGE_RW bit to _PAGE_READ and _PAGE_WRITE. It also remove >>> the dependency on _PAGE_USER for implying read only. Few things to note >>> here

Re: [PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode

2016-04-04 Thread Paul Mackerras via Linuxppc-dev
On Mon, Apr 04, 2016 at 09:09:28PM +1000, Anton Blanchard wrote: > We don't support transactional memory in PR KVM, so don't tell > the OS that we do. This assumes PR KVM won't ever support TM, which is hopefully not true. If PR KVM does get TM support in future, then QEMU will have no clear way

Re: [PATCH] powerpc: Clear user CPU feature bits if TM is disabled at runtime

2016-04-04 Thread David Gibson
On Mon, Apr 04, 2016 at 09:11:12PM +1000, Anton Blanchard wrote: > In check_cpu_pa_features() we check a number of bits in the > ibm,pa-features array and set and clear CPU features based on what > we find. One of these bits is CPU_FTR_TM, the transactional memory > feature bit. > > If this does d

[PATCH V2 3/5] powerpc: Fix SPR leak across exec() syscalls

2016-04-04 Thread Cyril Bur
Currently start_thread() doesn't sanitise TAR nor the VRSAVE. The TAR SPR can be set and branched to, not sanitising it presents an information leak to the new executable. The VRSAVE SPR can be used by both application and operating system. The PowerISA states (in a programming note) that an appl

[PATCH V2 2/5] selftests/powerpc: Add fork() test to check for spr being preserved

2016-04-04 Thread Cyril Bur
Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/syscalls/Makefile | 3 +- .../testing/selftests/powerpc/syscalls/spr_fork.c | 78 ++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/powerpc/syscalls/spr_fork.c diff -

[PATCH V2 5/5] powerpc: Preserve the SPR values across fork() syscalls

2016-04-04 Thread Cyril Bur
Currently copy_thread() doesn't flush SPRs to the parent thread struct. Currently this only affects the TAR register as perf takes care of some of the others and the remaining ones are all Event Based Branch (EBB) registers which are cleared across fork(). Signed-off-by: Cyril Bur --- arch/power

[PATCH V2 4/5] powerpc: Move flush_all_to_thread() below save_sprs()

2016-04-04 Thread Cyril Bur
Signed-off-by: Cyril Bur --- arch/powerpc/kernel/process.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 56444a6..7625976 100644 --- a/arch/powerpc/kernel/process.c +++ b

[PATCH V2 1/5] selftests/powerpc: Add exec() test to check for spr sanitisation

2016-04-04 Thread Cyril Bur
Signed-off-by: Cyril Bur --- tools/testing/selftests/powerpc/syscalls/Makefile | 3 +- .../testing/selftests/powerpc/syscalls/spr_exec.c | 78 ++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/powerpc/syscalls/spr_exec.c diff -

Re: [PATCHv2 net 3/3] samples/bpf: Enable powerpc support

2016-04-04 Thread Alexei Starovoitov
On Mon, Apr 04, 2016 at 10:31:34PM +0530, Naveen N. Rao wrote: > Add the necessary definitions for building bpf samples on ppc. > > Since ppc doesn't store function return address on the stack, modify how > PT_REGS_RET() and PT_REGS_FP() work. > > Also, introduce PT_REGS_IP() to access the instru

Re: [PATCHv2 net 2/3] samples/bpf: Use llc in PATH, rather than a hardcoded value

2016-04-04 Thread Alexei Starovoitov
On Mon, Apr 04, 2016 at 10:31:33PM +0530, Naveen N. Rao wrote: > While at it, remove the generation of .s files and fix some typos in the > related comment. > > Cc: Alexei Starovoitov > Cc: David S. Miller > Cc: Daniel Borkmann > Cc: Ananth N Mavinakayanahalli > Cc: Michael Ellerman > Signed-

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

2016-04-04 Thread Naveen N. Rao
On 2016/04/01 08:34PM, Daniel Borkmann wrote: > On 04/01/2016 08:10 PM, Alexei Starovoitov wrote: > >On 4/1/16 2:58 AM, Naveen N. Rao wrote: > >>PPC64 eBPF JIT compiler. Works for both ABIv1 and ABIv2. > >> > >>Enable with: > >>echo 1 > /proc/sys/net/core/bpf_jit_enable > >>or > >>echo 2 > /proc/sy

[PATCHv2 net 3/3] samples/bpf: Enable powerpc support

2016-04-04 Thread Naveen N. Rao
Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: David S. M

[PATCHv2 net 2/3] samples/bpf: Use llc in PATH, rather than a hardcoded value

2016-04-04 Thread Naveen N. Rao
While at it, remove the generation of .s files and fix some typos in the related comment. Cc: Alexei Starovoitov Cc: David S. Miller Cc: Daniel Borkmann Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Signed-off-by: Naveen N. Rao --- v2: removed generation of .s files samples/bpf/Makef

[PATCHv2 net 1/3] samples/bpf: Fix build breakage with map_perf_test_user.c

2016-04-04 Thread Naveen N. Rao
Building BPF samples is failing with the below error: samples/bpf/map_perf_test_user.c: In function ‘main’: samples/bpf/map_perf_test_user.c:134:9: error: variable ‘r’ has initializer but incomplete type struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; ^ samples/bpf/map_perf_test_user.

Re: [PATCH 04/65] powerpc/mm: Use pte_user instead of opencoding

2016-04-04 Thread Aneesh Kumar K.V
Balbir Singh writes: > [ text/plain ] > > > On 27/03/16 19:23, Aneesh Kumar K.V wrote: >> We have common declaration in pte-common.h Add book3s specific one >> and switch to pte_user. In the later patch we will be switching >> _PAGE_USER to _PAGE_PRIVILEGED >> >> Signed-off-by: Aneesh Kumar K.V

Re: [PATCH 01/65] powerpc/mm: Use big endian page table for book3s 64

2016-04-04 Thread Aneesh Kumar K.V
Balbir Singh writes: > [ text/plain ] > > On 27/03/16 19:23, Aneesh Kumar K.V wrote: >> This enables us to share the same page table code for >> both radix and hash. Radix use a hardware defined big endian >> page table >> >> Signed-off-by: Aneesh Kumar K.V . >> diff --git a/arch/powerpc/i

Re: [PATCH 03/65] powerpc/mm/subpage: Clear RWX bit to indicate no access

2016-04-04 Thread Aneesh Kumar K.V
Balbir Singh writes: > [ text/plain ] > > > On 27/03/16 19:23, Aneesh Kumar K.V wrote: >> Subpage protection used to depend on _PAGE_USER bit to implement no >> access mode. This patch switch that to use _PAGE_RWX. We clear READ, >> Write and Execute access from pte instead of clearing _PAGE_USER

Re: [PATCH 02/65] powerpc/mm: use _PAGE_READ to indicate Read access

2016-04-04 Thread Aneesh Kumar K.V
Balbir Singh writes: > [ text/plain ] > > > On 27/03/16 19:23, Aneesh Kumar K.V wrote: >> This split _PAGE_RW bit to _PAGE_READ and _PAGE_WRITE. It also remove >> the dependency on _PAGE_USER for implying read only. Few things to note >> here is that, we have read implied with write and execute p

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-04-04 Thread Gavin Shan
On Mon, Apr 04, 2016 at 09:39:39AM +0100, Mel Gorman wrote: >On Thu, Mar 31, 2016 at 01:27:34PM +1100, Gavin Shan wrote: >> >So the issue is only existing when CONFIG_NO_BOOTMEM=n. The alternative fix >> >would >> >be similar to what we have on !CONFIG_NO_BOOTMEM: In early stage, all page >> >str

Re: [PATCH] spapr: Don't set the TM ibm, pa-features bit in PR KVM mode

2016-04-04 Thread Alexander Graf
> Am 04.04.2016 um 13:09 schrieb Anton Blanchard : > > We don't support transactional memory in PR KVM, so don't tell > the OS that we do. > > Signed-off-by: Anton Blanchard > --- > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index e7be21e..538bd87 100644 > --- a/hw/ppc/spapr.c > +++ b/h

[PATCH] powerpc: Clear user CPU feature bits if TM is disabled at runtime

2016-04-04 Thread Anton Blanchard via Linuxppc-dev
In check_cpu_pa_features() we check a number of bits in the ibm,pa-features array and set and clear CPU features based on what we find. One of these bits is CPU_FTR_TM, the transactional memory feature bit. If this does disable TM at runtime, then we need to tell userspace about it by clearing the

[PATCH] spapr: Don't set the TM ibm,pa-features bit in PR KVM mode

2016-04-04 Thread Anton Blanchard via Linuxppc-dev
We don't support transactional memory in PR KVM, so don't tell the OS that we do. Signed-off-by: Anton Blanchard --- diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e7be21e..538bd87 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -696,6 +696,12 @@ static void spapr_populate_cpu_dt(CPUStat

Re: PR KVM and TM issues

2016-04-04 Thread Michael Neuling
On Mon, 2016-04-04 at 17:00 +1000, Alexey Kardashevskiy wrote: > On 04/04/2016 04:44 PM, Anton Blanchard wrote: > > Hi, > > > > I can't get an Ubuntu Wily guest to boot on an Ubuntu Wily host in PR KVM > > mode. The kernel in both cases is 4.2. To reproduce: > > > > wget -N > > https://cloud-ima

[PATCH] powerpc/pmac/smp: Add missing FROZEN hotplug notifier transitions

2016-04-04 Thread Anna-Maria Gleixner
The FROZEN transitions are used when a CPU suspends/resumes. In case of a suspend/resume, only the up prepare (CPU_UP_PREPARE_FROZEN) is handled. The error handling transition CPU_UP_CANCELED_FROZEN as well as the CPU_ONLINE_FROZEN transition are not handled. Masking the switch case action argumen

Re: PR KVM and TM issues

2016-04-04 Thread Anton Blanchard via Linuxppc-dev
Hi Alexey, > > I can't get an Ubuntu Wily guest to boot on an Ubuntu Wily host in > > PR KVM mode. The kernel in both cases is 4.2. To reproduce: > > > > wget -N > > https://cloud-images.ubuntu.com/wily/current/wily-server-cloudimg-ppc64el-disk1.img > > > > qemu-system-ppc64 -cpu POWER8 -enable-k

Re: [PATCH v4 1/5] printk/nmi: generic solution for safe printk in NMI

2016-04-04 Thread Petr Mladek
On Mon 2016-04-04 13:49:28, Sergey Senozhatsky wrote: > Hello, > > On (03/30/16 17:53), Petr Mladek wrote: > [..] > > @@ -67,10 +67,12 @@ extern void irq_exit(void); > > preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \ > > rcu_nmi_enter();\

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-04-04 Thread Mel Gorman
On Thu, Mar 31, 2016 at 01:27:34PM +1100, Gavin Shan wrote: > >So the issue is only existing when CONFIG_NO_BOOTMEM=n. The alternative fix > >would > >be similar to what we have on !CONFIG_NO_BOOTMEM: In early stage, all page > >structs > >for bootmem reserved pages are initialized and mark them

Re: PR KVM and TM issues

2016-04-04 Thread Alexey Kardashevskiy
On 04/04/2016 04:44 PM, Anton Blanchard wrote: Hi, I can't get an Ubuntu Wily guest to boot on an Ubuntu Wily host in PR KVM mode. The kernel in both cases is 4.2. To reproduce: wget -N https://cloud-images.ubuntu.com/wily/current/wily-server-cloudimg-ppc64el-disk1.img qemu-system-ppc64 -cpu