* [PATCH RESEND v5 0/3] Add NXP AUDMIX device and machine drivers
From: Viorel Suman @ 2019-03-04 10:36 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Mark Rutland,
Jaroslav Kysela, Takashi Iwai, Timur Tabi, Nicolin Chen, Xiubo Li,
Fabio Estevam, Viorel Suman, S.j. Wang, Daniel Baluta,
Cosmin Samoila
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org, Viorel Suman, dl-linux-imx,
linuxppc-dev@lists.ozlabs.org
The patchset adds NXP Audio Mixer (AUDMIX) device and machine
drivers and related DT bindings documentation.
Changes since V4:
1. Removed "model" attribute from device driver DT bindings documentation
as suggested by Nicolin.
Changes since V3:
1. Removed machine driver DT bindings documentation.
2. Trigger machine driver probe from device driver as suggested by Nicolin.
Changes since V2:
1. Moved "dais" node from machine driver DTS node to device driver DTS node
as suggested by Rob.
Changes since V1:
1. Original patch split into distinct patches for the device driver and
DT binding documentation.
2. Replaced AMIX with AUDMIX in both code and file names as it looks more
RM-compliant.
3. Removed polarity control from CPU DAI driver as suggested by Nicolin.
4. Added machine driver and related DT binding documentation.
Viorel Suman (3):
ASoC: fsl: Add Audio Mixer CPU DAI driver
ASoC: add fsl_audmix DT binding documentation
ASoC: fsl: Add Audio Mixer machine driver
.../devicetree/bindings/sound/fsl,audmix.txt | 50 ++
sound/soc/fsl/Kconfig | 16 +
sound/soc/fsl/Makefile | 5 +
sound/soc/fsl/fsl_audmix.c | 578 +++++++++++++++++++++
sound/soc/fsl/fsl_audmix.h | 102 ++++
sound/soc/fsl/imx-audmix.c | 327 ++++++++++++
6 files changed, 1078 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/fsl,audmix.txt
create mode 100644 sound/soc/fsl/fsl_audmix.c
create mode 100644 sound/soc/fsl/fsl_audmix.h
create mode 100644 sound/soc/fsl/imx-audmix.c
--
2.7.4
^ permalink raw reply
* Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook
From: Sudeep Holla @ 2019-03-04 10:12 UTC (permalink / raw)
To: Haibo Xu (Arm Technology China)
Cc: Sudeep Holla, Steve Capper, Catalin Marinas, jdike@addtoit.com,
x86@kernel.org, Will Deacon, linux-kernel@vger.kernel.org,
Oleg Nesterov, Richard Weinberger, Ingo Molnar, Paul Mackerras,
Andy Lutomirski, Borislav Petkov, Thomas Gleixner,
Bin Lu (Arm Technology China), linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <eb9ef619-4af8-71e1-5aee-0b6294ac488b@arm.com>
On Mon, Mar 04, 2019 at 08:25:28AM +0000, Haibo Xu (Arm Technology China) wrote:
> On 2019/3/1 2:32, Sudeep Holla wrote:
> > Now that we have a new hook ptrace_syscall_enter that can be called from
> > syscall entry code and it handles PTRACE_SYSEMU in generic code, we
> > can do some cleanup using the same in syscall_trace_enter.
> >
> > Further the extra logic to find single stepping PTRACE_SYSEMU_SINGLESTEP
> > in syscall_slow_exit_work seems unnecessary. Let's remove the same.
>
> I think we should not change the logic here. Is so, it will double the report of syscall
> when PTRACE_SYSEMU_SINGLESTEP is enabled.
>
I don't think that should happen, but I may be missing something.
Can you explain how ?
--
Regards,
Sudeep
^ permalink raw reply
* Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook
From: Sudeep Holla @ 2019-03-04 10:07 UTC (permalink / raw)
To: Andy Lutomirski
Cc: Haibo Xu, Steve Capper, Catalin Marinas, Jeff Dike, X86 ML,
Will Deacon, LKML, Oleg Nesterov, Richard Weinberger, Ingo Molnar,
Paul Mackerras, Borislav Petkov, Thomas Gleixner, Bin Lu,
linuxppc-dev, linux-arm-kernel
In-Reply-To: <CALCETrVOJV0uBX3CbpmuwSGQa98Fabq3-GoRbGMb79m_OoJkmQ@mail.gmail.com>
On Sat, Mar 02, 2019 at 05:11:40PM -0800, Andy Lutomirski wrote:
> On Thu, Feb 28, 2019 at 10:32 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > Now that we have a new hook ptrace_syscall_enter that can be called from
> > syscall entry code and it handles PTRACE_SYSEMU in generic code, we
> > can do some cleanup using the same in syscall_trace_enter.
> >
> > Further the extra logic to find single stepping PTRACE_SYSEMU_SINGLESTEP
> > in syscall_slow_exit_work seems unnecessary. Let's remove the same.
>
> I wasn't cc'd on the whole series, so I can't easily review this. Do
> you have a test case to make sure that emulation still works? Are
> there adequate tests in tools/testing/selftests/x86? Do they still
> pass after this patch?
>
I will ensure you are cc-ed on the whole threads, sorry for missing.
I remember seeing some selftests, but I haven't run them yet.
--
Regards,
Sudeep
^ permalink raw reply
* Re: [PATCH 4/6] powerpc: use common ptrace_syscall_enter hook to handle _TIF_SYSCALL_EMU
From: Haibo Xu (Arm Technology China) @ 2019-03-04 9:36 UTC (permalink / raw)
To: Sudeep Holla, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: Steve Capper, Catalin Marinas, jdike@addtoit.com, Will Deacon,
Oleg Nesterov, Bin Lu (Arm Technology China), Richard Weinberger,
Ingo Molnar, Paul Mackerras, Thomas Gleixner
In-Reply-To: <20190228183220.15626-5-sudeep.holla@arm.com>
On 2019/3/1 2:32, Sudeep Holla wrote:
> Now that we have a new hook ptrace_syscall_enter that can be called from
> syscall entry code and it handles PTRACE_SYSEMU in generic code, we
> can do some cleanup using the same in do_syscall_trace_enter.
>
> Cc: Oleg Nesterov <oleg@redhat.com>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> arch/powerpc/kernel/ptrace.c | 50 ++++++++++++++++--------------------
> 1 file changed, 22 insertions(+), 28 deletions(-)
>
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index cb7e1439cafb..978cd2aac29e 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -3264,37 +3264,31 @@ long do_syscall_trace_enter(struct pt_regs *regs)
> {
> u32 flags;
>
> -user_exit();
We'd better keep the user_exit() at here in case both context tracking and SYSCALL_EMU
are enabled.
> -
> -flags = READ_ONCE(current_thread_info()->flags) &
> -(_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE);
> +if (unlikely(ptrace_syscall_enter(regs))) {
> +/*
> + * A nonzero return code from tracehook_report_syscall_entry()
> + * tells us to prevent the syscall execution, but we are not
> + * going to execute it anyway.
> + *
> + * Returning -1 will skip the syscall execution. We want to
> + * avoid clobbering any registers, so we don't goto the skip
> + * label below.
> + */
> +return -1;
> +}
>
> -if (flags) {
> -int rc = tracehook_report_syscall_entry(regs);
> +user_exit();
>
> -if (unlikely(flags & _TIF_SYSCALL_EMU)) {
> -/*
> - * A nonzero return code from
> - * tracehook_report_syscall_entry() tells us to prevent
> - * the syscall execution, but we are not going to
> - * execute it anyway.
> - *
> - * Returning -1 will skip the syscall execution. We want
> - * to avoid clobbering any registers, so we don't goto
> - * the skip label below.
> - */
> -return -1;
> -}
> +flags = READ_ONCE(current_thread_info()->flags) & _TIF_SYSCALL_TRACE;
>
> -if (rc) {
> -/*
> - * The tracer decided to abort the syscall. Note that
> - * the tracer may also just change regs->gpr[0] to an
> - * invalid syscall number, that is handled below on the
> - * exit path.
> - */
> -goto skip;
> -}
> +if (flags && tracehook_report_syscall_entry(regs)) {
> +/*
> + * The tracer decided to abort the syscall. Note that
> + * the tracer may also just change regs->gpr[0] to an
> + * invalid syscall number, that is handled below on the
> + * exit path.
> + */
> +goto skip;
> }
>
> /* Run seccomp after ptrace; allow it to set gpr[3]. */
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply
* Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook
From: Haibo Xu (Arm Technology China) @ 2019-03-04 8:25 UTC (permalink / raw)
To: Sudeep Holla, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: Steve Capper, Catalin Marinas, jdike@addtoit.com, Will Deacon,
Oleg Nesterov, Bin Lu (Arm Technology China), Richard Weinberger,
Ingo Molnar, Paul Mackerras, Andy Lutomirski, Borislav Petkov,
Thomas Gleixner
In-Reply-To: <20190228183220.15626-4-sudeep.holla@arm.com>
On 2019/3/1 2:32, Sudeep Holla wrote:
> Now that we have a new hook ptrace_syscall_enter that can be called from
> syscall entry code and it handles PTRACE_SYSEMU in generic code, we
> can do some cleanup using the same in syscall_trace_enter.
>
> Further the extra logic to find single stepping PTRACE_SYSEMU_SINGLESTEP
> in syscall_slow_exit_work seems unnecessary. Let's remove the same.
I think we should not change the logic here. Is so, it will double the report of syscall
when PTRACE_SYSEMU_SINGLESTEP is enabled.
>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
> arch/x86/entry/common.c | 22 ++++------------------
> 1 file changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
> index 7bc105f47d21..36457c1f87d2 100644
> --- a/arch/x86/entry/common.c
> +++ b/arch/x86/entry/common.c
> @@ -70,22 +70,16 @@ static long syscall_trace_enter(struct pt_regs *regs)
>
> struct thread_info *ti = current_thread_info();
> unsigned long ret = 0;
> -bool emulated = false;
> u32 work;
>
> if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
> BUG_ON(regs != task_pt_regs(current));
>
> -work = READ_ONCE(ti->flags) & _TIF_WORK_SYSCALL_ENTRY;
> -
> -if (unlikely(work & _TIF_SYSCALL_EMU))
> -emulated = true;
> -
> -if ((emulated || (work & _TIF_SYSCALL_TRACE)) &&
> - tracehook_report_syscall_entry(regs))
> +if (unlikely(ptrace_syscall_enter(regs)))
> return -1L;
>
> -if (emulated)
> +work = READ_ONCE(ti->flags) & _TIF_WORK_SYSCALL_ENTRY;
> +if ((work & _TIF_SYSCALL_TRACE) && tracehook_report_syscall_entry(regs))
> return -1L;
>
> #ifdef CONFIG_SECCOMP
> @@ -227,15 +221,7 @@ static void syscall_slow_exit_work(struct pt_regs *regs, u32 cached_flags)
> if (cached_flags & _TIF_SYSCALL_TRACEPOINT)
> trace_sys_exit(regs, regs->ax);
>
> -/*
> - * If TIF_SYSCALL_EMU is set, we only get here because of
> - * TIF_SINGLESTEP (i.e. this is PTRACE_SYSEMU_SINGLESTEP).
> - * We already reported this syscall instruction in
> - * syscall_trace_enter().
> - */
> -step = unlikely(
> -(cached_flags & (_TIF_SINGLESTEP | _TIF_SYSCALL_EMU))
> -== _TIF_SINGLESTEP);
> +step = unlikely((cached_flags & _TIF_SINGLESTEP));
> if (step || cached_flags & _TIF_SYSCALL_TRACE)
> tracehook_report_syscall_exit(regs, step);
> }
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply
* Re: [PATCH 2/6] ptrace: introduce ptrace_syscall_enter to consolidate PTRACE_SYSEMU handling
From: Haibo Xu (Arm Technology China) @ 2019-03-04 8:03 UTC (permalink / raw)
To: Sudeep Holla, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Cc: Steve Capper, Catalin Marinas, jdike@addtoit.com, Will Deacon,
Oleg Nesterov, Bin Lu (Arm Technology China), Richard Weinberger,
Ingo Molnar, Paul Mackerras, Thomas Gleixner
In-Reply-To: <20190228183220.15626-3-sudeep.holla@arm.com>
On 2019/3/1 2:32, Sudeep Holla wrote:
> Currently each architecture handles PTRACE_SYSEMU in very similar way.
> It's completely arch independent and can be handled in the code helping
> to consolidate PTRACE_SYSEMU handling.
>
> Let's introduce a hook 'ptrace_syscall_enter' that arch specific syscall
> entry code can call.
>
The 'ptrace_syscall_enter' is dedicated for PTRACE_SYSEMU flag,
So I suggest to rename the function to something like 'ptrace_syscall_emu_enter".
> +/*
> + * Hook to check and report for PTRACE_SYSEMU, can be called from arch
> + * arch syscall entry code
> + */
> +long ptrace_syscall_enter(struct pt_regs *regs)
> +{
> +#ifdef TIF_SYSCALL_EMU
> +if (test_thread_flag(TIF_SYSCALL_EMU)) {
> +if (tracehook_report_syscall_entry(regs));
Shall we remove the semi-colon at end of the above line?
> +return -1L;
> +}
> +#endif
> +return 0;
> +}
> +
> /*
> * Detach all tasks we were using ptrace on. Called with tasklist held
> * for writing.
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
^ permalink raw reply
* [PATCH] Disable kcov for slb routines.
From: Mahesh J Salgaonkar @ 2019-03-04 8:25 UTC (permalink / raw)
To: linuxppc-dev; +Cc: syzkaller, Paul Mackerras, Nicholas Piggin, Andrew Donnellan
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
The kcov instrumentation inside SLB routines causes duplicate SLB entries
to be added resulting into SLB multihit machine checks.
Disable kcov instrumentation on slb.o
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
arch/powerpc/mm/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index d4d32e229ace..f9cb40684746 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -60,3 +60,4 @@ obj-$(CONFIG_PPC_MEM_KEYS) += pkeys.o
# This is necessary for booting with kcov enabled on book3e machines
KCOV_INSTRUMENT_tlb_nohash.o := n
KCOV_INSTRUMENT_fsl_booke_mmu.o := n
+KCOV_INSTRUMENT_slb.o := n
^ permalink raw reply related
* Re: [PATCH v9 02/11] powerpc: prepare string/mem functions for KASAN
From: Daniel Axtens @ 2019-03-04 5:26 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, Nicholas Piggin, Aneesh Kumar K.V,
Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov
Cc: linux-mm, linuxppc-dev, linux-kernel, kasan-dev
In-Reply-To: <45fb252fc1b27f2804109fa35ba2882ae29e6035.1551443453.git.christophe.leroy@c-s.fr>
Hi Christophe,
> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
> new file mode 100644
> index 000000000000..c3161b8fc017
> --- /dev/null
> +++ b/arch/powerpc/include/asm/kasan.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef __ASM_KASAN_H
> +#define __ASM_KASAN_H
> +
> +#ifdef CONFIG_KASAN
> +#define _GLOBAL_KASAN(fn) .weak fn ; _GLOBAL(__##fn) ; _GLOBAL(fn)
> +#define _GLOBAL_TOC_KASAN(fn) .weak fn ; _GLOBAL_TOC(__##fn) ; _GLOBAL_TOC(fn)
> +#define EXPORT_SYMBOL_KASAN(fn) EXPORT_SYMBOL(__##fn) ; EXPORT_SYMBOL(fn)
I'm having some trouble with this. I get warnings like this:
WARNING: EXPORT symbol "__memcpy" [vmlinux] version generation failed, symbol will not be versioned.
It seems to be related to the export line, as if I swap the exports to
do fn before __##fn I get:
WARNING: EXPORT symbol "memset" [vmlinux] version generation failed, symbol will not be versioned.
I have narrowed this down to combining 2 EXPORT_SYMBOL()s on one line.
This works - no warning:
EXPORT_SYMBOL(memset)
EXPORT_SYMBOL(__memset)
This throws a warning:
EXPORT_SYMBOL(memset) ; EXPORT_SYMBOL(__memset)
I notice in looking at the diff of preprocessed source we end up
invoking an asm macro that doesn't seem to have a full final argument, I
wonder if that's relevant...
-___EXPORT_SYMBOL __memset, __memset, ; ___EXPORT_SYMBOL memset, memset,
+___EXPORT_SYMBOL __memset, __memset,
+___EXPORT_SYMBOL memset, memset,
I also notice that nowhere else in the source do people have multiple
EXPORT_SYMBOLs on the same line, and other arches seem to just
unconditionally export both symbols on multiple lines.
I have no idea how this works for you - maybe it's affected by something 32bit.
How would you feel about this approach instead? I'm not tied to any of
the names or anything.
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index e0637730a8e7..7b6a91b448dd 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -214,6 +214,9 @@ name: \
#define DOTSYM(a) a
+#define PROVIDE_WEAK_ALIAS(strongname, weakname) \
+ .weak weakname ; .set weakname, strongname ;
+
#else
#define XGLUE(a,b) a##b
@@ -236,6 +239,10 @@ GLUE(.,name):
#define DOTSYM(a) GLUE(.,a)
+#define PROVIDE_WEAK_ALIAS(strongname, weakname) \
+ .weak weakname ; .set weakname, strongname ; \
+ .weak DOTSYM(weakname) ; .set DOTSYM(weakname), DOTSYM(strongname) ;
+
#endif
#else /* 32-bit */
@@ -251,6 +258,9 @@ GLUE(.,name):
#define _GLOBAL_TOC(name) _GLOBAL(name)
+#define PROVIDE_WEAK_ALIAS(strongname, weakname) \
+ .weak weakname ; .set weakname, strongname ;
+
#endif
/*
--- a/arch/powerpc/lib/mem_64.S
+++ b/arch/powerpc/lib/mem_64.S
@@ -33,7 +33,8 @@ EXPORT_SYMBOL(__memset32)
EXPORT_SYMBOL(__memset64)
#endif
-_GLOBAL_KASAN(memset)
+PROVIDE_WEAK_ALIAS(__memset,memset)
+_GLOBAL(__memset)
neg r0,r3
rlwimi r4,r4,8,16,23
andi. r0,r0,7 /* # bytes to be 8-byte aligned */
@@ -98,9 +99,11 @@ _GLOBAL_KASAN(memset)
10: bflr 31
stb r4,0(r6)
blr
-EXPORT_SYMBOL_KASAN(memset)
+EXPORT_SYMBOL(memset)
+EXPORT_SYMBOL(__memset)
-_GLOBAL_TOC_KASAN(memmove)
+PROVIDE_WEAK_ALIAS(__memmove,memove)
+_GLOBAL_TOC(__memmove)
cmplw 0,r3,r4
bgt backwards_memcpy
b memcpy
@@ -141,4 +144,5 @@ _GLOBAL(backwards_memcpy)
beq 2b
mtctr r7
b 1b
-EXPORT_SYMBOL_KASAN(memmove)
+EXPORT_SYMBOL(memmove)
+EXPORT_SYMBOL(__memmove)
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
index 862b515b8868..7c1b09556cad 100644
--- a/arch/powerpc/lib/memcpy_64.S
+++ b/arch/powerpc/lib/memcpy_64.S
@@ -19,7 +19,8 @@
#endif
.align 7
-_GLOBAL_TOC_KASAN(memcpy)
+PROVIDE_WEAK_ALIAS(__memcpy,memcpy)
+_GLOBAL_TOC(__memcpy)
BEGIN_FTR_SECTION
#ifdef __LITTLE_ENDIAN__
cmpdi cr7,r5,0
@@ -230,4 +231,5 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
4: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
blr
#endif
-EXPORT_SYMBOL_KASAN(memcpy)
+EXPORT_SYMBOL(__memcpy)
+EXPORT_SYMBOL(memcpy)
Regards,
Daniel
> +#else
> +#define _GLOBAL_KASAN(fn) _GLOBAL(fn)
> +#define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(fn)
> +#define EXPORT_SYMBOL_KASAN(fn) EXPORT_SYMBOL(fn)
> +#endif
> +
> +#endif
> diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
> index 1647de15a31e..9bf6dffb4090 100644
> --- a/arch/powerpc/include/asm/string.h
> +++ b/arch/powerpc/include/asm/string.h
> @@ -4,14 +4,17 @@
>
> #ifdef __KERNEL__
>
> +#ifndef CONFIG_KASAN
> #define __HAVE_ARCH_STRNCPY
> #define __HAVE_ARCH_STRNCMP
> +#define __HAVE_ARCH_MEMCHR
> +#define __HAVE_ARCH_MEMCMP
> +#define __HAVE_ARCH_MEMSET16
> +#endif
> +
> #define __HAVE_ARCH_MEMSET
> #define __HAVE_ARCH_MEMCPY
> #define __HAVE_ARCH_MEMMOVE
> -#define __HAVE_ARCH_MEMCMP
> -#define __HAVE_ARCH_MEMCHR
> -#define __HAVE_ARCH_MEMSET16
> #define __HAVE_ARCH_MEMCPY_FLUSHCACHE
>
> extern char * strcpy(char *,const char *);
> @@ -27,7 +30,27 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
> extern void * memchr(const void *,int,__kernel_size_t);
> extern void * memcpy_flushcache(void *,const void *,__kernel_size_t);
>
> +void *__memset(void *s, int c, __kernel_size_t count);
> +void *__memcpy(void *to, const void *from, __kernel_size_t n);
> +void *__memmove(void *to, const void *from, __kernel_size_t n);
> +
> +#if defined(CONFIG_KASAN) && !defined(__SANITIZE_ADDRESS__)
> +/*
> + * For files that are not instrumented (e.g. mm/slub.c) we
> + * should use not instrumented version of mem* functions.
> + */
> +#define memcpy(dst, src, len) __memcpy(dst, src, len)
> +#define memmove(dst, src, len) __memmove(dst, src, len)
> +#define memset(s, c, n) __memset(s, c, n)
> +
> +#ifndef __NO_FORTIFY
> +#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
> +#endif
> +
> +#endif
> +
> #ifdef CONFIG_PPC64
> +#ifndef CONFIG_KASAN
> #define __HAVE_ARCH_MEMSET32
> #define __HAVE_ARCH_MEMSET64
>
> @@ -49,8 +72,11 @@ static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
> {
> return __memset64(p, v, n * 8);
> }
> +#endif
> #else
> +#ifndef CONFIG_KASAN
> #define __HAVE_ARCH_STRLEN
> +#endif
>
> extern void *memset16(uint16_t *, uint16_t, __kernel_size_t);
> #endif
> diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
> index 667df97d2595..181fd10008ef 100644
> --- a/arch/powerpc/kernel/prom_init_check.sh
> +++ b/arch/powerpc/kernel/prom_init_check.sh
> @@ -16,8 +16,16 @@
> # If you really need to reference something from prom_init.o add
> # it to the list below:
>
> +grep "^CONFIG_KASAN=y$" .config >/dev/null
> +if [ $? -eq 0 ]
> +then
> + MEM_FUNCS="__memcpy __memset"
> +else
> + MEM_FUNCS="memcpy memset"
> +fi
> +
> WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
> -_end enter_prom memcpy memset reloc_offset __secondary_hold
> +_end enter_prom $MEM_FUNCS reloc_offset __secondary_hold
> __secondary_hold_acknowledge __secondary_hold_spinloop __start
> strcmp strcpy strlcpy strlen strncmp strstr kstrtobool logo_linux_clut224
> reloc_got2 kernstart_addr memstart_addr linux_banner _stext
> diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
> index 79396e184bca..47a4de434c22 100644
> --- a/arch/powerpc/lib/Makefile
> +++ b/arch/powerpc/lib/Makefile
> @@ -8,9 +8,14 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
> CFLAGS_REMOVE_code-patching.o = $(CC_FLAGS_FTRACE)
> CFLAGS_REMOVE_feature-fixups.o = $(CC_FLAGS_FTRACE)
>
> -obj-y += string.o alloc.o code-patching.o feature-fixups.o
> +obj-y += alloc.o code-patching.o feature-fixups.o
>
> -obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o strlen_32.o
> +ifndef CONFIG_KASAN
> +obj-y += string.o memcmp_$(BITS).o
> +obj-$(CONFIG_PPC32) += strlen_32.o
> +endif
> +
> +obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o
>
> obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
>
> @@ -34,7 +39,7 @@ obj64-$(CONFIG_KPROBES_SANITY_TEST) += test_emulate_step.o \
> test_emulate_step_exec_instr.o
>
> obj-y += checksum_$(BITS).o checksum_wrappers.o \
> - string_$(BITS).o memcmp_$(BITS).o
> + string_$(BITS).o
>
> obj-y += sstep.o ldstfp.o quad.o
> obj64-y += quad.o
> diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
> index ba66846fe973..fc4fa7246200 100644
> --- a/arch/powerpc/lib/copy_32.S
> +++ b/arch/powerpc/lib/copy_32.S
> @@ -14,6 +14,7 @@
> #include <asm/ppc_asm.h>
> #include <asm/export.h>
> #include <asm/code-patching-asm.h>
> +#include <asm/kasan.h>
>
> #define COPY_16_BYTES \
> lwz r7,4(r4); \
> @@ -68,6 +69,7 @@ CACHELINE_BYTES = L1_CACHE_BYTES
> LG_CACHELINE_BYTES = L1_CACHE_SHIFT
> CACHELINE_MASK = (L1_CACHE_BYTES-1)
>
> +#ifndef CONFIG_KASAN
> _GLOBAL(memset16)
> rlwinm. r0 ,r5, 31, 1, 31
> addi r6, r3, -4
> @@ -81,6 +83,7 @@ _GLOBAL(memset16)
> sth r4, 4(r6)
> blr
> EXPORT_SYMBOL(memset16)
> +#endif
>
> /*
> * Use dcbz on the complete cache lines in the destination
> @@ -91,7 +94,7 @@ EXPORT_SYMBOL(memset16)
> * We therefore skip the optimised bloc that uses dcbz. This jump is
> * replaced by a nop once cache is active. This is done in machine_init()
> */
> -_GLOBAL(memset)
> +_GLOBAL_KASAN(memset)
> cmplwi 0,r5,4
> blt 7f
>
> @@ -150,7 +153,7 @@ _GLOBAL(memset)
> 9: stbu r4,1(r6)
> bdnz 9b
> blr
> -EXPORT_SYMBOL(memset)
> +EXPORT_SYMBOL_KASAN(memset)
>
> /*
> * This version uses dcbz on the complete cache lines in the
> @@ -163,12 +166,12 @@ EXPORT_SYMBOL(memset)
> * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is
> * replaced by a nop once cache is active. This is done in machine_init()
> */
> -_GLOBAL(memmove)
> +_GLOBAL_KASAN(memmove)
> cmplw 0,r3,r4
> bgt backwards_memcpy
> /* fall through */
>
> -_GLOBAL(memcpy)
> +_GLOBAL_KASAN(memcpy)
> 1: b generic_memcpy
> patch_site 1b, patch__memcpy_nocache
>
> @@ -242,8 +245,8 @@ _GLOBAL(memcpy)
> stbu r0,1(r6)
> bdnz 40b
> 65: blr
> -EXPORT_SYMBOL(memcpy)
> -EXPORT_SYMBOL(memmove)
> +EXPORT_SYMBOL_KASAN(memcpy)
> +EXPORT_SYMBOL_KASAN(memmove)
>
> generic_memcpy:
> srwi. r7,r5,3
> diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
> index 3c3be02f33b7..7cd6cf6822a2 100644
> --- a/arch/powerpc/lib/mem_64.S
> +++ b/arch/powerpc/lib/mem_64.S
> @@ -12,7 +12,9 @@
> #include <asm/errno.h>
> #include <asm/ppc_asm.h>
> #include <asm/export.h>
> +#include <asm/kasan.h>
>
> +#ifndef CONFIG_KASAN
> _GLOBAL(__memset16)
> rlwimi r4,r4,16,0,15
> /* fall through */
> @@ -29,8 +31,9 @@ _GLOBAL(__memset64)
> EXPORT_SYMBOL(__memset16)
> EXPORT_SYMBOL(__memset32)
> EXPORT_SYMBOL(__memset64)
> +#endif
>
> -_GLOBAL(memset)
> +_GLOBAL_KASAN(memset)
> neg r0,r3
> rlwimi r4,r4,8,16,23
> andi. r0,r0,7 /* # bytes to be 8-byte aligned */
> @@ -95,9 +98,9 @@ _GLOBAL(memset)
> 10: bflr 31
> stb r4,0(r6)
> blr
> -EXPORT_SYMBOL(memset)
> +EXPORT_SYMBOL_KASAN(memset)
>
> -_GLOBAL_TOC(memmove)
> +_GLOBAL_TOC_KASAN(memmove)
> cmplw 0,r3,r4
> bgt backwards_memcpy
> b memcpy
> @@ -138,4 +141,4 @@ _GLOBAL(backwards_memcpy)
> beq 2b
> mtctr r7
> b 1b
> -EXPORT_SYMBOL(memmove)
> +EXPORT_SYMBOL_KASAN(memmove)
> diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
> index 273ea67e60a1..862b515b8868 100644
> --- a/arch/powerpc/lib/memcpy_64.S
> +++ b/arch/powerpc/lib/memcpy_64.S
> @@ -11,6 +11,7 @@
> #include <asm/export.h>
> #include <asm/asm-compat.h>
> #include <asm/feature-fixups.h>
> +#include <asm/kasan.h>
>
> #ifndef SELFTEST_CASE
> /* For big-endian, 0 == most CPUs, 1 == POWER6, 2 == Cell */
> @@ -18,7 +19,7 @@
> #endif
>
> .align 7
> -_GLOBAL_TOC(memcpy)
> +_GLOBAL_TOC_KASAN(memcpy)
> BEGIN_FTR_SECTION
> #ifdef __LITTLE_ENDIAN__
> cmpdi cr7,r5,0
> @@ -229,4 +230,4 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
> 4: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
> blr
> #endif
> -EXPORT_SYMBOL(memcpy)
> +EXPORT_SYMBOL_KASAN(memcpy)
> --
> 2.13.3
^ permalink raw reply related
* Re: [PATCH] powerpc: remove dead code in head_fsl_booke.S
From: Jason Yan @ 2019-03-04 1:28 UTC (permalink / raw)
To: Christophe Leroy, benh, paulus, mpe, diana.craciun, linuxppc-dev
In-Reply-To: <cc1c7fdc-33b8-bebd-f5df-4c9b814e099e@c-s.fr>
On 2019/2/28 21:00, Christophe Leroy wrote:
>
>
> Le 28/02/2019 à 09:31, Jason Yan a écrit :
>> This code is dead. Just remove it.
>>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>
> Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> This review was easy :)
>
> Christophe
>
Christophe, thanks.
>> ---
>> arch/powerpc/kernel/head_fsl_booke.S | 7 -------
>> 1 file changed, 7 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/head_fsl_booke.S
>> b/arch/powerpc/kernel/head_fsl_booke.S
>> index 2386ce2a9c6e..b8450f017d85 100644
>> --- a/arch/powerpc/kernel/head_fsl_booke.S
>> +++ b/arch/powerpc/kernel/head_fsl_booke.S
>> @@ -194,13 +194,6 @@ set_ivor:
>> #endif
>> mtspr SPRN_MAS4, r2
>> -#if 0
>> - /* Enable DOZE */
>> - mfspr r2,SPRN_HID0
>> - oris r2,r2,HID0_DOZE@h
>> - mtspr SPRN_HID0, r2
>> -#endif
>> -
>> #if !defined(CONFIG_BDI_SWITCH)
>> /*
>> * The Abatron BDI JTAG debugger does not tolerate others
>>
>
> .
>
^ permalink raw reply
* Re: [PATCH kernel v3] KVM: PPC: Allocate guest TCEs on demand too
From: David Gibson @ 2019-03-04 0:54 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: linuxppc-dev, kvm-ppc
In-Reply-To: <20190301043436.90014-1-aik@ozlabs.ru>
[-- Attachment #1: Type: text/plain, Size: 7801 bytes --]
On Fri, Mar 01, 2019 at 03:34:36PM +1100, Alexey Kardashevskiy wrote:
> We already allocate hardware TCE tables in multiple levels and skip
> intermediate levels when we can, now it is a turn of the KVM TCE tables.
> Thankfully these are allocated already in 2 levels.
>
> This moves the table's last level allocation from the creating helper to
> kvmppc_tce_put() and kvm_spapr_tce_fault().
>
> This adds kvmppc_rm_ioba_validate() to do an additional test if
> the consequent kvmppc_tce_put() needs a page which has not been allocated;
> if this is the case, we bail out to virtual mode handlers.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> Changes:
> v3:
> * fixed alignments in kvmppc_rm_ioba_validate
>
> v2:
> * added kvm mutex around alloc_page to prevent races; in both place we
> test the pointer, if NULL, then take a lock and check again so on a fast
> path we do not take a lock at all
>
>
> ---
> For NVLink2 passthrough guests with 128TiB DMA windows and very fragmented
> system RAM the difference is gigabytes of RAM.
> ---
> arch/powerpc/kvm/book3s_64_vio.c | 29 ++++++------
> arch/powerpc/kvm/book3s_64_vio_hv.c | 71 ++++++++++++++++++++++++++---
> 2 files changed, 81 insertions(+), 19 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c
> index f02b04973710..7eed8c90ea3d 100644
> --- a/arch/powerpc/kvm/book3s_64_vio.c
> +++ b/arch/powerpc/kvm/book3s_64_vio.c
> @@ -228,7 +228,8 @@ static void release_spapr_tce_table(struct rcu_head *head)
> unsigned long i, npages = kvmppc_tce_pages(stt->size);
>
> for (i = 0; i < npages; i++)
> - __free_page(stt->pages[i]);
> + if (stt->pages[i])
> + __free_page(stt->pages[i]);
>
> kfree(stt);
> }
> @@ -242,6 +243,20 @@ static vm_fault_t kvm_spapr_tce_fault(struct vm_fault *vmf)
> return VM_FAULT_SIGBUS;
>
> page = stt->pages[vmf->pgoff];
> + if (!page) {
> + mutex_lock(&stt->kvm->lock);
> + page = stt->pages[vmf->pgoff];
> + if (!page) {
> + page = alloc_page(GFP_KERNEL | __GFP_ZERO);
> + if (!page) {
> + mutex_unlock(&stt->kvm->lock);
> + return VM_FAULT_OOM;
> + }
> + stt->pages[vmf->pgoff] = page;
> + }
> + mutex_unlock(&stt->kvm->lock);
> + }
> +
> get_page(page);
> vmf->page = page;
> return 0;
> @@ -296,7 +311,6 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
> struct kvmppc_spapr_tce_table *siter;
> unsigned long npages, size = args->size;
> int ret = -ENOMEM;
> - int i;
>
> if (!args->size || args->page_shift < 12 || args->page_shift > 34 ||
> (args->offset + args->size > (ULLONG_MAX >> args->page_shift)))
> @@ -320,12 +334,6 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
> stt->kvm = kvm;
> INIT_LIST_HEAD_RCU(&stt->iommu_tables);
>
> - for (i = 0; i < npages; i++) {
> - stt->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO);
> - if (!stt->pages[i])
> - goto fail;
> - }
> -
> mutex_lock(&kvm->lock);
>
> /* Check this LIOBN hasn't been previously allocated */
> @@ -352,11 +360,6 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
> if (ret >= 0)
> return ret;
>
> - fail:
> - for (i = 0; i < npages; i++)
> - if (stt->pages[i])
> - __free_page(stt->pages[i]);
> -
> kfree(stt);
> fail_acct:
> kvmppc_account_memlimit(kvmppc_stt_pages(npages), false);
> diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c
> index 2206bc729b9a..1cd9373f8bdc 100644
> --- a/arch/powerpc/kvm/book3s_64_vio_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_vio_hv.c
> @@ -158,23 +158,78 @@ static u64 *kvmppc_page_address(struct page *page)
> return (u64 *) page_address(page);
> }
>
> +/*
> + * TCEs pages are allocated in kvmppc_tce_put() which won't be able to do so
> + * in real mode.
> + * Check if kvmppc_tce_put() can succeed in real mode, i.e. a TCEs page is
> + * allocated or not required (when clearing a tce entry).
> + */
> +static long kvmppc_rm_ioba_validate(struct kvmppc_spapr_tce_table *stt,
> + unsigned long ioba, unsigned long npages, bool clearing)
> +{
> + unsigned long i, idx, sttpage, sttpages;
> + unsigned long ret = kvmppc_ioba_validate(stt, ioba, npages);
> +
> + if (ret)
> + return ret;
> + /*
> + * clearing==true says kvmppc_tce_put won't be allocating pages
> + * for empty tces.
> + */
> + if (clearing)
> + return H_SUCCESS;
> +
> + idx = (ioba >> stt->page_shift) - stt->offset;
> + sttpage = idx / TCES_PER_PAGE;
> + sttpages = _ALIGN_UP(idx % TCES_PER_PAGE + npages, TCES_PER_PAGE) /
> + TCES_PER_PAGE;
> + for (i = sttpage; i < sttpage + sttpages; ++i)
> + if (!stt->pages[i])
> + return H_TOO_HARD;
> +
> + return H_SUCCESS;
> +}
> +
> /*
> * Handles TCE requests for emulated devices.
> * Puts guest TCE values to the table and expects user space to convert them.
> * Called in both real and virtual modes.
> * Cannot fail so kvmppc_tce_validate must be called before it.
> *
> - * WARNING: This will be called in real-mode on HV KVM and virtual
> - * mode on PR KVM
> + * WARNING: This will be called in real-mode on HV HPT KVM and virtual
> + * mode on PR KVM or HV radix KVM
> */
> void kvmppc_tce_put(struct kvmppc_spapr_tce_table *stt,
> unsigned long idx, unsigned long tce)
> {
> struct page *page;
> u64 *tbl;
> + unsigned long sttpage;
>
> idx -= stt->offset;
> - page = stt->pages[idx / TCES_PER_PAGE];
> + sttpage = idx / TCES_PER_PAGE;
> + page = stt->pages[sttpage];
> +
> + if (!page) {
> + /* We allow any TCE, not just with read|write permissions */
> + if (!tce)
> + return;
> + /*
> + * We must not end up here in real mode,
> + * kvmppc_rm_ioba_validate() takes care of this.
> + */
> + mutex_lock(&stt->kvm->lock);
> + page = stt->pages[sttpage];
> + if (!page) {
> + page = alloc_page(GFP_KERNEL | __GFP_ZERO);
> + if (WARN_ON_ONCE(!page)) {
> + mutex_unlock(&stt->kvm->lock);
> + return;
> + }
> + stt->pages[sttpage] = page;
> + }
> + mutex_unlock(&stt->kvm->lock);
> + }
> tbl = kvmppc_page_address(page);
>
> tbl[idx % TCES_PER_PAGE] = tce;
> @@ -381,7 +436,7 @@ long kvmppc_rm_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
> if (!stt)
> return H_TOO_HARD;
>
> - ret = kvmppc_ioba_validate(stt, ioba, 1);
> + ret = kvmppc_rm_ioba_validate(stt, ioba, 1, tce == 0);
> if (ret != H_SUCCESS)
> return ret;
>
> @@ -480,7 +535,7 @@ long kvmppc_rm_h_put_tce_indirect(struct kvm_vcpu *vcpu,
> if (tce_list & (SZ_4K - 1))
> return H_PARAMETER;
>
> - ret = kvmppc_ioba_validate(stt, ioba, npages);
> + ret = kvmppc_rm_ioba_validate(stt, ioba, npages, false);
> if (ret != H_SUCCESS)
> return ret;
>
> @@ -583,7 +638,7 @@ long kvmppc_rm_h_stuff_tce(struct kvm_vcpu *vcpu,
> if (!stt)
> return H_TOO_HARD;
>
> - ret = kvmppc_ioba_validate(stt, ioba, npages);
> + ret = kvmppc_rm_ioba_validate(stt, ioba, npages, tce_value == 0);
> if (ret != H_SUCCESS)
> return ret;
>
> @@ -635,6 +690,10 @@ long kvmppc_h_get_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
>
> idx = (ioba >> stt->page_shift) - stt->offset;
> page = stt->pages[idx / TCES_PER_PAGE];
> + if (!page) {
> + vcpu->arch.regs.gpr[4] = 0;
> + return H_SUCCESS;
> + }
> tbl = (u64 *)page_address(page);
>
> vcpu->arch.regs.gpr[4] = tbl[idx % TCES_PER_PAGE];
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: powerpc: remote save_stack_trace_tsk_reliable export
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Joe Lawrence, live-patching, x86, linuxppc-dev; +Cc: Thomas Gleixner
In-Reply-To: <20190301191721.4010-1-joe.lawrence@redhat.com>
On Fri, 2019-03-01 at 19:17:21 UTC, Joe Lawrence wrote:
> As tglx points out, there are no in-tree module users of
> save_stack_trace_tsk_reliable() and its x86 counterpart is not exported,
> so remove the powerpc symbol export.
>
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> Acked-by: Balbir Singh <bsingharora@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/39070a96a1c2c502b2f77972ba8c2eba
cheers
^ permalink raw reply
* Re: [v2] powerpc/mm: fix "section_base" set but not used
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Qian Cai, benh, paulus; +Cc: linuxppc-dev, Qian Cai, hch, linux-kernel
In-Reply-To: <20190301142040.94204-1-cai@lca.pw>
On Fri, 2019-03-01 at 14:20:40 UTC, Qian Cai wrote:
> The commit 24b6d4164348 ("mm: pass the vmem_altmap to vmemmap_free")
> removed a line in vmemmap_free(),
>
> altmap = to_vmem_altmap((unsigned long) section_base);
>
> but left a variable no longer used.
>
> arch/powerpc/mm/init_64.c: In function 'vmemmap_free':
> arch/powerpc/mm/init_64.c:277:16: error: variable 'section_base' set but
> not used [-Werror=unused-but-set-variable]
>
> Signed-off-by: Qian Cai <cai@lca.pw>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c38ca265525a00d635219450e8fcc858
cheers
^ permalink raw reply
* Re: powerpc/64s: Fix unrelocated interrupt trampoline address test
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20190301125636.11292-1-npiggin@gmail.com>
On Fri, 2019-03-01 at 12:56:36 UTC, Nicholas Piggin wrote:
> The recent commit got this test wrong, it declared the assembler
> symbols the wrong way, and also used the wrong symbol name
> (xxx_start rather than start_xxx, see asm/head-64.h).
>
> Fixes: ccd477028a ("powerpc/64s: Fix HV NMI vs HV interrupt recoverability test")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/bd3524feac214f0ab9693c6d4c0cb5be
cheers
^ permalink raw reply
* Re: powerpc: fix "sz" set but not used
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Qian Cai, benh, paulus; +Cc: linuxppc-dev, Qian Cai, linux-kernel
In-Reply-To: <20190228023505.80092-1-cai@lca.pw>
On Thu, 2019-02-28 at 02:35:05 UTC, Qian Cai wrote:
> arch/powerpc/mm/hugetlbpage-hash64.c: In function '__hash_page_huge':
> arch/powerpc/mm/hugetlbpage-hash64.c:29:28: warning: variable 'sz' set
> but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Qian Cai <cai@lca.pw>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/8132cf115efc3b3684bb5fd3bfdf6860
cheers
^ permalink raw reply
* Re: powerpc/mm: Check secondary hash page table
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Rashmica Gupta, linuxppc-dev; +Cc: Rashmica Gupta, paulus
In-Reply-To: <20190212232949.21118-1-rashmica.g@gmail.com>
On Tue, 2019-02-12 at 23:29:49 UTC, Rashmica Gupta wrote:
> We were always calling base_hpte_find() with primary = true,
> even when we wanted to check the secondary table...
>
> Fixes: 1515ab932156 powerpc/mm: Dump hash table
>
> Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/790845e2f12709d273d08ea7a2af7c25
cheers
^ permalink raw reply
* Re: [1/2] powerpc: remove nargs from __SYSCALL
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Firoz Khan, Benjamin Herrenschmidt, Paul Mackerras, Al Viro,
linuxppc-dev, Greg Kroah-Hartman, Philippe Ombredanne,
Thomas Gleixner, Kate Stewart
Cc: linux-arch, arnd, y2038, linux-kernel, marcin.juszkiewicz,
firoz.khan, deepa.kernel
In-Reply-To: <1546441324-19774-2-git-send-email-firoz.khan@linaro.org>
On Wed, 2019-01-02 at 15:02:03 UTC, Firoz Khan wrote:
> The __SYSCALL macro's arguments are system call number,
> system call entry name and number of arguments for the
> system call.
>
> Argument- nargs in __SYSCALL(nr, entry, nargs) is neither
> calculated nor used anywhere. So it would be better to
> keep the implementaion as __SYSCALL(nr, entry). This will
> unifies the implementation with some other architetures
> too.
>
> Signed-off-by: Firoz Khan <firoz.khan@linaro.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/6b1200facc051a3e487a52cbabd745f7
cheers
^ permalink raw reply
* Re: powerpc/32: Clear on-stack exception marker upon exception return
From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
Nicolai Stange
Cc: linuxppc-dev, linux-kernel, stable
In-Reply-To: <d273fd9f1cc7ee36e1ee4da20631d507c39efe6d.1551267823.git.christophe.leroy@c-s.fr>
On Wed, 2019-02-27 at 11:45:30 UTC, Christophe Leroy wrote:
> Clear the on-stack STACK_FRAME_REGS_MARKER on exception exit in order
> to avoid confusing stacktrace like the one below.
>
> Call Trace:
> [c0e9dca0] [c01c42a0] print_address_description+0x64/0x2bc (unreliable)
> [c0e9dcd0] [c01c4684] kasan_report+0xfc/0x180
> [c0e9dd10] [c0895130] memchr+0x24/0x74
> [c0e9dd30] [c00a9e38] msg_print_text+0x124/0x574
> [c0e9dde0] [c00ab710] console_unlock+0x114/0x4f8
> [c0e9de40] [c00adc60] vprintk_emit+0x188/0x1c4
> --- interrupt: c0e9df00 at 0x400f330
> LR = init_stack+0x1f00/0x2000
> [c0e9de80] [c00ae3c4] printk+0xa8/0xcc (unreliable)
> [c0e9df20] [c0c27e44] early_irq_init+0x38/0x108
> [c0e9df50] [c0c15434] start_kernel+0x310/0x488
> [c0e9dff0] [00003484] 0x3484
>
> With this patch the trace becomes:
>
> Call Trace:
> [c0e9dca0] [c01c42c0] print_address_description+0x64/0x2bc (unreliable)
> [c0e9dcd0] [c01c46a4] kasan_report+0xfc/0x180
> [c0e9dd10] [c0895150] memchr+0x24/0x74
> [c0e9dd30] [c00a9e58] msg_print_text+0x124/0x574
> [c0e9dde0] [c00ab730] console_unlock+0x114/0x4f8
> [c0e9de40] [c00adc80] vprintk_emit+0x188/0x1c4
> [c0e9de80] [c00ae3e4] printk+0xa8/0xcc
> [c0e9df20] [c0c27e44] early_irq_init+0x38/0x108
> [c0e9df50] [c0c15434] start_kernel+0x310/0x488
> [c0e9dff0] [00003484] 0x3484
>
> Cc: stable@vger.kernel.org
> Cc: Nicolai Stange <nstange@suse.de>
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/9580b71b5a7863c24a9bd18bcd2ad759
cheers
^ permalink raw reply
* linux-next: Fixes tag needs some work in the powerpc tree
From: Stephen Rothwell @ 2019-03-03 20:38 UTC (permalink / raw)
To: Michael Ellerman, PowerPC
Cc: Linux Next Mailing List, Linux Kernel Mailing List,
Nicholas Piggin
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
Hi all,
In commit
bd3524feac21 ("powerpc/64s: Fix unrelocated interrupt trampoline address test")
Fixes tag
Fixes: ccd477028a ("powerpc/64s: Fix HV NMI vs HV interrupt recoverability test")
has these problem(s):
- SHA1 should be at least 12 digits long
Can be fixed by setting core.abbrev to 12 (or more) or (for git v2.11
or later) just making sure it is not set (or set to "auto").
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH] powerpc: remote save_stack_trace_tsk_reliable export
From: Singh, Balbir @ 2019-03-03 20:05 UTC (permalink / raw)
To: Joe Lawrence, live-patching, x86, linuxppc-dev; +Cc: Thomas Gleixner
In-Reply-To: <20190301191721.4010-1-joe.lawrence@redhat.com>
On 3/1/19 11:17 AM, Joe Lawrence wrote:
> As tglx points out, there are no in-tree module users of
> save_stack_trace_tsk_reliable() and its x86 counterpart is not exported,
> so remove the powerpc symbol export.
>
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> ---
> arch/powerpc/kernel/stacktrace.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
> index e2c50b55138f..42c587de21a9 100644
> --- a/arch/powerpc/kernel/stacktrace.c
> +++ b/arch/powerpc/kernel/stacktrace.c
> @@ -193,7 +193,6 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk,
> }
> return 0;
> }
> -EXPORT_SYMBOL_GPL(save_stack_trace_tsk_reliable);
> #endif /* CONFIG_HAVE_RELIABLE_STACKTRACE */
>
> #if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI)
>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Balbir Singh
^ permalink raw reply
* Re: [PATCH] KVM: PPC: powerpc: Add count cache flush parameters to kvmppc_get_cpu_char()
From: Michael Ellerman @ 2019-03-03 9:06 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, kvm-ppc, Suraj Jitindar Singh, kvm
In-Reply-To: <20190301080113.GB22341@blackberry>
Paul Mackerras <paulus@ozlabs.org> writes:
> On Fri, Mar 01, 2019 at 05:52:51PM +1100, Michael Ellerman wrote:
>> Suraj Jitindar Singh <sjitindarsingh@gmail.com> writes:
>>
>> > Add KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST &
>> > KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE to the characteristics returned from
>> > the H_GET_CPU_CHARACTERISTICS H-CALL, as queried from either the
>> > hypervisor or the device tree.
>> >
>> > Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
>> > ---
>> > arch/powerpc/include/uapi/asm/kvm.h | 2 ++
>> > arch/powerpc/kvm/powerpc.c | 18 ++++++++++++++----
>> > 2 files changed, 16 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
>> > index b90a7d154180..a99dcac91e50 100644
>> > --- a/arch/powerpc/kvm/powerpc.c
>> > +++ b/arch/powerpc/kvm/powerpc.c
>> > @@ -2251,12 +2253,16 @@ static int kvmppc_get_cpu_char(struct kvm_ppc_cpu_char *cp)
>> > if (have_fw_feat(fw_features, "enabled",
>> > "fw-count-cache-disabled"))
>> > cp->character |= KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS;
>> > + if (have_fw_feat(fw_features, "enabled",
>> > + "fw-count-cache-flush-bcctr2,0,0"))
>>
>> I don't think there's any reason KVM needs to be querying the device
>> tree directly, is there?
>>
>> Can't it just use the security flags (security_features.h), that are
>> initialised by the powernv platform code based on the device tree.
>
> My recollection is that the security flags didn't have all the
> information we need. It's possible that's no longer true.
Actually I don't think they existed at all back then, we didn't add them
until after the initial panic.
> I merged the patch and sent a pull request to Paolo; using the same
> pattern as the existing code made it a low-risk patch and I wanted to
> get it in for 5.1. For 5.2 we can look at changing it over if you
> like.
Yep that's fine.
cheers
^ permalink raw reply
* Re: [PATCH 3/6] x86: clean up _TIF_SYSCALL_EMU handling using ptrace_syscall_enter hook
From: Andy Lutomirski @ 2019-03-03 1:11 UTC (permalink / raw)
To: Sudeep Holla
Cc: Haibo Xu, Steve Capper, Catalin Marinas, Jeff Dike, X86 ML,
Will Deacon, LKML, Oleg Nesterov, Richard Weinberger, Ingo Molnar,
Paul Mackerras, Andy Lutomirski, Borislav Petkov, Thomas Gleixner,
Bin Lu, linuxppc-dev, linux-arm-kernel
In-Reply-To: <20190228183220.15626-4-sudeep.holla@arm.com>
On Thu, Feb 28, 2019 at 10:32 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> Now that we have a new hook ptrace_syscall_enter that can be called from
> syscall entry code and it handles PTRACE_SYSEMU in generic code, we
> can do some cleanup using the same in syscall_trace_enter.
>
> Further the extra logic to find single stepping PTRACE_SYSEMU_SINGLESTEP
> in syscall_slow_exit_work seems unnecessary. Let's remove the same.
I wasn't cc'd on the whole series, so I can't easily review this. Do
you have a test case to make sure that emulation still works? Are
there adequate tests in tools/testing/selftests/x86? Do they still
pass after this patch?
--Andy
^ permalink raw reply
* [PATCH V3] ASoC: fsl_asrc: add constraint for the asrc of older version
From: S.j. Wang @ 2019-03-02 5:52 UTC (permalink / raw)
To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com,
festevam@gmail.com, broonie@kernel.org,
alsa-devel@alsa-project.org
Cc: linuxppc-dev@lists.ozlabs.org
There is a constraint for the channel number setting on the
asrc of older version (e.g. imx35), the channel number should
be even, odd number isn't valid.
So add this constraint when the asrc of older version is used.
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
Changes in v3
- fix comments with Nicolin's review
sound/soc/fsl/fsl_asrc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 528e8b108422..0b937924d2e4 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -445,6 +445,19 @@ struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
}
EXPORT_SYMBOL_GPL(fsl_asrc_get_dma_channel);
+static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai);
+
+ /* Odd channel number is not valid for older ASRC (channel_bits==3) */
+ if (asrc_priv->channel_bits == 3)
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_CHANNELS, 2);
+
+ return 0;
+}
+
static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
@@ -539,6 +552,7 @@ static int fsl_asrc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
}
static const struct snd_soc_dai_ops fsl_asrc_dai_ops = {
+ .startup = fsl_asrc_dai_startup,
.hw_params = fsl_asrc_dai_hw_params,
.hw_free = fsl_asrc_dai_hw_free,
.trigger = fsl_asrc_dai_trigger,
--
1.9.1
^ permalink raw reply related
* RE: [PATCH V2] ASoC: fsl_asrc: add constraint for the asrc of older version
From: S.j. Wang @ 2019-03-02 5:47 UTC (permalink / raw)
To: Nicolin Chen
Cc: alsa-devel@alsa-project.org, timur@kernel.org,
Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20190301182743.GA6305@Asurada-Nvidia.nvidia.com>
Hi
> On Fri, Mar 01, 2019 at 08:37:08AM +0000, S.j. Wang wrote:
> > There is constraint for the channel number setting on the
>
> nit: "a constraint"
>
> > asrc of older version (e.g. imx35), the channel number should be even,
> > odd number isn't valid.
>
> > +static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
> > + struct snd_soc_dai *dai)
> > +{
> > + struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai);
> > +
> > + /* channel_bits = 3 means older version on imx35*/
>
> Space between '5' and '*'. And better to make it clear:
>
> /* Odd channel number is not valid for older ASRC (channel_bits==3)
> */
>
> > + if (asrc_priv->channel_bits == 3)
> > + snd_pcm_hw_constraint_step(substream->runtime, 0,
> > +
> SNDRV_PCM_HW_PARAM_CHANNELS, 2);
>
> For your next version,
>
> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Ok, thanks, will send v3.
>
> Cheers
^ permalink raw reply
* RE: [alsa-devel] [PATCH] ASoC: cs42xx8: Remove S32_LE in format list
From: S.j. Wang @ 2019-03-02 5:42 UTC (permalink / raw)
To: Timur Tabi, Matt Flax, Nicolin Chen
Cc: linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org,
broonie@kernel.org, festevam@gmail.com, Xiubo.Lee@gmail.com
In-Reply-To: <de5ebabd-52a5-dedb-6710-8f09e1a4e380@kernel.org>
Hi
> On 3/1/19 12:32 AM, S.j. Wang wrote:
> > This case is covered by S24_LE I think. The S32_LE means the data is
> > 32bit and slot width Is 32bit, this is not in data sheet.
>
> The problem is that if you have 32-bit samples in your audio file, and you
> want to play them, then software (e.g. alsalib) will need to convert the
> audio to 24-bit before sending it to hardware. This is unnecessary because
> the hardware can "convert" the sample to 24-bit automatically by ignoring
> the lower 8 bits.
>
> I think a lot of codecs do this already.
Ok. Thanks for reviewing, I will drop this patch.
Best regards
Wang shengjiu
^ permalink raw reply
* Re: [PATCH 2/5] ocxl: Clean up printf formats
From: Joe Perches @ 2019-03-02 1:13 UTC (permalink / raw)
To: Alastair D'Silva, alastair
Cc: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel, Andrew Donnellan,
Frederic Barrat, linuxppc-dev
In-Reply-To: <20190227045741.21412-3-alastair@au1.ibm.com>
On Wed, 2019-02-27 at 15:57 +1100, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> Use %# instead of using a literal '0x'
<shrug> I think it's better not to change this unless
the compilation unit already uses a mix of styles.
Overall, the kernel uses "0x%<hex type>" over "%#<hex type>"
by ~8:1
$ git grep -P '0x%\d*[hl]*x' | wc -l
27654
$ git grep -P '%#\d*[hl]*x' | wc -l
3454
> diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c
[]
> @@ -178,9 +178,9 @@ static int read_dvsec_vendor(struct pci_dev *dev)
> pci_read_config_dword(dev, pos + OCXL_DVSEC_VENDOR_DLX_VERS, &dlx);
>
> dev_dbg(&dev->dev, "Vendor specific DVSEC:\n");
> - dev_dbg(&dev->dev, " CFG version = 0x%x\n", cfg);
> - dev_dbg(&dev->dev, " TLX version = 0x%x\n", tlx);
> - dev_dbg(&dev->dev, " DLX version = 0x%x\n", dlx);
> + dev_dbg(&dev->dev, " CFG version = %#x\n", cfg);
> + dev_dbg(&dev->dev, " TLX version = %#x\n", tlx);
> + dev_dbg(&dev->dev, " DLX version = %#x\n", dlx);
[...]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox