Re: [PATCH v2 5/9] powerpc/vmlinux.lds: Align __init_begin to 16M

2017-06-03 Thread Nicholas Piggin
On Sat, 3 Jun 2017 17:18:39 +1000 Balbir Singh wrote: > For CONFIG_STRICT_KERNEL_RWX align __init_begin to 16M. > We use 16M since its the larger of 2M on radix and 16M > on hash for our linear mapping. The plan is to have > .text, .rodata and everything upto __init_begin

Re: [PATCH V3 1/2] powerpc/numa: Update CPU topology when VPHN enabled

2017-06-03 Thread kbuild test robot
Hi Michael, [auto build test ERROR on powerpc/next] [also build test ERROR on v4.12-rc3 next-20170602] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-03 Thread Anton Blanchard
On Sat, 3 Jun 2017 19:42:14 -0300 Breno Leitao wrote: > Hi Anton, > > On Sat, Jun 03, 2017 at 08:04:11AM +1000, Anton Blanchard wrote: > > Hi Breno, > > > > > Currently tsk->thread->load_vec and load_fp are not initialized > > > during a task creation, which set garbage to

Re: [PATCH v2 1/9] powerpc/lib/code-patching: Enhance code patching

2017-06-03 Thread kbuild test robot
/20170603-161759 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-kilauea_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin

Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-03 Thread Breno Leitao
Hi Anton, On Sat, Jun 03, 2017 at 08:04:11AM +1000, Anton Blanchard wrote: > Hi Breno, > > > Currently tsk->thread->load_vec and load_fp are not initialized > > during a task creation, which set garbage to these variables > > (non-zero value). > > Nice catch! It seems like we should zero

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-03 Thread kbuild test robot
/20170603-220322 config: x86_64-randconfig-x010-201722 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): >> cc1: error: -Werror=int-in-

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-03 Thread kbuild test robot
/20170603-220322 config: i386-randconfig-x018-201722 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): >> cc1: warning: -malign-functions

[PATCH v4 2/2] tty: add TIOCGPTPEER ioctl

2017-06-03 Thread Aleksa Sarai
When opening the slave end of a PTY, it is not possible for userspace to safely ensure that /dev/pts/$num is actually a slave (in cases where the mount namespace in which devpts was mounted is controlled by an untrusted process). In addition, there are several unresolvable race conditions if

[PATCH v4 1/2] tty: add compat_ioctl callbacks

2017-06-03 Thread Aleksa Sarai
In order to avoid future diversions between fs/compat_ioctl.c and drivers/tty/pty.c, define .compat_ioctl callbacks for the relevant tty_operations structs. Since both pty_unix98_ioctl() and pty_bsd_ioctl() are compatible between 32-bit and 64-bit userspace no special translation is required.

[PATCH v4 0/2] tty: add TIOCGPTPEER ioctl

2017-06-03 Thread Aleksa Sarai
Changes in v4: * Dropped an accidental change to Makefile. Aleksa Sarai (2): tty: add compat_ioctl callbacks tty: add TIOCGPTPEER ioctl arch/alpha/include/uapi/asm/ioctls.h | 1 + arch/mips/include/uapi/asm/ioctls.h| 1 + arch/parisc/include/uapi/asm/ioctls.h | 1 +

