[PATCH 0/5] tpm: tpm_ibmvtpm: - style fix

2017-07-29 Thread SZ Lin
Fix styling WARNINGs and Errors of tpm_ibmvtpm.c driver by using checkpatch.pl SZ Lin (5): Fix packed and aligned attribute warnings. Fix "ERROR: code indent should use tabs where possible" Fix 'void function return statements are not generally useful' warning Remove unneccessary 'out of m

[PATCH 1/5] Fix packed and aligned attribute warnings.

2017-07-29 Thread SZ Lin
WARNING: __packed is preferred over __attribute__((packed)) +} __attribute__((packed, aligned(8))); WARNING: __aligned(size) is preferred over __attribute__((aligned(size))) +} __attribute__((packed, aligned(8))); Signed-off-by: SZ Lin --- drivers/char/tpm/tpm_ibmvtpm.h | 2 +- 1 file changed,

[PATCH 3/5] Fix 'void function return statements are not generally useful' warning

2017-07-29 Thread SZ Lin
WARNING: void function return statements are not generally useful + return; +} Signed-off-by: SZ Lin --- drivers/char/tpm/tpm_ibmvtpm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 23913fc86158..e53b9fb517d9 100644

[PATCH 2/5] Fix "ERROR: code indent should use tabs where possible"

2017-07-29 Thread SZ Lin
ERROR: code indent should use tabs where possible +^I^I "Need to wait for TPM to finish\n");$ Signed-off-by: SZ Lin --- drivers/char/tpm/tpm_ibmvtpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index

[PATCH 4/5] Remove unneccessary 'out of memory' message

