[PATCH] powerpc/32: Preserve cr1 in exception prolog stack check to fix build error

2021-02-07 Thread Christophe Leroy
THREAD_ALIGN_SHIFT = THREAD_SHIFT + 1 = PAGE_SHIFT + 1 Maximum PAGE_SHIFT is 18 for 256k pages so THREAD_ALIGN_SHIFT is 19 at the maximum. No need to clobber cr1, it can be preserved when moving r1 into CR when we check stack overflow. This reduces the number of instructions in Machine Check Exce

[PATCH] powerpc/64s: Remove EXSLB interrupt save area

2021-02-07 Thread Nicholas Piggin
SLB faults should not be taken while the PACA save areas are live, all memory accesses should be fetches from the kernel text, and access to PACA and the current stack, before C code is called or any other accesses are made. All of these have pinned SLBs so will not take a SLB fault. Therefore EXS

[PATCH] powerpc/64s: syscall real mode entry use mtmsrd rather than rfid

2021-02-07 Thread Nicholas Piggin
Have the real mode system call entry handler branch to the kernel 0xc000... address and then use mtmsrd to enable the MMU, rather than use SRRs and rfid. Commit 8729c26e675c ("powerpc/64s/exception: Move real to virt switch into the common handler") implemented this style of real mode entry for ot

Re: [RFC Qemu PATCH v2 1/2] spapr: drc: Add support for async hcalls at the drc level

2021-02-07 Thread David Gibson
On Tue, Jan 19, 2021 at 12:40:31PM +0530, Shivaprasad G Bhat wrote: > Thanks for the comments! > > > On 12/28/20 2:08 PM, David Gibson wrote: > > > On Mon, Dec 21, 2020 at 01:08:53PM +0100, Greg Kurz wrote: > ... > > > The overall idea looks good but I think you should consider using > > > a thr

Re: [PATCH v5 03/10] powerpc/signal64: Move non-inline functions out of setup_sigcontext()

2021-02-07 Thread Daniel Axtens
Hi Chris, These two paragraphs are a little confusing and they seem slightly repetitive. But I get the general idea. Two specific comments below: > There are non-inline functions which get called in setup_sigcontext() to > save register state to the thread struct. Move these functions into a > se

Re: [PATCH v16 11/12] powerpc: Use OF alloc and free for FDT

2021-02-07 Thread Michael Ellerman
Rob Herring writes: > On Thu, Feb 4, 2021 at 10:42 AM Lakshmi Ramasubramanian > wrote: ... >> diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c >> index d0e459bb2f05..51d2d8eb6c1b 100644 >> --- a/arch/powerpc/kexec/elf_64.c >> +++ b/arch/powerpc/kexec/elf_64.c >> @@ -19,6 +19

[PATCH] ASoC: imx-hdmi: no need to set .owner when using module_platform_driver

2021-02-07 Thread Tian Tao
the module_platform_driver will call platform_driver_register. and It will set the .owner to THIS_MODULE Signed-off-by: Tian Tao --- sound/soc/fsl/imx-hdmi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c index dbbb7618..cd0235a 100644 ---

[PATCH v3 2/2] selftests/powerpc: Test for spurious kernel memory faults on radix

2021-02-07 Thread Jordan Niethe
Previously when mapping kernel memory on radix, no ptesync was included which would periodically lead to unhandled spurious faults. Mapping kernel memory is used when code patching with Strict RWX enabled. As suggested by Chris Riedl, turning ftrace on and off does a large amount of code patching

[PATCH v3 1/2] powerpc/64s: Fix pte update for kernel memory on radix

2021-02-07 Thread Jordan Niethe
When adding a pte a ptesync is needed to order the update of the pte with subsequent accesses otherwise a spurious fault may be raised. radix__set_pte_at() does not do this for performance gains. For non-kernel memory this is not an issue as any faults of this kind are corrected by the page fault

Re: [PATCH] mm/memtest: Add ARCH_USE_MEMTEST