Re: [PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-03 Thread Aleksa Sarai
diff --git a/Makefile b/Makefile index 470bd4d9513a..fb689286d83a 100644 --- a/Makefile +++ b/Makefile @@ -401,6 +401,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \

Re: powerpc/opal-irqchip: Use interrupt names if present

2017-06-03 Thread Geert Uytterhoeven
Hi Ben, On Fri, Jun 2, 2017 at 4:11 PM, Benjamin Herrenschmidt wrote: > On Fri, 2017-06-02 at 14:39 +0200, Geert Uytterhoeven wrote: >> > diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c >> > b/arch/powerpc/platforms/powernv/opal-irqchip.c >> > index

[PATCH v3 2/2] tty: add TIOCGPTPEER ioctl

2017-06-03 Thread Aleksa Sarai
When opening the slave end of a PTY, it is not possible for userspace to safely ensure that /dev/pts/$num is actually a slave (in cases where the mount namespace in which devpts was mounted is controlled by an untrusted process). In addition, there are several unresolvable race conditions if

[PATCH v3 1/2] tty: add compat_ioctl callbacks

2017-06-03 Thread Aleksa Sarai
In order to avoid future diversions between fs/compat_ioctl.c and drivers/tty/pty.c, define .compat_ioctl callbacks for the relevant tty_operations structs. Since both pty_unix98_ioctl() and pty_bsd_ioctl() are compatible between 32-bit and 64-bit userspace no special translation is required.

[PATCH v3 0/2] tty: add TIOCGPTPEER ioctl

2017-06-03 Thread Aleksa Sarai
Changes in v3: * Defined a compat_ioctl callback for all pty ioctls, since they are all 32-bit and 64-bit compatible. * Made TIOCGPTPEER support 32-bit userspace. Aleksa Sarai (2): tty: add compat_ioctl callbacks tty: add TIOCGPTPEER ioctl Makefile | 1

[PATCH v2 9/9] powerpc/mm/ptdump: Dump the first entry of the linear mapping as well

2017-06-03 Thread Balbir Singh
The check in hpte_find() should be < and not <= for PAGE_OFFSET Signed-off-by: Balbir Singh --- arch/powerpc/mm/dump_hashpagetable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/dump_hashpagetable.c

[PATCH v2 8/9] powerpc/Kconfig: Enable STRICT_KERNEL_RWX

2017-06-03 Thread Balbir Singh
We have the basic support in the form of patching R/O text sections, linker scripts for extending alignment of text data. We've also got mark_rodata_ro() Signed-off-by: Balbir Singh --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v2 7/9] powerpc/mm/hash: Implement mark_rodata_ro() for hash

2017-06-03 Thread Balbir Singh
With hash we update the bolted pte to mark it read-only. We rely on the MMU_FTR_KERNEL_RO to generate the correct permissions for read-only text. The radix implementation just prints a warning in this implementation Signed-off-by: Balbir Singh ---

[PATCH v2 6/9] powerpc/platform/pseries/lpar: Fix updatepp and updateboltedpp

2017-06-03 Thread Balbir Singh
PAPR has pp0 in bit 55, currently we assumed that bit pp0 is bit 0 (all bits in IBM order). This patch fixes the pp0 bits for both these routines that use H_PROTECT Signed-off-by: Balbir Singh --- arch/powerpc/platforms/pseries/lpar.c | 13 +++-- 1 file changed,

[PATCH v2 5/9] powerpc/vmlinux.lds: Align __init_begin to 16M

2017-06-03 Thread Balbir Singh
For CONFIG_STRICT_KERNEL_RWX align __init_begin to 16M. We use 16M since its the larger of 2M on radix and 16M on hash for our linear mapping. The plan is to have .text, .rodata and everything upto __init_begin marked as RX. Note we still have executable read only data. We could further align read

[PATCH v2 4/9] powerpc/xmon: Add patch_instruction supporf for xmon

2017-06-03 Thread Balbir Singh
Move from mwrite() to patch_instruction() for xmon for breakpoint addition and removal. Signed-off-by: Balbir Singh --- arch/powerpc/xmon/xmon.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c

[PATCH v2 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-03 Thread Balbir Singh
With text moving to read-only migrate optprobes to using the patch_instruction infrastructure. Without this optprobes will fail and complain. Signed-off-by: Balbir Singh --- arch/powerpc/kernel/optprobes.c | 58 ++--- 1 file changed, 37

[PATCH v2 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-03 Thread Balbir Singh
arch_arm/disarm_probe use direct assignment for copying instructions, replace them with patch_instruction Signed-off-by: Balbir Singh --- arch/powerpc/kernel/kprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c

[PATCH v2 1/9] powerpc/lib/code-patching: Enhance code patching

2017-06-03 Thread Balbir Singh
Today our patching happens via direct copy and patch_instruction. The patching code is well contained in the sense that copying bits are limited. While considering implementation of CONFIG_STRICT_RWX, the first requirement is to a create another mapping that will allow for patching. We create the

[PATCH v2 0/9] Enable STRICT_KERNEL_RWX

2017-06-03 Thread Balbir Singh
Enable STRICT_KERNEL_RWX for PPC64/BOOK3S These patches enable RX mappings of kernel text. rodata is mapped RX as well as a trade-off, there are more details in the patch description As a prerequisite for R/O text, patch_instruction is moved over to using a separate mapping that allows write to