2017-07-29 Thread SZ Lin
WARNING: Possible unnecessary 'out of memory' message + if (!ibmvtpm->rtce_buf) { + dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n"); WARNING: Possible unnecessary 'out of memory' message + if (!ibmvtpm) { +

[PATCH 5/5] Use __func__ instead of function name

2017-07-29 Thread SZ Lin
Fix following checkpatch.pl warning: WARNING: Prefer using '"%s...", __func__' to using the function's name, in a string Signed-off-by: SZ Lin --- drivers/char/tpm/tpm_ibmvtpm.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/driv

[PATCH] powerpc/64s: watchdog fix stack setup

2017-07-29 Thread Nicholas Piggin
The watchdog soft-NMI exception stack setup loads a stack pointer twice, which is an obvious error. It ends up using the system reset interrupt (true-NMI) stack, which is also a bug because the watchdog could be preempted by a system reset interrupt that overwrites the NMI stack. Change the soft-N

[RFC PATCH] powerpc: improve accounting of non maskable interrupts

2017-07-29 Thread Nicholas Piggin
This fixes a case of double counting MCEs on PowerNV. Adds a counter for the system reset interrupt, which will see more use as a debugging NMI. Adds a soft-NMI counter for the 64s watchdog. Although this could cause confusion because it only fires when interrupts are soft-disabled, so it won't i

[RFC PATCH] powerpc: improve accounting of non maskable interrupts

2017-07-29 Thread Nicholas Piggin
This fixes a case of double counting MCEs on PowerNV. Adds a counter for the system reset interrupt, which will see more use as a debugging NMI. Adds a soft-NMI counter for the 64s watchdog. Although this could cause confusion because it only fires when interrupts are soft-disabled, so it won't i

[RFC PATCH v1] powerpc/radix/kasan: KASAN support for Radix

2017-07-29 Thread Balbir Singh
This is the first attempt to implement KASAN for radix on powerpc64. Aneesh Kumar implemented KASAN for hash 64 in limited mode (support only for kernel linear mapping) (https://lwn.net/Articles/655642/) This patch does the following: 1. Defines its own zero_page,pte,pmd and pud because the generi

[PATCH] mpc832x_rdb: fix of_irq_to_resource() error check

2017-07-29 Thread Sergei Shtylyov
of_irq_to_resource() has recently been fixed to return negative error #'s along with 0 in case of failure, however the Freescale MPC832x RDB board code still only regards 0 as as failure indication -- fix it up. Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()") Signed-off

Re: [RFC v6 13/62] powerpc: track allocation status of all pkeys

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 11:01:44AM -0300, Thiago Jung Bauermann wrote: > > Hello Ram, > > I'm still going through the patches and haven't formed a full picture of > the feature in my mind yet, so my comments today won't be particularly > insightful... > > But hopefully the comments that I curren

Re: [RFC PATCH v1] powerpc/radix/kasan: KASAN support for Radix

2017-07-29 Thread Balbir Singh
> + > +extern struct static_key_false powerpc_kasan_enabled_key; > +#define check_return_arch_not_ready() \ > + do {\ > + if (!static_branch_likely(&powerpc_kasan_enabled_key)) \ > + return;

Re: [RFC v6 17/62] powerpc: implementation for arch_set_user_pkey_access()

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 11:15:36AM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > @@ -113,10 +117,14 @@ static inline int arch_override_mprotect_pkey(struct > > vm_area_struct *vma, > > return 0; > > } > > > > +extern int __arch_set_user_pkey_access(struct task_struct *tsk, int

Re: [RFC PATCH v1] powerpc/radix/kasan: KASAN support for Radix

2017-07-29 Thread Balbir Singh
On Sun, Jul 30, 2017 at 8:58 AM, Balbir Singh wrote: >> + >> +extern struct static_key_false powerpc_kasan_enabled_key; >> +#define check_return_arch_not_ready() \ >> + do {\ >> + if (!static_branch_likely(&powerpc_kas

Re: [RFC v6 19/62] powerpc: ability to create execute-disabled pkeys

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 11:54:31AM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > --- a/arch/powerpc/include/asm/pkeys.h > > +++ b/arch/powerpc/include/asm/pkeys.h > > @@ -2,6 +2,18 @@ > > #define _ASM_PPC64_PKEYS_H > > > > extern bool pkey_inited; > > +/* override any generic P

Re: [RFC v6 20/62] powerpc: store and restore the pkey state across context switches

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 02:32:59PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > Store and restore the AMR, IAMR and UMOR register state of the task > > before scheduling out and after scheduling in, respectively. > > > > Signed-off-by: Ram Pai > > s/UMOR/UAMOR/ > > > diff --g

Re: [RFC v6 15/62] powerpc: helper functions to initialize AMR, IAMR and UMOR registers

2017-07-29 Thread Ram Pai
On Thu, Jul 27, 2017 at 05:40:44PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > > Introduce helper functions that can initialize the bits in the AMR, > > IAMR and UMOR register; the bits that correspond to the given pkey. > > > > Signed-off-by: Ram Pai > > s/UMOR/UAMOR/ here and

Re: [RFC v6 27/62] powerpc: helper to validate key-access permissions of a pte

2017-07-29 Thread Ram Pai
On Fri, Jul 28, 2017 at 06:00:02PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > --- a/arch/powerpc/mm/pkeys.c > > +++ b/arch/powerpc/mm/pkeys.c > > @@ -201,3 +201,36 @@ int __arch_override_mprotect_pkey(struct > > vm_area_struct *vma, int prot, > > */ > > return vma_pkey(

Re: [RFC v6 21/62] powerpc: introduce execute-only pkey

2017-07-29 Thread Ram Pai
On Fri, Jul 28, 2017 at 07:17:13PM -0300, Thiago Jung Bauermann wrote: > > Ram Pai writes: > > --- a/arch/powerpc/mm/pkeys.c > > +++ b/arch/powerpc/mm/pkeys.c > > @@ -97,3 +97,60 @@ int __arch_set_user_pkey_access(struct task_struct *tsk, > > int pkey, > > init_iamr(pkey, new_iamr_bits); > >

Re: [PATCH] mpc832x_rdb: fix of_irq_to_resource() error check

2017-07-29 Thread Scott Wood
On Sat, 2017-07-29 at 22:52 +0300, Sergei Shtylyov wrote: > of_irq_to_resource() has recently been  fixed to return negative error #'s > along with 0 in case of failure,  however the Freescale MPC832x RDB board > code still only regards 0 as as failure indication -- fix it up. > > Fixes: 7a4228bbf