2021-02-07 Thread Anshuman Khandual
On 2/5/21 2:50 PM, Vladimir Murzin wrote: > Hi Anshuman, > > On 2/5/21 4:10 AM, Anshuman Khandual wrote: >> early_memtest() does not get called from all architectures. Hence enabling >> CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel command line >> option might not trigger the memor

Re: [PATCH] mm/memtest: Add ARCH_USE_MEMTEST

2021-02-07 Thread Anshuman Khandual
On 2/5/21 1:05 PM, Max Filippov wrote: > On Thu, Feb 4, 2021 at 8:10 PM Anshuman Khandual > wrote: >> >> early_memtest() does not get called from all architectures. Hence enabling >> CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel command line >> option might not trigger the memory p

[PATCH 8/8] xen-swiotlb: remove the unused size argument from xen_swiotlb_fixup

2021-02-07 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index b2d9e77059bf5a..621a20c1143597 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen

[PATCH 7/8] xen-swiotlb: split xen_swiotlb_init

2021-02-07 Thread Christoph Hellwig
Split xen_swiotlb_init into a normal an an early case. That makes both much simpler and more readable, and also allows marking the early code as __init and x86-only. Signed-off-by: Christoph Hellwig --- arch/arm/xen/mm.c | 2 +- arch/x86/xen/pci-swiotlb-xen.c | 4 +- drivers/xe

[PATCH 2/8] xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer

2021-02-07 Thread Christoph Hellwig
Use the is_swiotlb_buffer to check if a physical address is a swiotlb buffer. This works because xen-swiotlb does use the same buffer as the main swiotlb code, and xen_io_tlb_{start,end} are just the addresses for it that went through phys_to_virt. Signed-off-by: Christoph Hellwig --- drivers/x

[PATCH 6/8] swiotlb: lift the double initialization protection from xen-swiotlb

2021-02-07 Thread Christoph Hellwig
Lift the double initialization protection from xen-swiotlb to the core code to avoid exposing too many swiotlb internals. Also upgrade the check to a warning as it should not happen. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 7 --- kernel/dma/swiotlb.c | 8 ++

[PATCH 3/8] xen-swiotlb: use io_tlb_end in xen_swiotlb_dma_supported

2021-02-07 Thread Christoph Hellwig
Use the existing variable that holds the physical address for xen_io_tlb_end to simplify xen_swiotlb_dma_supported a bit, and remove the otherwise unused xen_io_tlb_end variable and the xen_virt_to_bus helper. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 10 ++ 1 file

[PATCH 1/8] powerpc/svm: stop using io_tlb_start

2021-02-07 Thread Christoph Hellwig
Use the local variable that is passed to swiotlb_init_with_tbl for freeing the memory in the failure case to isolate the code a little better from swiotlb internals. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[PATCH 4/8] xen-swiotlb: remove xen_set_nslabs

2021-02-07 Thread Christoph Hellwig
The xen_set_nslabs function is a little weird, as it has just one caller, that caller passes a global variable as the argument, which is then overriden in the function and a derivative of it returned. Just add a cpp symbol for the default size using a readable constant and open code the remaining

swiotlb cleanups

2021-02-07 Thread Christoph Hellwig
Hi Konrad, this series contains a bunch of swiotlb cleanups, mostly to reduce the amount of internals exposed to code outside of swiotlb.c, which should helper to prepare for supporting multiple different bounce buffer pools.

[PATCH 5/8] xen-swiotlb: remove xen_io_tlb_start and xen_io_tlb_nslabs

2021-02-07 Thread Christoph Hellwig
The xen_io_tlb_start and xen_io_tlb_nslabs variables ar now only used in xen_swiotlb_init, so replace them with local variables. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 57 +-- 1 file changed, 25 insertions(+), 32 deletions(-) diff --

Re: [PATCH RFC v1 5/6] xen-swiotlb: convert variables to arrays

2021-02-07 Thread Christoph Hellwig
On Thu, Feb 04, 2021 at 09:40:23AM +0100, Christoph Hellwig wrote: > So one thing that has been on my mind for a while: I'd really like > to kill the separate dma ops in Xen swiotlb. If we compare xen-swiotlb > to swiotlb the main difference seems to be: > > - additional reasons to bounce I/O v

Re: [PATCH v7 42/42] powerpc/64s: power4 nap fixup in C

2021-02-07 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of February 2, 2021 8:31 pm: > Nicholas Piggin writes: >> There is no need for this to be in asm, use the new intrrupt entry wrapper. >> >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/include/asm/interrupt.h | 15 + >> arch/powerpc/inc

Re: [PATCH v7 28/42] powerpc: convert interrupt handlers to use wrappers

2021-02-07 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of February 5, 2021 6:09 pm: > > > Le 30/01/2021 à 14:08, Nicholas Piggin a écrit : >> Signed-off-by: Nicholas Piggin >> --- > >> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c >> index f70d3f6174c8..7ff915aae8ec 100644 >> --- a/a

Re: [PATCH v7 39/42] powerpc: move NMI entry/exit code into wrapper

2021-02-07 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of February 6, 2021 12:46 pm: > Excerpts from Michael Ellerman's message of February 6, 2021 9:38 am: >> Nicholas Piggin writes: >>> Excerpts from Michael Ellerman's message of February 4, 2021 8:15 pm: Nicholas Piggin writes: > This moves the comm

Re: [PATCH] ASoC: fsl: constify static snd_soc_dai_ops structs

2021-02-07 Thread Shengjiu Wang
On Sun, Feb 7, 2021 at 6:58 AM Rikard Falkeborn wrote: > > The only usage of these is to assign their address to the 'ops' field in > the snd_soc_dai_driver struct, which is a pointer to const. Make them > const to allow the compiler to put them in read-only memory. > > Signed-off-by: Rikard Falke

Re: [PATCH 2/8] powerpc/signal: Add unsafe_copy_{vsx, fpr}_from_user()

2021-02-07 Thread Christophe Leroy
Le 06/02/2021 à 18:39, Christopher M. Riedl a écrit : On Sat Feb 6, 2021 at 10:32 AM CST, Christophe Leroy wrote: Le 20/10/2020 à 04:01, Christopher M. Riedl a écrit : On Fri Oct 16, 2020 at 10:48 AM CDT, Christophe Leroy wrote: Le 15/10/2020 à 17:01, Christopher M. Riedl a écrit : Reu

[PATCH] powerpc/uaccess: Perform barrier_nospec() in KUAP allowance helpers

2021-02-07 Thread Christophe Leroy
barrier_nospec() in uaccess helpers is there to protect against speculative accesses around access_ok(). When using user_access_begin() sequences together with unsafe_get_user() like macros, barrier_nospec() is called for every single read although we know the access_ok() is done onece. Since all

Re: [PATCH 5/7] ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg

2021-02-07 Thread Shengjiu Wang
On Fri, Feb 5, 2021 at 11:00 PM Mark Brown wrote: > > On Fri, Feb 05, 2021 at 02:57:28PM +0800, Shengjiu Wang wrote: > > > + if (params_format(params) == SNDRV_PCM_FORMAT_S16_LE) > > + msg->s_msg.param.format = RPMSG_S16_LE; > > + else if (params_format(params) == SNDRV_PCM_F

Re: [PATCH 4/7] ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel

2021-02-07 Thread Shengjiu Wang
On Fri, Feb 5, 2021 at 10:27 PM Mark Brown wrote: > > On Fri, Feb 05, 2021 at 02:57:27PM +0800, Shengjiu Wang wrote: > > > + /* TYPE C is notification from M core */ > > + if (r_msg->header.type == MSG_TYPE_C) { > > + if (r_msg->header.cmd == TX_PERIOD_DONE) { > > > +