* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Mathieu Malaterre @ 2019-05-23 6:24 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev
In-Reply-To: <33ab57c7-294a-6ae4-d678-1490ce5b97f1@c-s.fr>
Salut Christophe,
On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
>
>
>
> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
> > Hi all,
> >
> > I have not boot my G4 in a while, today using master here is what I see:
> >
> > done
> > Setting btext !
> > W=640 H=488 LB=768 addr=0x9c008000
> > copying OF device tree...
> > starting device tree allocs at 01401000
> > otloc_up(00100000, 0013d948)
> > trying: 0x01401000
> > trying: 0x01501000
> > -› 01501000
> > alloc_bottom : 01601000
> > alloc_top : 20000000
> > alloc_top_hi : 20000000
> > nmo_top : 20000000
> > ram_top : 20000000
> > Building dt strings...
> > Building dt structure...
> > reserved memory map:
> > 00d40000 - 006c1000
> > Device tree strings 0x01502000 -> 0x00000007
> > Device tree struct 0x01503000 -> 0x00000007
> > Quiescing Open Firmware ...
> > Booting Linux via __start() @ 0x001400000
> > ->dt_headr_start=0x01501000
> >
> > Any suggestions before I start a bisect ?
> >
>
> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
Using locally:
diff --git a/arch/powerpc/configs/g4_defconfig
b/arch/powerpc/configs/g4_defconfig
index 14d0376f637d..916bce8ce9c3 100644
--- a/arch/powerpc/configs/g4_defconfig
+++ b/arch/powerpc/configs/g4_defconfig
@@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
CONFIG_G4_CPU=y
+# CONFIG_PPC_KUEP is not set
+# CONFIG_PPC_KUAP is not set
CONFIG_PANIC_TIMEOUT=0
# CONFIG_PPC_CHRP is not set
CONFIG_CPU_FREQ=y
Leads to almost the same error (some values have changed):
done
Setting btext !
W=640 H=488 LB=768 addr=0x9c008000
copying OF device tree...
starting device tree allocs at 01300000
alloc_up(00100000, 0013d948)
trying: 0x01300000
trying: 0x01400000
-› 01400000
alloc_bottom : 01500000
alloc_top : 20000000
alloc_top_hi : 20000000
nmo_top : 20000000
ram_top : 20000000
Building dt strings...
Building dt structure...
reserved memory map:
00c40000 - 006c0000
Device tree strings 0x01401000 -> 0x00000007
Device tree struct 0x01402000 -> 0x00000007
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x001400000
->dt_headr_start=0x01400000
Thanks anyway,
^ permalink raw reply related
* Re: [RFC PATCH 6/7] kasan: allow arches to hook into global registration
From: Christophe Leroy @ 2019-05-23 6:31 UTC (permalink / raw)
To: Daniel Axtens, aneesh.kumar, bsingharora; +Cc: linuxppc-dev, kasan-dev
In-Reply-To: <20190523052120.18459-7-dja@axtens.net>
Le 23/05/2019 à 07:21, Daniel Axtens a écrit :
> Not all arches have a specific space carved out for modules -
> some, such as powerpc, just use regular vmalloc space. Therefore,
> globals in these modules cannot be backed by real shadow memory.
Can you explain in more details the reason why ?
PPC32 also uses regular vmalloc space, and it has been possible to
manage globals on it, by simply implementing a module_alloc() function.
See
https://elixir.bootlin.com/linux/v5.2-rc1/source/arch/powerpc/mm/kasan/kasan_init_32.c#L135
It is also possible to easily define a different area for modules, by
replacing the call to vmalloc_exec() by a call to __vmalloc_node_range()
as done by vmalloc_exec(), but with different bounds than
VMALLOC_START/VMALLOC_END
See https://elixir.bootlin.com/linux/v5.2-rc1/source/mm/vmalloc.c#L2633
Today in PPC64 (unlike PPC32), there is already a split between VMALLOC
space and IOREMAP space. I'm sure it would be easy to split it once more
for modules.
Christophe
>
> In order to allow arches to perform this check, add a hook.
>
> Signed-off-by: Daniel Axtens <dja@axtens.net>
> ---
> include/linux/kasan.h | 5 +++++
> mm/kasan/generic.c | 3 +++
> 2 files changed, 8 insertions(+)
>
> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
> index dfee2b42d799..4752749e4797 100644
> --- a/include/linux/kasan.h
> +++ b/include/linux/kasan.h
> @@ -18,6 +18,11 @@ struct task_struct;
> static inline bool kasan_arch_is_ready(void) { return true; }
> #endif
>
> +#ifndef kasan_arch_can_register_global
> +static inline bool kasan_arch_can_register_global(const void * addr) { return true; }
> +#endif
> +
> +
> #ifndef ARCH_HAS_KASAN_EARLY_SHADOW
> extern unsigned char kasan_early_shadow_page[PAGE_SIZE];
> extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE];
> diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
> index 0336f31bbae3..935b06f659a0 100644
> --- a/mm/kasan/generic.c
> +++ b/mm/kasan/generic.c
> @@ -208,6 +208,9 @@ static void register_global(struct kasan_global *global)
> {
> size_t aligned_size = round_up(global->size, KASAN_SHADOW_SCALE_SIZE);
>
> + if (!kasan_arch_can_register_global(global->beg))
> + return;
> +
> kasan_unpoison_shadow(global->beg, global->size);
>
> kasan_poison_shadow(global->beg + aligned_size,
>
^ permalink raw reply
* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Christophe Leroy @ 2019-05-23 6:39 UTC (permalink / raw)
To: Mathieu Malaterre; +Cc: linuxppc-dev
In-Reply-To: <CA+7wUsywReRnB1ASdbVrNRkWyPkSKhruBKo57kX--1qmU8hv7A@mail.gmail.com>
Salut Mathieu,
Le 23/05/2019 à 08:24, Mathieu Malaterre a écrit :
> Salut Christophe,
>
> On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>>
>>
>>
>> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
>>> Hi all,
>>>
>>> I have not boot my G4 in a while, today using master here is what I see:
>>>
>>> done
>>> Setting btext !
>>> W=640 H=488 LB=768 addr=0x9c008000
>>> copying OF device tree...
>>> starting device tree allocs at 01401000
>>> otloc_up(00100000, 0013d948)
>>> trying: 0x01401000
>>> trying: 0x01501000
>>> -› 01501000
>>> alloc_bottom : 01601000
>>> alloc_top : 20000000
>>> alloc_top_hi : 20000000
>>> nmo_top : 20000000
>>> ram_top : 20000000
>>> Building dt strings...
>>> Building dt structure...
>>> reserved memory map:
>>> 00d40000 - 006c1000
>>> Device tree strings 0x01502000 -> 0x00000007
>>> Device tree struct 0x01503000 -> 0x00000007
>>> Quiescing Open Firmware ...
>>> Booting Linux via __start() @ 0x001400000
>>> ->dt_headr_start=0x01501000
>>>
>>> Any suggestions before I start a bisect ?
>>>
>>
>> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
>
> Using locally:
>
> diff --git a/arch/powerpc/configs/g4_defconfig
> b/arch/powerpc/configs/g4_defconfig
> index 14d0376f637d..916bce8ce9c3 100644
> --- a/arch/powerpc/configs/g4_defconfig
> +++ b/arch/powerpc/configs/g4_defconfig
> @@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
> # CONFIG_COMPAT_BRK is not set
> CONFIG_PROFILING=y
> CONFIG_G4_CPU=y
> +# CONFIG_PPC_KUEP is not set
> +# CONFIG_PPC_KUAP is not set
> CONFIG_PANIC_TIMEOUT=0
> # CONFIG_PPC_CHRP is not set
> CONFIG_CPU_FREQ=y
>
>
> Leads to almost the same error (some values have changed):
Ok.
When you say you are using 'master', what do you mean ? Can you give the
commit Id ?
Does it boots with Kernel 5.1.4 ?
Did you try latest powerpc/merge branch ?
Can you send your full .config ?
Christophe
>
> done
> Setting btext !
> W=640 H=488 LB=768 addr=0x9c008000
> copying OF device tree...
> starting device tree allocs at 01300000
> alloc_up(00100000, 0013d948)
> trying: 0x01300000
> trying: 0x01400000
> -› 01400000
> alloc_bottom : 01500000
> alloc_top : 20000000
> alloc_top_hi : 20000000
> nmo_top : 20000000
> ram_top : 20000000
> Building dt strings...
> Building dt structure...
> reserved memory map:
> 00c40000 - 006c0000
> Device tree strings 0x01401000 -> 0x00000007
> Device tree struct 0x01402000 -> 0x00000007
> Quiescing Open Firmware ...
> Booting Linux via __start() @ 0x001400000
> ->dt_headr_start=0x01400000
>
> Thanks anyway,
>
^ permalink raw reply
* [PATCH] powerpc/32s: Include <linux/moduleloader.h> header file to fix a warning
From: Mathieu Malaterre @ 2019-05-23 6:49 UTC (permalink / raw)
To: Michael Ellerman
Cc: Mathieu Malaterre, Paul Mackerras, linuxppc-dev, linux-kernel
In commit 2edb16efc899 ("powerpc/32: Add KASAN support") support for
KASAN has been added. However building it as module leads to (warning
treated as error with W=1):
arch/powerpc/mm/kasan/kasan_init_32.c:135:7: error: no previous prototype for 'module_alloc' [-Werror=missing-prototypes]
Make sure to include <linux/moduleloader.h> to provide the following
prototype: module_alloc.
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
arch/powerpc/mm/kasan/kasan_init_32.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/mm/kasan/kasan_init_32.c b/arch/powerpc/mm/kasan/kasan_init_32.c
index 0d62be3cba47..0c31e440d094 100644
--- a/arch/powerpc/mm/kasan/kasan_init_32.c
+++ b/arch/powerpc/mm/kasan/kasan_init_32.c
@@ -7,6 +7,7 @@
#include <linux/memblock.h>
#include <linux/sched/task.h>
#include <linux/vmalloc.h>
+#include <linux/moduleloader.h>
#include <asm/pgalloc.h>
#include <asm/code-patching.h>
#include <mm/mmu_decl.h>
--
2.20.1
^ permalink raw reply related
* Re: [PATCH] powerpc/32s: Include <linux/moduleloader.h> header file to fix a warning
From: Christophe Leroy @ 2019-05-23 6:54 UTC (permalink / raw)
To: Mathieu Malaterre, Michael Ellerman
Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20190523064956.29008-1-malat@debian.org>
Le 23/05/2019 à 08:49, Mathieu Malaterre a écrit :
> In commit 2edb16efc899 ("powerpc/32: Add KASAN support") support for
> KASAN has been added. However building it as module leads to (warning
> treated as error with W=1):
>
> arch/powerpc/mm/kasan/kasan_init_32.c:135:7: error: no previous prototype for 'module_alloc' [-Werror=missing-prototypes]
>
> Make sure to include <linux/moduleloader.h> to provide the following
> prototype: module_alloc.
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
Fixes: 2edb16efc899 ("powerpc/32: Add KASAN support")
Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> arch/powerpc/mm/kasan/kasan_init_32.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/mm/kasan/kasan_init_32.c b/arch/powerpc/mm/kasan/kasan_init_32.c
> index 0d62be3cba47..0c31e440d094 100644
> --- a/arch/powerpc/mm/kasan/kasan_init_32.c
> +++ b/arch/powerpc/mm/kasan/kasan_init_32.c
> @@ -7,6 +7,7 @@
> #include <linux/memblock.h>
> #include <linux/sched/task.h>
> #include <linux/vmalloc.h>
> +#include <linux/moduleloader.h>
> #include <asm/pgalloc.h>
> #include <asm/code-patching.h>
> #include <mm/mmu_decl.h>
>
^ permalink raw reply
* Re: [RFC PATCH 6/7] kasan: allow arches to hook into global registration
From: Daniel Axtens @ 2019-05-23 6:59 UTC (permalink / raw)
To: Christophe Leroy, aneesh.kumar, bsingharora; +Cc: linuxppc-dev, kasan-dev
In-Reply-To: <b7f23406-c1dc-de50-d477-86cdf8f0d471@c-s.fr>
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> Le 23/05/2019 à 07:21, Daniel Axtens a écrit :
>> Not all arches have a specific space carved out for modules -
>> some, such as powerpc, just use regular vmalloc space. Therefore,
>> globals in these modules cannot be backed by real shadow memory.
>
> Can you explain in more details the reason why ?
At this point, purely simplicity. As you discuss below, it's possible to
do better.
>
> PPC32 also uses regular vmalloc space, and it has been possible to
> manage globals on it, by simply implementing a module_alloc() function.
>
> See
> https://elixir.bootlin.com/linux/v5.2-rc1/source/arch/powerpc/mm/kasan/kasan_init_32.c#L135
>
> It is also possible to easily define a different area for modules, by
> replacing the call to vmalloc_exec() by a call to __vmalloc_node_range()
> as done by vmalloc_exec(), but with different bounds than
> VMALLOC_START/VMALLOC_END
>
> See https://elixir.bootlin.com/linux/v5.2-rc1/source/mm/vmalloc.c#L2633
>
> Today in PPC64 (unlike PPC32), there is already a split between VMALLOC
> space and IOREMAP space. I'm sure it would be easy to split it once more
> for modules.
>
OK, good to know, I'll look into one of those approaches for the next
spin!
Regards,
Daniel
> Christophe
>
>>
>> In order to allow arches to perform this check, add a hook.
>>
>> Signed-off-by: Daniel Axtens <dja@axtens.net>
>> ---
>> include/linux/kasan.h | 5 +++++
>> mm/kasan/generic.c | 3 +++
>> 2 files changed, 8 insertions(+)
>>
>> diff --git a/include/linux/kasan.h b/include/linux/kasan.h
>> index dfee2b42d799..4752749e4797 100644
>> --- a/include/linux/kasan.h
>> +++ b/include/linux/kasan.h
>> @@ -18,6 +18,11 @@ struct task_struct;
>> static inline bool kasan_arch_is_ready(void) { return true; }
>> #endif
>>
>> +#ifndef kasan_arch_can_register_global
>> +static inline bool kasan_arch_can_register_global(const void * addr) { return true; }
>> +#endif
>> +
>> +
>> #ifndef ARCH_HAS_KASAN_EARLY_SHADOW
>> extern unsigned char kasan_early_shadow_page[PAGE_SIZE];
>> extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE];
>> diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
>> index 0336f31bbae3..935b06f659a0 100644
>> --- a/mm/kasan/generic.c
>> +++ b/mm/kasan/generic.c
>> @@ -208,6 +208,9 @@ static void register_global(struct kasan_global *global)
>> {
>> size_t aligned_size = round_up(global->size, KASAN_SHADOW_SCALE_SIZE);
>>
>> + if (!kasan_arch_can_register_global(global->beg))
>> + return;
>> +
>> kasan_unpoison_shadow(global->beg, global->size);
>>
>> kasan_poison_shadow(global->beg + aligned_size,
>>
^ permalink raw reply
* Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE
From: Christophe Leroy @ 2019-05-23 7:00 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel, Nicholas Piggin
In-Reply-To: <20190523061427.GA19655@blackberry>
Le 23/05/2019 à 08:14, Paul Mackerras a écrit :
> On Tue, Apr 30, 2019 at 12:39:03PM +0000, Christophe Leroy wrote:
>> This patch implements a fast entry for syscalls.
>>
>> Syscalls don't have to preserve non volatile registers except LR.
>>
>> This patch then implement a fast entry for syscalls, where
>> volatile registers get clobbered.
>>
>> As this entry is dedicated to syscall it always sets MSR_EE
>> and warns in case MSR_EE was previously off
>>
>> It also assumes that the call is always from user, system calls are
>> unexpected from kernel.
>
> This is now upstream as commit 1a4b739bbb4f. On the e500mc test
> config that I use, I'm getting this build failure:
Is that a standard defconfig ? If not, can you provide your .config ?
>
> arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall':
> arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to `kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1'
> Makefile:1052: recipe for target 'vmlinux' failed
>
>> +.macro SYSCALL_ENTRY trapno intno
>> + mfspr r10, SPRN_SPRG_THREAD
>> +#ifdef CONFIG_KVM_BOOKE_HV
>> +BEGIN_FTR_SECTION
>> + mtspr SPRN_SPRG_WSCRATCH0, r10
>> + stw r11, THREAD_NORMSAVE(0)(r10)
>> + stw r13, THREAD_NORMSAVE(2)(r10)
>> + mfcr r13 /* save CR in r13 for now */
>> + mfspr r11, SPRN_SRR1
>> + mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */
>> + bf 3, 1975f
>> + b kvmppc_handler_BOOKE_INTERRUPT_\intno\()_SPRN_SRR1
>
> It seems to me that the "_SPRN_SRR1" on the end of this line
> isn't meant to be there... However, it still fails to link with that
> removed.
This SYSCALL_ENTRY macro is a slimmed version of NORMAL_EXCEPTION_PROLOG()
In NORMAL_EXCEPTION_PROLOG(), we have:
DO_KVM BOOKE_INTERRUPT_##intno SPRN_SRR1;
The _SPRN_SRR1 comes from there
Then in /arch/powerpc/include/asm/kvm_booke_hv_asm.h:
.macro DO_KVM intno srr1
#ifdef CONFIG_KVM_BOOKE_HV
BEGIN_FTR_SECTION
mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */
bf 3, 1975f
b kvmppc_handler_\intno\()_\srr1
1975:
END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
#endif
.endm
Christophe
^ permalink raw reply
* Re: [PATCH] crypto: talitos - fix skcipher failure due to wrong output IV
From: Herbert Xu @ 2019-05-23 6:51 UTC (permalink / raw)
To: Christophe Leroy
Cc: linux-kernel, linuxppc-dev, David S. Miller, linux-crypto
In-Reply-To: <a5b0d31d8fc9fc9bc2b69baa5330466090825a39.1557923113.git.christophe.leroy@c-s.fr>
On Wed, May 15, 2019 at 12:29:03PM +0000, Christophe Leroy wrote:
> Selftests report the following:
>
> [ 2.984845] alg: skcipher: cbc-aes-talitos encryption test failed (wrong output IV) on test vector 0, cfg="in-place"
> [ 2.995377] 00000000: 3d af ba 42 9d 9e b4 30 b4 22 da 80 2c 9f ac 41
> [ 3.032673] alg: skcipher: cbc-des-talitos encryption test failed (wrong output IV) on test vector 0, cfg="in-place"
> [ 3.043185] 00000000: fe dc ba 98 76 54 32 10
> [ 3.063238] alg: skcipher: cbc-3des-talitos encryption test failed (wrong output IV) on test vector 0, cfg="in-place"
> [ 3.073818] 00000000: 7d 33 88 93 0f 93 b2 42
>
> This above dumps show that the actual output IV is indeed the input IV.
> This is due to the IV not being copied back into the request.
>
> This patch fixes that.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> drivers/crypto/talitos.c | 4 ++++
> 1 file changed, 4 insertions(+)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] powerpc/powernv: fix variable "c" set but not used
From: Christophe Leroy @ 2019-05-23 7:26 UTC (permalink / raw)
To: Qian Cai, benh, paulus, mpe; +Cc: aik, linuxppc-dev, linux-kernel
In-Reply-To: <20190523023141.2973-1-cai@lca.pw>
Le 23/05/2019 à 04:31, Qian Cai a écrit :
> The commit 58629c0dc349 ("powerpc/powernv/npu: Fault user page into the
> hypervisor's pagetable") introduced a variable "c" to be used in
> __get_user() and __get_user_nocheck() which need to stay as macros for
> performance reasons, and "c" is not actually used in
> pnv_npu2_handle_fault(),
>
> arch/powerpc/platforms/powernv/npu-dma.c: In function 'pnv_npu2_handle_fault':
> arch/powerpc/platforms/powernv/npu-dma.c:1122:7: warning: variable 'c'
> set but not used [-Wunused-but-set-variable]
>
> Fixed it by appending the __maybe_unused attribute, so compilers would
> ignore it.
You are not fixing the problem, you are just hiding it.
If the result of __get_user() is unneeded, it means __get_user() is not
the good function to use.
Should use fault_in_pages_readable() instead.
A similar warning was fixed in commit 9f9eae5ce717 ("powerpc/kvm: Prefer
fault_in_pages_readable function")
See
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/powerpc?id=9f9eae5ce
>
> Signed-off-by: Qian Cai <cai@lca.pw>
You should add a Fixes: tag
58629c0dc349 ("powerpc/powernv/npu: Fault user page into the
hypervisor's pagetable")
Christophe
> ---
> arch/powerpc/platforms/powernv/npu-dma.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index 495550432f3d..5bbe59573ee6 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -1119,7 +1119,8 @@ int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
> int i, is_write;
> struct page *page[1];
> const char __user *u;
> - char c;
> + /* To silence a -Wunused-but-set-variable warning. */
> + char c __maybe_unused;
>
> /* mmap_sem should be held so the struct_mm must be present */
> struct mm_struct *mm = context->mm;
>
^ permalink raw reply
* Re: [PATCH] powerpc/powernv: fix variable "c" set but not used
From: Christoph Hellwig @ 2019-05-23 7:46 UTC (permalink / raw)
To: Christophe Leroy; +Cc: aik, linux-kernel, Qian Cai, paulus, linuxppc-dev
In-Reply-To: <d0512822-ca22-75ec-3dd9-1024001632f5@c-s.fr>
On Thu, May 23, 2019 at 09:26:53AM +0200, Christophe Leroy wrote:
> You are not fixing the problem, you are just hiding it.
>
> If the result of __get_user() is unneeded, it means __get_user() is not the
> good function to use.
>
> Should use fault_in_pages_readable() instead.
Also it is not just the variable that is unused, but that whole
function. I'll resend my series to remote it in a bit.
^ permalink raw reply
* [PATCH 1/4] powerpc/powernv: remove the unused pnv_pci_set_p2p function
From: Christoph Hellwig @ 2019-05-23 7:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190523074924.19659-1-hch@lst.de>
This function has never been used since it has been added to the tree.
We also now have proper PCIe P2P APIs in the core kernel, and any new
P2P support should be using those.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/powerpc/include/asm/opal-api.h | 6 --
arch/powerpc/include/asm/opal.h | 2 -
arch/powerpc/include/asm/pnv-pci.h | 2 -
arch/powerpc/platforms/powernv/opal-call.c | 1 -
arch/powerpc/platforms/powernv/pci.c | 74 ----------------------
arch/powerpc/platforms/powernv/pci.h | 5 --
6 files changed, 90 deletions(-)
diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index e1577cfa7186..cd34c328774d 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -1132,12 +1132,6 @@ enum {
OPAL_IMC_COUNTERS_TRACE = 3,
};
-
-/* PCI p2p descriptor */
-#define OPAL_PCI_P2P_ENABLE 0x1
-#define OPAL_PCI_P2P_LOAD 0x2
-#define OPAL_PCI_P2P_STORE 0x4
-
#endif /* __ASSEMBLY__ */
#endif /* __OPAL_API_H */
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 4cc37e708bc7..15c488ce4225 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -287,8 +287,6 @@ int64_t opal_xive_set_queue_state(uint64_t vp, uint32_t prio,
uint32_t qtoggle,
uint32_t qindex);
int64_t opal_xive_get_vp_state(uint64_t vp, __be64 *out_w01);
-int64_t opal_pci_set_p2p(uint64_t phb_init, uint64_t phb_target,
- uint64_t desc, uint16_t pe_number);
int64_t opal_imc_counters_init(uint32_t type, uint64_t address,
uint64_t cpu_pir);
diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/include/asm/pnv-pci.h
index 630eb8b1b7ed..9fcb0bc462c6 100644
--- a/arch/powerpc/include/asm/pnv-pci.h
+++ b/arch/powerpc/include/asm/pnv-pci.h
@@ -26,8 +26,6 @@ extern int pnv_pci_get_presence_state(uint64_t id, uint8_t *state);
extern int pnv_pci_get_power_state(uint64_t id, uint8_t *state);
extern int pnv_pci_set_power_state(uint64_t id, uint8_t state,
struct opal_msg *msg);
-extern int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target,
- u64 desc);
extern int pnv_pci_enable_tunnel(struct pci_dev *dev, uint64_t *asnind);
extern int pnv_pci_disable_tunnel(struct pci_dev *dev);
diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
index 36c8fa3647a2..29ca523c1c79 100644
--- a/arch/powerpc/platforms/powernv/opal-call.c
+++ b/arch/powerpc/platforms/powernv/opal-call.c
@@ -273,7 +273,6 @@ OPAL_CALL(opal_npu_map_lpar, OPAL_NPU_MAP_LPAR);
OPAL_CALL(opal_imc_counters_init, OPAL_IMC_COUNTERS_INIT);
OPAL_CALL(opal_imc_counters_start, OPAL_IMC_COUNTERS_START);
OPAL_CALL(opal_imc_counters_stop, OPAL_IMC_COUNTERS_STOP);
-OPAL_CALL(opal_pci_set_p2p, OPAL_PCI_SET_P2P);
OPAL_CALL(opal_get_powercap, OPAL_GET_POWERCAP);
OPAL_CALL(opal_set_powercap, OPAL_SET_POWERCAP);
OPAL_CALL(opal_get_power_shift_ratio, OPAL_GET_POWER_SHIFT_RATIO);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index ef9448a907c6..8d28f2932c3b 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -38,7 +38,6 @@
#include "powernv.h"
#include "pci.h"
-static DEFINE_MUTEX(p2p_mutex);
static DEFINE_MUTEX(tunnel_mutex);
int pnv_pci_get_slot_id(struct device_node *np, uint64_t *id)
@@ -861,79 +860,6 @@ void pnv_pci_dma_bus_setup(struct pci_bus *bus)
}
}
-int pnv_pci_set_p2p(struct pci_dev *initiator, struct pci_dev *target, u64 desc)
-{
- struct pci_controller *hose;
- struct pnv_phb *phb_init, *phb_target;
- struct pnv_ioda_pe *pe_init;
- int rc;
-
- if (!opal_check_token(OPAL_PCI_SET_P2P))
- return -ENXIO;
-
- hose = pci_bus_to_host(initiator->bus);
- phb_init = hose->private_data;
-
- hose = pci_bus_to_host(target->bus);
- phb_target = hose->private_data;
-
- pe_init = pnv_ioda_get_pe(initiator);
- if (!pe_init)
- return -ENODEV;
-
- /*
- * Configuring the initiator's PHB requires to adjust its
- * TVE#1 setting. Since the same device can be an initiator
- * several times for different target devices, we need to keep
- * a reference count to know when we can restore the default
- * bypass setting on its TVE#1 when disabling. Opal is not
- * tracking PE states, so we add a reference count on the PE
- * in linux.
- *
- * For the target, the configuration is per PHB, so we keep a
- * target reference count on the PHB.
- */
- mutex_lock(&p2p_mutex);
-
- if (desc & OPAL_PCI_P2P_ENABLE) {
- /* always go to opal to validate the configuration */
- rc = opal_pci_set_p2p(phb_init->opal_id, phb_target->opal_id,
- desc, pe_init->pe_number);
-
- if (rc != OPAL_SUCCESS) {
- rc = -EIO;
- goto out;
- }
-
- pe_init->p2p_initiator_count++;
- phb_target->p2p_target_count++;
- } else {
- if (!pe_init->p2p_initiator_count ||
- !phb_target->p2p_target_count) {
- rc = -EINVAL;
- goto out;
- }
-
- if (--pe_init->p2p_initiator_count == 0)
- pnv_pci_ioda2_set_bypass(pe_init, true);
-
- if (--phb_target->p2p_target_count == 0) {
- rc = opal_pci_set_p2p(phb_init->opal_id,
- phb_target->opal_id, desc,
- pe_init->pe_number);
- if (rc != OPAL_SUCCESS) {
- rc = -EIO;
- goto out;
- }
- }
- }
- rc = 0;
-out:
- mutex_unlock(&p2p_mutex);
- return rc;
-}
-EXPORT_SYMBOL_GPL(pnv_pci_set_p2p);
-
struct device_node *pnv_pci_get_phb_node(struct pci_dev *dev)
{
struct pci_controller *hose = pci_bus_to_host(dev->bus);
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index be26ab3d99e0..4f11c077af62 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -79,9 +79,6 @@ struct pnv_ioda_pe {
struct pnv_ioda_pe *master;
struct list_head slaves;
- /* PCI peer-to-peer*/
- int p2p_initiator_count;
-
/* Link in list of PE#s */
struct list_head list;
};
@@ -172,8 +169,6 @@ struct pnv_phb {
/* PHB and hub diagnostics */
unsigned int diag_data_size;
u8 *diag_data;
-
- int p2p_target_count;
};
extern struct pci_ops pnv_pci_ops;
--
2.20.1
^ permalink raw reply related
* [PATCH 2/4] powerpc/powernv: remove the unused tunneling exports
From: Christoph Hellwig @ 2019-05-23 7:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190523074924.19659-1-hch@lst.de>
These have been unused ever since they've been added to the kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/powerpc/include/asm/pnv-pci.h | 4 --
arch/powerpc/platforms/powernv/pci-ioda.c | 4 +-
arch/powerpc/platforms/powernv/pci.c | 71 -----------------------
arch/powerpc/platforms/powernv/pci.h | 1 -
4 files changed, 3 insertions(+), 77 deletions(-)
diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/include/asm/pnv-pci.h
index 9fcb0bc462c6..1ab4b0111abc 100644
--- a/arch/powerpc/include/asm/pnv-pci.h
+++ b/arch/powerpc/include/asm/pnv-pci.h
@@ -27,12 +27,8 @@ extern int pnv_pci_get_power_state(uint64_t id, uint8_t *state);
extern int pnv_pci_set_power_state(uint64_t id, uint8_t state,
struct opal_msg *msg);
-extern int pnv_pci_enable_tunnel(struct pci_dev *dev, uint64_t *asnind);
-extern int pnv_pci_disable_tunnel(struct pci_dev *dev);
extern int pnv_pci_set_tunnel_bar(struct pci_dev *dev, uint64_t addr,
int enable);
-extern int pnv_pci_get_as_notify_info(struct task_struct *task, u32 *lpid,
- u32 *pid, u32 *tid);
int pnv_phb_to_cxl_mode(struct pci_dev *dev, uint64_t mode);
int pnv_cxl_ioda_msi_setup(struct pci_dev *dev, unsigned int hwirq,
unsigned int virq);
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 126602b4e399..6b0caa2d0425 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -54,6 +54,8 @@
static const char * const pnv_phb_names[] = { "IODA1", "IODA2", "NPU_NVLINK",
"NPU_OCAPI" };
+static void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable);
+
void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level,
const char *fmt, ...)
{
@@ -2360,7 +2362,7 @@ static long pnv_pci_ioda2_set_window(struct iommu_table_group *table_group,
return 0;
}
-void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable)
+static void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable)
{
uint16_t window_id = (pe->pe_number << 1 ) + 1;
int64_t rc;
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 8d28f2932c3b..fc69f5611020 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -868,54 +868,6 @@ struct device_node *pnv_pci_get_phb_node(struct pci_dev *dev)
}
EXPORT_SYMBOL(pnv_pci_get_phb_node);
-int pnv_pci_enable_tunnel(struct pci_dev *dev, u64 *asnind)
-{
- struct device_node *np;
- const __be32 *prop;
- struct pnv_ioda_pe *pe;
- uint16_t window_id;
- int rc;
-
- if (!radix_enabled())
- return -ENXIO;
-
- if (!(np = pnv_pci_get_phb_node(dev)))
- return -ENXIO;
-
- prop = of_get_property(np, "ibm,phb-indications", NULL);
- of_node_put(np);
-
- if (!prop || !prop[1])
- return -ENXIO;
-
- *asnind = (u64)be32_to_cpu(prop[1]);
- pe = pnv_ioda_get_pe(dev);
- if (!pe)
- return -ENODEV;
-
- /* Increase real window size to accept as_notify messages. */
- window_id = (pe->pe_number << 1 ) + 1;
- rc = opal_pci_map_pe_dma_window_real(pe->phb->opal_id, pe->pe_number,
- window_id, pe->tce_bypass_base,
- (uint64_t)1 << 48);
- return opal_error_code(rc);
-}
-EXPORT_SYMBOL_GPL(pnv_pci_enable_tunnel);
-
-int pnv_pci_disable_tunnel(struct pci_dev *dev)
-{
- struct pnv_ioda_pe *pe;
-
- pe = pnv_ioda_get_pe(dev);
- if (!pe)
- return -ENODEV;
-
- /* Restore default real window size. */
- pnv_pci_ioda2_set_bypass(pe, true);
- return 0;
-}
-EXPORT_SYMBOL_GPL(pnv_pci_disable_tunnel);
-
int pnv_pci_set_tunnel_bar(struct pci_dev *dev, u64 addr, int enable)
{
__be64 val;
@@ -970,29 +922,6 @@ int pnv_pci_set_tunnel_bar(struct pci_dev *dev, u64 addr, int enable)
}
EXPORT_SYMBOL_GPL(pnv_pci_set_tunnel_bar);
-#ifdef CONFIG_PPC64 /* for thread.tidr */
-int pnv_pci_get_as_notify_info(struct task_struct *task, u32 *lpid, u32 *pid,
- u32 *tid)
-{
- struct mm_struct *mm = NULL;
-
- if (task == NULL)
- return -EINVAL;
-
- mm = get_task_mm(task);
- if (mm == NULL)
- return -EINVAL;
-
- *pid = mm->context.id;
- mmput(mm);
-
- *tid = task->thread.tidr;
- *lpid = mfspr(SPRN_LPID);
- return 0;
-}
-EXPORT_SYMBOL_GPL(pnv_pci_get_as_notify_info);
-#endif
-
void pnv_pci_shutdown(void)
{
struct pci_controller *hose;
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index 4f11c077af62..469c24463247 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -195,7 +195,6 @@ extern int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type);
extern void pnv_teardown_msi_irqs(struct pci_dev *pdev);
extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev);
extern void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq);
-extern void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable);
extern unsigned long pnv_pci_ioda2_get_table_size(__u32 page_shift,
__u64 window_size, __u32 levels);
extern int pnv_eeh_post_init(void);
--
2.20.1
^ permalink raw reply related
* remove dead powernv code v2
From: Christoph Hellwig @ 2019-05-23 7:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
Hi all,
the powerpc powernv port has a fairly large chunk of code that never
had any upstream user. We generally strive to not keep dead code
around, and this was affirmed at least years Maintainer summit.
Changes since v1:
- rebased to v5.2-rc1
- remove even more dead code
^ permalink raw reply
* [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code
From: Christoph Hellwig @ 2019-05-23 7:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190523074924.19659-1-hch@lst.de>
None of these routines were ever used since they were added to the
kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/powerpc/include/asm/book3s/64/mmu.h | 2 -
arch/powerpc/include/asm/powernv.h | 22 -
arch/powerpc/mm/book3s64/mmu_context.c | 1 -
arch/powerpc/platforms/powernv/npu-dma.c | 556 -----------------------
4 files changed, 581 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
index 74d24201fc4f..23b83d3593e2 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu.h
@@ -116,8 +116,6 @@ typedef struct {
/* Number of users of the external (Nest) MMU */
atomic_t copros;
- /* NPU NMMU context */
- struct npu_context *npu_context;
struct hash_mm_context *hash_context;
unsigned long vdso_base;
diff --git a/arch/powerpc/include/asm/powernv.h b/arch/powerpc/include/asm/powernv.h
index 05b552418519..40f868c5e93c 100644
--- a/arch/powerpc/include/asm/powernv.h
+++ b/arch/powerpc/include/asm/powernv.h
@@ -11,35 +11,13 @@
#define _ASM_POWERNV_H
#ifdef CONFIG_PPC_POWERNV
-#define NPU2_WRITE 1
extern void powernv_set_nmmu_ptcr(unsigned long ptcr);
-extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
- unsigned long flags,
- void (*cb)(struct npu_context *, void *),
- void *priv);
-extern void pnv_npu2_destroy_context(struct npu_context *context,
- struct pci_dev *gpdev);
-extern int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
- unsigned long *flags, unsigned long *status,
- int count);
void pnv_program_cpu_hotplug_lpcr(unsigned int cpu, u64 lpcr_val);
void pnv_tm_init(void);
#else
static inline void powernv_set_nmmu_ptcr(unsigned long ptcr) { }
-static inline struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
- unsigned long flags,
- struct npu_context *(*cb)(struct npu_context *, void *),
- void *priv) { return ERR_PTR(-ENODEV); }
-static inline void pnv_npu2_destroy_context(struct npu_context *context,
- struct pci_dev *gpdev) { }
-
-static inline int pnv_npu2_handle_fault(struct npu_context *context,
- uintptr_t *ea, unsigned long *flags,
- unsigned long *status, int count) {
- return -ENODEV;
-}
static inline void pnv_tm_init(void) { }
#endif
diff --git a/arch/powerpc/mm/book3s64/mmu_context.c b/arch/powerpc/mm/book3s64/mmu_context.c
index cb2b08635508..0dd3e631cf3e 100644
--- a/arch/powerpc/mm/book3s64/mmu_context.c
+++ b/arch/powerpc/mm/book3s64/mmu_context.c
@@ -140,7 +140,6 @@ static int radix__init_new_context(struct mm_struct *mm)
*/
asm volatile("ptesync;isync" : : : "memory");
- mm->context.npu_context = NULL;
mm->context.hash_context = NULL;
return index;
diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index 495550432f3d..4ed24132bb7c 100644
--- a/arch/powerpc/platforms/powernv/npu-dma.c
+++ b/arch/powerpc/platforms/powernv/npu-dma.c
@@ -22,12 +22,6 @@
#include "pci.h"
-/*
- * spinlock to protect initialisation of an npu_context for a particular
- * mm_struct.
- */
-static DEFINE_SPINLOCK(npu_context_lock);
-
static struct pci_dev *get_pci_dev(struct device_node *dn)
{
struct pci_dn *pdn = PCI_DN(dn);
@@ -362,15 +356,6 @@ struct npu_comp {
/* An NPU descriptor, valid for POWER9 only */
struct npu {
int index;
- __be64 *mmio_atsd_regs[NV_NMMU_ATSD_REGS];
- unsigned int mmio_atsd_count;
-
- /* Bitmask for MMIO register usage */
- unsigned long mmio_atsd_usage;
-
- /* Do we need to explicitly flush the nest mmu? */
- bool nmmu_flush;
-
struct npu_comp npucomp;
};
@@ -627,534 +612,8 @@ struct iommu_table_group *pnv_npu_compound_attach(struct pnv_ioda_pe *pe)
}
#endif /* CONFIG_IOMMU_API */
-/* Maximum number of nvlinks per npu */
-#define NV_MAX_LINKS 6
-
-/* Maximum index of npu2 hosts in the system. Always < NV_MAX_NPUS */
-static int max_npu2_index;
-
-struct npu_context {
- struct mm_struct *mm;
- struct pci_dev *npdev[NV_MAX_NPUS][NV_MAX_LINKS];
- struct mmu_notifier mn;
- struct kref kref;
- bool nmmu_flush;
-
- /* Callback to stop translation requests on a given GPU */
- void (*release_cb)(struct npu_context *context, void *priv);
-
- /*
- * Private pointer passed to the above callback for usage by
- * device drivers.
- */
- void *priv;
-};
-
-struct mmio_atsd_reg {
- struct npu *npu;
- int reg;
-};
-
-/*
- * Find a free MMIO ATSD register and mark it in use. Return -ENOSPC
- * if none are available.
- */
-static int get_mmio_atsd_reg(struct npu *npu)
-{
- int i;
-
- for (i = 0; i < npu->mmio_atsd_count; i++) {
- if (!test_bit(i, &npu->mmio_atsd_usage))
- if (!test_and_set_bit_lock(i, &npu->mmio_atsd_usage))
- return i;
- }
-
- return -ENOSPC;
-}
-
-static void put_mmio_atsd_reg(struct npu *npu, int reg)
-{
- clear_bit_unlock(reg, &npu->mmio_atsd_usage);
-}
-
-/* MMIO ATSD register offsets */
-#define XTS_ATSD_LAUNCH 0
-#define XTS_ATSD_AVA 1
-#define XTS_ATSD_STAT 2
-
-static unsigned long get_atsd_launch_val(unsigned long pid, unsigned long psize)
-{
- unsigned long launch = 0;
-
- if (psize == MMU_PAGE_COUNT) {
- /* IS set to invalidate entire matching PID */
- launch |= PPC_BIT(12);
- } else {
- /* AP set to invalidate region of psize */
- launch |= (u64)mmu_get_ap(psize) << PPC_BITLSHIFT(17);
- }
-
- /* PRS set to process-scoped */
- launch |= PPC_BIT(13);
-
- /* PID */
- launch |= pid << PPC_BITLSHIFT(38);
-
- /* Leave "No flush" (bit 39) 0 so every ATSD performs a flush */
-
- return launch;
-}
-
-static void mmio_atsd_regs_write(struct mmio_atsd_reg
- mmio_atsd_reg[NV_MAX_NPUS], unsigned long offset,
- unsigned long val)
-{
- struct npu *npu;
- int i, reg;
-
- for (i = 0; i <= max_npu2_index; i++) {
- reg = mmio_atsd_reg[i].reg;
- if (reg < 0)
- continue;
-
- npu = mmio_atsd_reg[i].npu;
- __raw_writeq_be(val, npu->mmio_atsd_regs[reg] + offset);
- }
-}
-
-static void mmio_invalidate_pid(struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS],
- unsigned long pid)
-{
- unsigned long launch = get_atsd_launch_val(pid, MMU_PAGE_COUNT);
-
- /* Invalidating the entire process doesn't use a va */
- mmio_atsd_regs_write(mmio_atsd_reg, XTS_ATSD_LAUNCH, launch);
-}
-
-static void mmio_invalidate_range(struct mmio_atsd_reg
- mmio_atsd_reg[NV_MAX_NPUS], unsigned long pid,
- unsigned long start, unsigned long psize)
-{
- unsigned long launch = get_atsd_launch_val(pid, psize);
-
- /* Write all VAs first */
- mmio_atsd_regs_write(mmio_atsd_reg, XTS_ATSD_AVA, start);
-
- /* Issue one barrier for all address writes */
- eieio();
-
- /* Launch */
- mmio_atsd_regs_write(mmio_atsd_reg, XTS_ATSD_LAUNCH, launch);
-}
-
-#define mn_to_npu_context(x) container_of(x, struct npu_context, mn)
-
-static void mmio_invalidate_wait(
- struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS])
-{
- struct npu *npu;
- int i, reg;
-
- /* Wait for all invalidations to complete */
- for (i = 0; i <= max_npu2_index; i++) {
- if (mmio_atsd_reg[i].reg < 0)
- continue;
-
- /* Wait for completion */
- npu = mmio_atsd_reg[i].npu;
- reg = mmio_atsd_reg[i].reg;
- while (__raw_readq(npu->mmio_atsd_regs[reg] + XTS_ATSD_STAT))
- cpu_relax();
- }
-}
-
-/*
- * Acquires all the address translation shootdown (ATSD) registers required to
- * launch an ATSD on all links this npu_context is active on.
- */
-static void acquire_atsd_reg(struct npu_context *npu_context,
- struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS])
-{
- int i, j;
- struct npu *npu;
- struct pci_dev *npdev;
-
- for (i = 0; i <= max_npu2_index; i++) {
- mmio_atsd_reg[i].reg = -1;
- for (j = 0; j < NV_MAX_LINKS; j++) {
- /*
- * There are no ordering requirements with respect to
- * the setup of struct npu_context, but to ensure
- * consistent behaviour we need to ensure npdev[][] is
- * only read once.
- */
- npdev = READ_ONCE(npu_context->npdev[i][j]);
- if (!npdev)
- continue;
-
- npu = pci_bus_to_host(npdev->bus)->npu;
- if (!npu)
- continue;
-
- mmio_atsd_reg[i].npu = npu;
- mmio_atsd_reg[i].reg = get_mmio_atsd_reg(npu);
- while (mmio_atsd_reg[i].reg < 0) {
- mmio_atsd_reg[i].reg = get_mmio_atsd_reg(npu);
- cpu_relax();
- }
- break;
- }
- }
-}
-
-/*
- * Release previously acquired ATSD registers. To avoid deadlocks the registers
- * must be released in the same order they were acquired above in
- * acquire_atsd_reg.
- */
-static void release_atsd_reg(struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS])
-{
- int i;
-
- for (i = 0; i <= max_npu2_index; i++) {
- /*
- * We can't rely on npu_context->npdev[][] being the same here
- * as when acquire_atsd_reg() was called, hence we use the
- * values stored in mmio_atsd_reg during the acquire phase
- * rather than re-reading npdev[][].
- */
- if (mmio_atsd_reg[i].reg < 0)
- continue;
-
- put_mmio_atsd_reg(mmio_atsd_reg[i].npu, mmio_atsd_reg[i].reg);
- }
-}
-
-/*
- * Invalidate a virtual address range
- */
-static void mmio_invalidate(struct npu_context *npu_context,
- unsigned long start, unsigned long size)
-{
- struct mmio_atsd_reg mmio_atsd_reg[NV_MAX_NPUS];
- unsigned long pid = npu_context->mm->context.id;
- unsigned long atsd_start = 0;
- unsigned long end = start + size - 1;
- int atsd_psize = MMU_PAGE_COUNT;
-
- /*
- * Convert the input range into one of the supported sizes. If the range
- * doesn't fit, use the next larger supported size. Invalidation latency
- * is high, so over-invalidation is preferred to issuing multiple
- * invalidates.
- *
- * A 4K page size isn't supported by NPU/GPU ATS, so that case is
- * ignored.
- */
- if (size == SZ_64K) {
- atsd_start = start;
- atsd_psize = MMU_PAGE_64K;
- } else if (ALIGN_DOWN(start, SZ_2M) == ALIGN_DOWN(end, SZ_2M)) {
- atsd_start = ALIGN_DOWN(start, SZ_2M);
- atsd_psize = MMU_PAGE_2M;
- } else if (ALIGN_DOWN(start, SZ_1G) == ALIGN_DOWN(end, SZ_1G)) {
- atsd_start = ALIGN_DOWN(start, SZ_1G);
- atsd_psize = MMU_PAGE_1G;
- }
-
- if (npu_context->nmmu_flush)
- /*
- * Unfortunately the nest mmu does not support flushing specific
- * addresses so we have to flush the whole mm once before
- * shooting down the GPU translation.
- */
- flush_all_mm(npu_context->mm);
-
- /*
- * Loop over all the NPUs this process is active on and launch
- * an invalidate.
- */
- acquire_atsd_reg(npu_context, mmio_atsd_reg);
-
- if (atsd_psize == MMU_PAGE_COUNT)
- mmio_invalidate_pid(mmio_atsd_reg, pid);
- else
- mmio_invalidate_range(mmio_atsd_reg, pid, atsd_start,
- atsd_psize);
-
- mmio_invalidate_wait(mmio_atsd_reg);
-
- /*
- * The GPU requires two flush ATSDs to ensure all entries have been
- * flushed. We use PID 0 as it will never be used for a process on the
- * GPU.
- */
- mmio_invalidate_pid(mmio_atsd_reg, 0);
- mmio_invalidate_wait(mmio_atsd_reg);
- mmio_invalidate_pid(mmio_atsd_reg, 0);
- mmio_invalidate_wait(mmio_atsd_reg);
-
- release_atsd_reg(mmio_atsd_reg);
-}
-
-static void pnv_npu2_mn_release(struct mmu_notifier *mn,
- struct mm_struct *mm)
-{
- struct npu_context *npu_context = mn_to_npu_context(mn);
-
- /* Call into device driver to stop requests to the NMMU */
- if (npu_context->release_cb)
- npu_context->release_cb(npu_context, npu_context->priv);
-
- /*
- * There should be no more translation requests for this PID, but we
- * need to ensure any entries for it are removed from the TLB.
- */
- mmio_invalidate(npu_context, 0, ~0UL);
-}
-
-static void pnv_npu2_mn_invalidate_range(struct mmu_notifier *mn,
- struct mm_struct *mm,
- unsigned long start, unsigned long end)
-{
- struct npu_context *npu_context = mn_to_npu_context(mn);
- mmio_invalidate(npu_context, start, end - start);
-}
-
-static const struct mmu_notifier_ops nv_nmmu_notifier_ops = {
- .release = pnv_npu2_mn_release,
- .invalidate_range = pnv_npu2_mn_invalidate_range,
-};
-
-/*
- * Call into OPAL to setup the nmmu context for the current task in
- * the NPU. This must be called to setup the context tables before the
- * GPU issues ATRs. pdev should be a pointed to PCIe GPU device.
- *
- * A release callback should be registered to allow a device driver to
- * be notified that it should not launch any new translation requests
- * as the final TLB invalidate is about to occur.
- *
- * Returns an error if there no contexts are currently available or a
- * npu_context which should be passed to pnv_npu2_handle_fault().
- *
- * mmap_sem must be held in write mode and must not be called from interrupt
- * context.
- */
-struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
- unsigned long flags,
- void (*cb)(struct npu_context *, void *),
- void *priv)
-{
- int rc;
- u32 nvlink_index;
- struct device_node *nvlink_dn;
- struct mm_struct *mm = current->mm;
- struct npu *npu;
- struct npu_context *npu_context;
- struct pci_controller *hose;
-
- /*
- * At present we don't support GPUs connected to multiple NPUs and I'm
- * not sure the hardware does either.
- */
- struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
-
- if (!npdev)
- /* No nvlink associated with this GPU device */
- return ERR_PTR(-ENODEV);
-
- /* We only support DR/PR/HV in pnv_npu2_map_lpar_dev() */
- if (flags & ~(MSR_DR | MSR_PR | MSR_HV))
- return ERR_PTR(-EINVAL);
-
- nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
- if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
- &nvlink_index)))
- return ERR_PTR(-ENODEV);
-
- if (!mm || mm->context.id == 0) {
- /*
- * Kernel thread contexts are not supported and context id 0 is
- * reserved on the GPU.
- */
- return ERR_PTR(-EINVAL);
- }
-
- hose = pci_bus_to_host(npdev->bus);
- npu = hose->npu;
- if (!npu)
- return ERR_PTR(-ENODEV);
-
- /*
- * We store the npu pci device so we can more easily get at the
- * associated npus.
- */
- spin_lock(&npu_context_lock);
- npu_context = mm->context.npu_context;
- if (npu_context) {
- if (npu_context->release_cb != cb ||
- npu_context->priv != priv) {
- spin_unlock(&npu_context_lock);
- return ERR_PTR(-EINVAL);
- }
-
- WARN_ON(!kref_get_unless_zero(&npu_context->kref));
- }
- spin_unlock(&npu_context_lock);
-
- if (!npu_context) {
- /*
- * We can set up these fields without holding the
- * npu_context_lock as the npu_context hasn't been returned to
- * the caller meaning it can't be destroyed. Parallel allocation
- * is protected against by mmap_sem.
- */
- rc = -ENOMEM;
- npu_context = kzalloc(sizeof(struct npu_context), GFP_KERNEL);
- if (npu_context) {
- kref_init(&npu_context->kref);
- npu_context->mm = mm;
- npu_context->mn.ops = &nv_nmmu_notifier_ops;
- rc = __mmu_notifier_register(&npu_context->mn, mm);
- }
-
- if (rc) {
- kfree(npu_context);
- return ERR_PTR(rc);
- }
-
- mm->context.npu_context = npu_context;
- }
-
- npu_context->release_cb = cb;
- npu_context->priv = priv;
-
- /*
- * npdev is a pci_dev pointer setup by the PCI code. We assign it to
- * npdev[][] to indicate to the mmu notifiers that an invalidation
- * should also be sent over this nvlink. The notifiers don't use any
- * other fields in npu_context, so we just need to ensure that when they
- * deference npu_context->npdev[][] it is either a valid pointer or
- * NULL.
- */
- WRITE_ONCE(npu_context->npdev[npu->index][nvlink_index], npdev);
-
- if (!npu->nmmu_flush) {
- /*
- * If we're not explicitly flushing ourselves we need to mark
- * the thread for global flushes
- */
- npu_context->nmmu_flush = false;
- mm_context_add_copro(mm);
- } else
- npu_context->nmmu_flush = true;
-
- return npu_context;
-}
-EXPORT_SYMBOL(pnv_npu2_init_context);
-
-static void pnv_npu2_release_context(struct kref *kref)
-{
- struct npu_context *npu_context =
- container_of(kref, struct npu_context, kref);
-
- if (!npu_context->nmmu_flush)
- mm_context_remove_copro(npu_context->mm);
-
- npu_context->mm->context.npu_context = NULL;
-}
-
-/*
- * Destroy a context on the given GPU. May free the npu_context if it is no
- * longer active on any GPUs. Must not be called from interrupt context.
- */
-void pnv_npu2_destroy_context(struct npu_context *npu_context,
- struct pci_dev *gpdev)
-{
- int removed;
- struct npu *npu;
- struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
- struct device_node *nvlink_dn;
- u32 nvlink_index;
- struct pci_controller *hose;
-
- if (WARN_ON(!npdev))
- return;
-
- hose = pci_bus_to_host(npdev->bus);
- npu = hose->npu;
- if (!npu)
- return;
- nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
- if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
- &nvlink_index)))
- return;
- WRITE_ONCE(npu_context->npdev[npu->index][nvlink_index], NULL);
- spin_lock(&npu_context_lock);
- removed = kref_put(&npu_context->kref, pnv_npu2_release_context);
- spin_unlock(&npu_context_lock);
-
- /*
- * We need to do this outside of pnv_npu2_release_context so that it is
- * outside the spinlock as mmu_notifier_destroy uses SRCU.
- */
- if (removed) {
- mmu_notifier_unregister(&npu_context->mn,
- npu_context->mm);
-
- kfree(npu_context);
- }
-
-}
-EXPORT_SYMBOL(pnv_npu2_destroy_context);
-
-/*
- * Assumes mmap_sem is held for the contexts associated mm.
- */
-int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea,
- unsigned long *flags, unsigned long *status, int count)
-{
- u64 rc = 0, result = 0;
- int i, is_write;
- struct page *page[1];
- const char __user *u;
- char c;
-
- /* mmap_sem should be held so the struct_mm must be present */
- struct mm_struct *mm = context->mm;
-
- WARN_ON(!rwsem_is_locked(&mm->mmap_sem));
-
- for (i = 0; i < count; i++) {
- is_write = flags[i] & NPU2_WRITE;
- rc = get_user_pages_remote(NULL, mm, ea[i], 1,
- is_write ? FOLL_WRITE : 0,
- page, NULL, NULL);
-
- if (rc != 1) {
- status[i] = rc;
- result = -EFAULT;
- continue;
- }
-
- /* Make sure partition scoped tree gets a pte */
- u = page_address(page[0]);
- if (__get_user(c, u))
- result = -EFAULT;
-
- status[i] = 0;
- put_page(page[0]);
- }
-
- return result;
-}
-EXPORT_SYMBOL(pnv_npu2_handle_fault);
-
int pnv_npu2_init(struct pci_controller *hose)
{
- unsigned int i;
- u64 mmio_atsd;
static int npu_index;
struct npu *npu;
int ret;
@@ -1163,33 +622,18 @@ int pnv_npu2_init(struct pci_controller *hose)
if (!npu)
return -ENOMEM;
- npu->nmmu_flush = of_property_read_bool(hose->dn, "ibm,nmmu-flush");
-
- for (i = 0; i < ARRAY_SIZE(npu->mmio_atsd_regs) &&
- !of_property_read_u64_index(hose->dn, "ibm,mmio-atsd",
- i, &mmio_atsd); i++)
- npu->mmio_atsd_regs[i] = ioremap(mmio_atsd, 32);
-
- pr_info("NPU%d: Found %d MMIO ATSD registers", hose->global_number, i);
- npu->mmio_atsd_count = i;
- npu->mmio_atsd_usage = 0;
npu_index++;
if (WARN_ON(npu_index >= NV_MAX_NPUS)) {
ret = -ENOSPC;
goto fail_exit;
}
- max_npu2_index = npu_index;
npu->index = npu_index;
hose->npu = npu;
return 0;
fail_exit:
- for (i = 0; i < npu->mmio_atsd_count; ++i)
- iounmap(npu->mmio_atsd_regs[i]);
-
kfree(npu);
-
return ret;
}
--
2.20.1
^ permalink raw reply related
* [PATCH 4/4] powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions
From: Christoph Hellwig @ 2019-05-23 7:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190523074924.19659-1-hch@lst.de>
These two function have never been used since they were added to the
kernel.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/powerpc/include/asm/vas.h | 10 ----------
arch/powerpc/platforms/powernv/vas-window.c | 19 -------------------
arch/powerpc/platforms/powernv/vas.h | 20 --------------------
3 files changed, 49 deletions(-)
diff --git a/arch/powerpc/include/asm/vas.h b/arch/powerpc/include/asm/vas.h
index 771456227496..9b5b7261df7b 100644
--- a/arch/powerpc/include/asm/vas.h
+++ b/arch/powerpc/include/asm/vas.h
@@ -167,14 +167,4 @@ int vas_copy_crb(void *crb, int offset);
*/
int vas_paste_crb(struct vas_window *win, int offset, bool re);
-/*
- * Return a system-wide unique id for the VAS window @win.
- */
-extern u32 vas_win_id(struct vas_window *win);
-
-/*
- * Return the power bus paste address associated with @win so the caller
- * can map that address into their address space.
- */
-extern u64 vas_win_paste_addr(struct vas_window *win);
#endif /* __ASM_POWERPC_VAS_H */
diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
index e59e0e60e5b5..e48c44cb3a16 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -44,16 +44,6 @@ static void compute_paste_address(struct vas_window *window, u64 *addr, int *len
pr_debug("Txwin #%d: Paste addr 0x%llx\n", winid, *addr);
}
-u64 vas_win_paste_addr(struct vas_window *win)
-{
- u64 addr;
-
- compute_paste_address(win, &addr, NULL);
-
- return addr;
-}
-EXPORT_SYMBOL(vas_win_paste_addr);
-
static inline void get_hvwc_mmio_bar(struct vas_window *window,
u64 *start, int *len)
{
@@ -1268,12 +1258,3 @@ int vas_win_close(struct vas_window *window)
return 0;
}
EXPORT_SYMBOL_GPL(vas_win_close);
-
-/*
- * Return a system-wide unique window id for the window @win.
- */
-u32 vas_win_id(struct vas_window *win)
-{
- return encode_pswid(win->vinst->vas_id, win->winid);
-}
-EXPORT_SYMBOL_GPL(vas_win_id);
diff --git a/arch/powerpc/platforms/powernv/vas.h b/arch/powerpc/platforms/powernv/vas.h
index f5493dbdd7ff..551affaddd59 100644
--- a/arch/powerpc/platforms/powernv/vas.h
+++ b/arch/powerpc/platforms/powernv/vas.h
@@ -448,26 +448,6 @@ static inline u64 read_hvwc_reg(struct vas_window *win,
return in_be64(win->hvwc_map+reg);
}
-/*
- * Encode/decode the Partition Send Window ID (PSWID) for a window in
- * a way that we can uniquely identify any window in the system. i.e.
- * we should be able to locate the 'struct vas_window' given the PSWID.
- *
- * Bits Usage
- * 0:7 VAS id (8 bits)
- * 8:15 Unused, 0 (3 bits)
- * 16:31 Window id (16 bits)
- */
-static inline u32 encode_pswid(int vasid, int winid)
-{
- u32 pswid = 0;
-
- pswid |= vasid << (31 - 7);
- pswid |= winid;
-
- return pswid;
-}
-
static inline void decode_pswid(u32 pswid, int *vasid, int *winid)
{
if (vasid)
--
2.20.1
^ permalink raw reply related
* ppc85xx_basic_defconfig is buggy ?
From: Christophe Leroy @ 2019-05-23 7:52 UTC (permalink / raw)
To: linuxppc-dev@lists.ozlabs.org, Paul Mackerras
ppc85xx_basic_defconfig doesn't not select CONFIG_PPC_85xx.
Is that expected ?
Christophe
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/powernv: remove the unused pnv_pci_set_p2p function
From: Christoph Hellwig @ 2019-05-23 7:52 UTC (permalink / raw)
To: Frederic Barrat
Cc: Paul Mackerras, Max Gurtovoy, linuxppc-dev, Christoph Hellwig
In-Reply-To: <99c4c4a9-8a18-61ed-174a-9ffaec3d2e44@linux.ibm.com>
On Mon, May 06, 2019 at 10:46:11AM +0200, Frederic Barrat wrote:
> Hi,
>
> The PCI p2p and tunnel code is used by the Mellanox CX5 driver, at least
> their latest, out of tree version, which is used for CORAL. My
> understanding is that they'll upstream it at some point, though I don't
> know what their schedule is like.
FYI, Max who wrote (at least larger parts of) that code is on Cc agreed
that all P2P code should go through the kernel P2P infrastructure and
might be able to spend some cycles on it.
Which still doesn't change anything about that fact that we [1]
generally don't add infrastructure for anything that is not in the
tree.
[1] well, powernv seems to have handles this a little oddly, and now is
on my special watchlist.
^ permalink raw reply
* Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE
From: Christophe Leroy @ 2019-05-23 8:10 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel, Nicholas Piggin
In-Reply-To: <98bf5745-88ae-7f17-fcb9-7d06ba5b9e49@c-s.fr>
Le 23/05/2019 à 09:00, Christophe Leroy a écrit :
[...]
>
>>
>> arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall':
>> arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to
>> `kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1'
>> Makefile:1052: recipe for target 'vmlinux' failed
>>
>>> +.macro SYSCALL_ENTRY trapno intno
>>> + mfspr r10, SPRN_SPRG_THREAD
>>> +#ifdef CONFIG_KVM_BOOKE_HV
>>> +BEGIN_FTR_SECTION
>>> + mtspr SPRN_SPRG_WSCRATCH0, r10
>>> + stw r11, THREAD_NORMSAVE(0)(r10)
>>> + stw r13, THREAD_NORMSAVE(2)(r10)
>>> + mfcr r13 /* save CR in r13 for now */
>>> + mfspr r11, SPRN_SRR1
>>> + mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */
>>> + bf 3, 1975f
>>> + b kvmppc_handler_BOOKE_INTERRUPT_\intno\()_SPRN_SRR1
>>
>> It seems to me that the "_SPRN_SRR1" on the end of this line
>> isn't meant to be there... However, it still fails to link with that
>> removed.
It looks like I missed the macro expansion.
The called function should be kvmppc_handler_8_0x01B
Seems like kisskb doesn't build any config like this.
Christophe
>
> This SYSCALL_ENTRY macro is a slimmed version of NORMAL_EXCEPTION_PROLOG()
>
> In NORMAL_EXCEPTION_PROLOG(), we have:
> DO_KVM BOOKE_INTERRUPT_##intno SPRN_SRR1;
>
> The _SPRN_SRR1 comes from there
>
>
> Then in /arch/powerpc/include/asm/kvm_booke_hv_asm.h:
>
> .macro DO_KVM intno srr1
> #ifdef CONFIG_KVM_BOOKE_HV
> BEGIN_FTR_SECTION
> mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */
> bf 3, 1975f
> b kvmppc_handler_\intno\()_\srr1
> 1975:
> END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
> #endif
> .endm
>
>
> Christophe
^ permalink raw reply
* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Mathieu Malaterre @ 2019-05-23 8:29 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev
In-Reply-To: <9b6e027e-0fa0-e088-d9a3-47b005cbc356@c-s.fr>
[-- Attachment #1: Type: text/plain, Size: 3464 bytes --]
On Thu, May 23, 2019 at 8:39 AM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
>
> Salut Mathieu,
>
> Le 23/05/2019 à 08:24, Mathieu Malaterre a écrit :
> > Salut Christophe,
> >
> > On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
> > <christophe.leroy@c-s.fr> wrote:
> >>
> >>
> >>
> >> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
> >>> Hi all,
> >>>
> >>> I have not boot my G4 in a while, today using master here is what I see:
> >>>
> >>> done
> >>> Setting btext !
> >>> W=640 H=488 LB=768 addr=0x9c008000
> >>> copying OF device tree...
> >>> starting device tree allocs at 01401000
> >>> otloc_up(00100000, 0013d948)
> >>> trying: 0x01401000
> >>> trying: 0x01501000
> >>> -› 01501000
> >>> alloc_bottom : 01601000
> >>> alloc_top : 20000000
> >>> alloc_top_hi : 20000000
> >>> nmo_top : 20000000
> >>> ram_top : 20000000
> >>> Building dt strings...
> >>> Building dt structure...
> >>> reserved memory map:
> >>> 00d40000 - 006c1000
> >>> Device tree strings 0x01502000 -> 0x00000007
> >>> Device tree struct 0x01503000 -> 0x00000007
> >>> Quiescing Open Firmware ...
> >>> Booting Linux via __start() @ 0x001400000
> >>> ->dt_headr_start=0x01501000
> >>>
> >>> Any suggestions before I start a bisect ?
> >>>
> >>
> >> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
> >
> > Using locally:
> >
> > diff --git a/arch/powerpc/configs/g4_defconfig
> > b/arch/powerpc/configs/g4_defconfig
> > index 14d0376f637d..916bce8ce9c3 100644
> > --- a/arch/powerpc/configs/g4_defconfig
> > +++ b/arch/powerpc/configs/g4_defconfig
> > @@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
> > # CONFIG_COMPAT_BRK is not set
> > CONFIG_PROFILING=y
> > CONFIG_G4_CPU=y
> > +# CONFIG_PPC_KUEP is not set
> > +# CONFIG_PPC_KUAP is not set
> > CONFIG_PANIC_TIMEOUT=0
> > # CONFIG_PPC_CHRP is not set
> > CONFIG_CPU_FREQ=y
> >
> >
> > Leads to almost the same error (some values have changed):
>
> Ok.
>
> When you say you are using 'master', what do you mean ? Can you give the
> commit Id ?
>
> Does it boots with Kernel 5.1.4 ?
I was able to boot v5.1:
$ dmesg | head
[ 0.000000] printk: bootconsole [udbg0] enabled
[ 0.000000] Total memory = 512MB; using 1024kB for hash table (at (ptrval))
[ 0.000000] Linux version 5.1.0+ (malat@debian.org) (gcc version
8.3.0 (Debian 8.3.0-7)) #8 Thu May 23 06:26:38 UTC 2019
Commit id is:
e93c9c99a629 (tag: v5.1) Linux 5.1
> Did you try latest powerpc/merge branch ?
Will try that next.
> Can you send your full .config ?
Config is attached.
Thanks,
> Christophe
>
> >
> > done
> > Setting btext !
> > W=640 H=488 LB=768 addr=0x9c008000
> > copying OF device tree...
> > starting device tree allocs at 01300000
> > alloc_up(00100000, 0013d948)
> > trying: 0x01300000
> > trying: 0x01400000
> > -› 01400000
> > alloc_bottom : 01500000
> > alloc_top : 20000000
> > alloc_top_hi : 20000000
> > nmo_top : 20000000
> > ram_top : 20000000
> > Building dt strings...
> > Building dt structure...
> > reserved memory map:
> > 00c40000 - 006c0000
> > Device tree strings 0x01401000 -> 0x00000007
> > Device tree struct 0x01402000 -> 0x00000007
> > Quiescing Open Firmware ...
> > Booting Linux via __start() @ 0x001400000
> > ->dt_headr_start=0x01400000
> >
> > Thanks anyway,
> >
[-- Attachment #2: g4_defconfig --]
[-- Type: application/octet-stream, Size: 5122 bytes --]
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
# CONFIG_MEMCG_SWAP_ENABLED is not set
CONFIG_BLK_CGROUP=y
CONFIG_CFS_BANDWIDTH=y
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_PERF=y
CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
CONFIG_USER_NS=y
CONFIG_SCHED_AUTOGROUP=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y
CONFIG_EXPERT=y
CONFIG_BPF_SYSCALL=y
CONFIG_USERFAULTFD=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
CONFIG_G4_CPU=y
# CONFIG_PPC_KUEP is not set
# CONFIG_PPC_KUAP is not set
CONFIG_PANIC_TIMEOUT=0
# CONFIG_PPC_CHRP is not set
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_PMAC=y
CONFIG_TAU=y
CONFIG_HIGHMEM=y
CONFIG_KEXEC=y
CONFIG_HIBERNATION=y
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_OPROFILE=m
CONFIG_KPROBES=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_PARTITION_ADVANCED=y
# CONFIG_MQ_IOSCHED_KYBER is not set
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NET_SCHED=y
CONFIG_CGROUP_NET_PRIO=y
CONFIG_CGROUP_NET_CLASSID=y
CONFIG_CFG80211=m
CONFIG_MAC80211=m
CONFIG_PCI_MSI=y
CONFIG_DEVTMPFS=y
CONFIG_DEBUG_DRIVER=y
CONFIG_CONNECTOR=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=m
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_ATA=y
CONFIG_PATA_MACIO=y
CONFIG_MD=y
CONFIG_FIREWIRE=m
CONFIG_FIREWIRE_OHCI=m
CONFIG_ADB=y
CONFIG_ADB_PMU=y
CONFIG_ADB_PMU_LED=y
CONFIG_INPUT_ADBHID=y
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_SEEQ is not set
CONFIG_SUNGEM=m
# CONFIG_USB_NET_DRIVERS is not set
CONFIG_B43=m
CONFIG_B43_DEBUG=y
# CONFIG_RTL_CARDS is not set
# CONFIG_WLAN_VENDOR_TI is not set
CONFIG_WAN=y
CONFIG_ISDN=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_EVDEV=m
# CONFIG_KEYBOARD_ATKBD is not set
# CONFIG_MOUSE_PS2 is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_PMACZILOG=y
CONFIG_SERIAL_PMACZILOG_CONSOLE=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C_CHARDEV=m
CONFIG_SPI=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_CORE=y
CONFIG_WATCHDOG_SYSFS=y
CONFIG_AGP=y
CONFIG_AGP_UNINORTH=y
CONFIG_DRM=m
CONFIG_DRM_DEBUG_SELFTEST=m
CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_RADEON=m
CONFIG_FB=y
CONFIG_FIRMWARE_EDID=y
CONFIG_FB_OF=y
CONFIG_FB_RADEON=m
CONFIG_FB_RADEON_DEBUG=y
# CONFIG_LCD_CLASS_DEVICE is not set
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_DEBUG=y
CONFIG_SND_HDA_PREALLOC_SIZE=2048
CONFIG_SND_POWERMAC=m
CONFIG_SND_AOA=m
CONFIG_SND_AOA_FABRIC_LAYOUT=m
CONFIG_SND_AOA_TOONIE=m
CONFIG_HIDRAW=y
CONFIG_HID_APPLE=y
CONFIG_HID_PID=y
CONFIG_USB_HIDDEV=y
CONFIG_USB=m
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DYNAMIC_MINORS=y
CONFIG_USB_EHCI_HCD=m
CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_OHCI_HCD=m
CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
CONFIG_USB_STORAGE=m
CONFIG_MMC=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DEBUG=y
CONFIG_RTC_DRV_GENERIC=y
CONFIG_DMADEVICES=y
CONFIG_PM_DEVFREQ=y
CONFIG_MEMORY=y
CONFIG_GENERIC_PHY=y
CONFIG_EXT4_FS=m
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_EXPORTFS_BLOCK_OPS=y
CONFIG_FANOTIFY=y
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_AUTOFS4_FS=m
CONFIG_FUSE_FS=m
CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_NLS_DEFAULT="utf8"
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y
# CONFIG_CRYPTO_ECHAINIV is not set
CONFIG_CRYPTO_MD5_PPC=m
CONFIG_CRYPTO_SHA1_PPC=m
CONFIG_CRC32_SELFTEST=y
CONFIG_RANDOM32_SELFTEST=y
CONFIG_IRQ_POLL=y
CONFIG_STRING_SELFTEST=y
CONFIG_PRINTK_TIME=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_INFO=y
CONFIG_STRIP_ASM_SYMS=y
CONFIG_HEADERS_CHECK=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01b6
CONFIG_PAGE_EXTENSION=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4000
CONFIG_DEBUG_KMEMLEAK_TEST=m
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_STACKOVERFLOW=y
CONFIG_KASAN=y
CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_SCHEDSTATS=y
CONFIG_SCHED_STACK_END_CHECK=y
CONFIG_FTRACE_SYSCALLS=y
CONFIG_TRACER_SNAPSHOT=y
CONFIG_STACK_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_ATOMIC64_SELFTEST=y
CONFIG_BUG_ON_DATA_CORRUPTION=y
CONFIG_UBSAN=y
CONFIG_TEST_UBSAN=m
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_XMON=y
CONFIG_BOOTX_TEXT=y
CONFIG_PPC_EARLY_DEBUG=y
^ permalink raw reply
* kmemleak: 1157 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
From: Mathieu Malaterre @ 2019-05-23 8:38 UTC (permalink / raw)
To: linuxppc-dev
Hi there,
Is there a way to dump more context (somewhere in of tree
flattening?). I cannot make sense of the following:
kmemleak: 1157 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
Where:
# head -40 /sys/kernel/debug/kmemleak
unreferenced object 0xdf44d180 (size 8):
comm "swapper", pid 1, jiffies 4294892297 (age 4766.460s)
hex dump (first 8 bytes):
62 61 73 65 00 00 00 00 base....
backtrace:
[<0ca59825>] kstrdup+0x4c/0xb8
[<c8a79377>] kobject_set_name_vargs+0x34/0xc8
[<661b4c86>] kobject_add+0x78/0x120
[<c1416f27>] __of_attach_node_sysfs+0xa0/0x14c
[<2a143d10>] of_core_init+0x90/0x114
[<a353d0e1>] driver_init+0x30/0x48
[<84ed01b1>] kernel_init_freeable+0xfc/0x3fc
[<dc60f815>] kernel_init+0x20/0x110
[<faa1c5b0>] ret_from_kernel_thread+0x14/0x1c
unreferenced object 0xdf44d178 (size 8):
comm "swapper", pid 1, jiffies 4294892297 (age 4766.460s)
hex dump (first 8 bytes):
6d 6f 64 65 6c 00 97 c8 model...
backtrace:
[<0ca59825>] kstrdup+0x4c/0xb8
[<0eeb0a3b>] __of_add_property_sysfs+0x88/0x12c
[<f6c64af0>] __of_attach_node_sysfs+0xcc/0x14c
[<2a143d10>] of_core_init+0x90/0x114
[<a353d0e1>] driver_init+0x30/0x48
[<84ed01b1>] kernel_init_freeable+0xfc/0x3fc
[<dc60f815>] kernel_init+0x20/0x110
[<faa1c5b0>] ret_from_kernel_thread+0x14/0x1c
unreferenced object 0xdf4021e0 (size 16):
comm "swapper", pid 1, jiffies 4294892297 (age 4766.460s)
hex dump (first 16 bytes):
63 6f 6d 70 61 74 69 62 6c 65 00 01 00 00 00 00 compatible......
backtrace:
[<0ca59825>] kstrdup+0x4c/0xb8
[<0eeb0a3b>] __of_add_property_sysfs+0x88/0x12c
[<f6c64af0>] __of_attach_node_sysfs+0xcc/0x14c
[<2a143d10>] of_core_init+0x90/0x114
[<a353d0e1>] driver_init+0x30/0x48
[<84ed01b1>] kernel_init_freeable+0xfc/0x3fc
[<dc60f815>] kernel_init+0x20/0x110
[<faa1c5b0>] ret_from_kernel_thread+0x14/0x1c
^ permalink raw reply
* [PATCH] powerpc/32: fix build failure on book3e with KVM
From: Christophe Leroy @ 2019-05-23 8:39 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linuxppc-dev, linux-kernel
Build failure was introduced by the commit identified below,
due to missed macro expension leading to wrong called function's name.
arch/powerpc/kernel/head_fsl_booke.o: In function `SystemCall':
arch/powerpc/kernel/head_fsl_booke.S:416: undefined reference to `kvmppc_handler_BOOKE_INTERRUPT_SYSCALL_SPRN_SRR1'
Makefile:1052: recipe for target 'vmlinux' failed
The called function should be kvmppc_handler_8_0x01B(). This patch fixes it.
Reported-by: Paul Mackerras <paulus@ozlabs.org>
Fixes: 1a4b739bbb4f ("powerpc/32: implement fast entry for syscalls on BOOKE")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/head_booke.h | 4 ++--
arch/powerpc/kernel/head_fsl_booke.S | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index bfeb469e8106..dec0912a6508 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -83,7 +83,7 @@ END_BTB_FLUSH_SECTION
SAVE_4GPRS(3, r11); \
SAVE_2GPRS(7, r11)
-.macro SYSCALL_ENTRY trapno intno
+.macro SYSCALL_ENTRY trapno intno srr1
mfspr r10, SPRN_SPRG_THREAD
#ifdef CONFIG_KVM_BOOKE_HV
BEGIN_FTR_SECTION
@@ -94,7 +94,7 @@ BEGIN_FTR_SECTION
mfspr r11, SPRN_SRR1
mtocrf 0x80, r11 /* check MSR[GS] without clobbering reg */
bf 3, 1975f
- b kvmppc_handler_BOOKE_INTERRUPT_\intno\()_SPRN_SRR1
+ b kvmppc_handler_\intno\()_\srr1
1975:
mr r12, r13
lwz r13, THREAD_NORMSAVE(2)(r10)
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 6621f230cc37..2b39f42c3676 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -413,7 +413,7 @@ interrupt_base:
/* System Call Interrupt */
START_EXCEPTION(SystemCall)
- SYSCALL_ENTRY 0xc00 SYSCALL
+ SYSCALL_ENTRY 0xc00 BOOKE_INTERRUPT_SYSCALL SPRN_SRR1
/* Auxiliary Processor Unavailable Interrupt */
EXCEPTION(0x2900, AP_UNAVAIL, AuxillaryProcessorUnavailable, \
--
2.13.3
^ permalink raw reply related
* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Mathieu Malaterre @ 2019-05-23 8:46 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev
In-Reply-To: <CA+7wUsxOxvtsp511c63HK-=Wm22qyEtDcg=p4rfRD+n55UQmiQ@mail.gmail.com>
On Thu, May 23, 2019 at 10:29 AM Mathieu Malaterre <malat@debian.org> wrote:
>
> On Thu, May 23, 2019 at 8:39 AM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
> >
> > Salut Mathieu,
> >
> > Le 23/05/2019 à 08:24, Mathieu Malaterre a écrit :
> > > Salut Christophe,
> > >
> > > On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
> > > <christophe.leroy@c-s.fr> wrote:
> > >>
> > >>
> > >>
> > >> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
> > >>> Hi all,
> > >>>
> > >>> I have not boot my G4 in a while, today using master here is what I see:
> > >>>
> > >>> done
> > >>> Setting btext !
> > >>> W=640 H=488 LB=768 addr=0x9c008000
> > >>> copying OF device tree...
> > >>> starting device tree allocs at 01401000
> > >>> otloc_up(00100000, 0013d948)
> > >>> trying: 0x01401000
> > >>> trying: 0x01501000
> > >>> -› 01501000
> > >>> alloc_bottom : 01601000
> > >>> alloc_top : 20000000
> > >>> alloc_top_hi : 20000000
> > >>> nmo_top : 20000000
> > >>> ram_top : 20000000
> > >>> Building dt strings...
> > >>> Building dt structure...
> > >>> reserved memory map:
> > >>> 00d40000 - 006c1000
> > >>> Device tree strings 0x01502000 -> 0x00000007
> > >>> Device tree struct 0x01503000 -> 0x00000007
> > >>> Quiescing Open Firmware ...
> > >>> Booting Linux via __start() @ 0x001400000
> > >>> ->dt_headr_start=0x01501000
> > >>>
> > >>> Any suggestions before I start a bisect ?
> > >>>
> > >>
> > >> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
> > >
> > > Using locally:
> > >
> > > diff --git a/arch/powerpc/configs/g4_defconfig
> > > b/arch/powerpc/configs/g4_defconfig
> > > index 14d0376f637d..916bce8ce9c3 100644
> > > --- a/arch/powerpc/configs/g4_defconfig
> > > +++ b/arch/powerpc/configs/g4_defconfig
> > > @@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
> > > # CONFIG_COMPAT_BRK is not set
> > > CONFIG_PROFILING=y
> > > CONFIG_G4_CPU=y
> > > +# CONFIG_PPC_KUEP is not set
> > > +# CONFIG_PPC_KUAP is not set
> > > CONFIG_PANIC_TIMEOUT=0
> > > # CONFIG_PPC_CHRP is not set
> > > CONFIG_CPU_FREQ=y
> > >
> > >
> > > Leads to almost the same error (some values have changed):
> >
> > Ok.
> >
> > When you say you are using 'master', what do you mean ? Can you give the
> > commit Id ?
Sorry about that. The problematic commit for me is:
54dee406374c Merge tag 'arm64-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
> >
> > Does it boots with Kernel 5.1.4 ?
>
> I was able to boot v5.1:
>
> $ dmesg | head
> [ 0.000000] printk: bootconsole [udbg0] enabled
> [ 0.000000] Total memory = 512MB; using 1024kB for hash table (at (ptrval))
> [ 0.000000] Linux version 5.1.0+ (malat@debian.org) (gcc version
> 8.3.0 (Debian 8.3.0-7)) #8 Thu May 23 06:26:38 UTC 2019
>
> Commit id is:
>
> e93c9c99a629 (tag: v5.1) Linux 5.1
>
> > Did you try latest powerpc/merge branch ?
>
> Will try that next.
>
> > Can you send your full .config ?
>
> Config is attached.
>
> Thanks,
>
> > Christophe
> >
> > >
> > > done
> > > Setting btext !
> > > W=640 H=488 LB=768 addr=0x9c008000
> > > copying OF device tree...
> > > starting device tree allocs at 01300000
> > > alloc_up(00100000, 0013d948)
> > > trying: 0x01300000
> > > trying: 0x01400000
> > > -› 01400000
> > > alloc_bottom : 01500000
> > > alloc_top : 20000000
> > > alloc_top_hi : 20000000
> > > nmo_top : 20000000
> > > ram_top : 20000000
> > > Building dt strings...
> > > Building dt structure...
> > > reserved memory map:
> > > 00c40000 - 006c0000
> > > Device tree strings 0x01401000 -> 0x00000007
> > > Device tree struct 0x01402000 -> 0x00000007
> > > Quiescing Open Firmware ...
> > > Booting Linux via __start() @ 0x001400000
> > > ->dt_headr_start=0x01400000
> > >
> > > Thanks anyway,
> > >
^ permalink raw reply
* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Mathieu Malaterre @ 2019-05-23 8:53 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev
In-Reply-To: <CA+7wUsxOxvtsp511c63HK-=Wm22qyEtDcg=p4rfRD+n55UQmiQ@mail.gmail.com>
On Thu, May 23, 2019 at 10:29 AM Mathieu Malaterre <malat@debian.org> wrote:
>
> On Thu, May 23, 2019 at 8:39 AM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
> >
> > Salut Mathieu,
> >
> > Le 23/05/2019 à 08:24, Mathieu Malaterre a écrit :
> > > Salut Christophe,
> > >
> > > On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
> > > <christophe.leroy@c-s.fr> wrote:
> > >>
> > >>
> > >>
> > >> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
> > >>> Hi all,
> > >>>
> > >>> I have not boot my G4 in a while, today using master here is what I see:
> > >>>
> > >>> done
> > >>> Setting btext !
> > >>> W=640 H=488 LB=768 addr=0x9c008000
> > >>> copying OF device tree...
> > >>> starting device tree allocs at 01401000
> > >>> otloc_up(00100000, 0013d948)
> > >>> trying: 0x01401000
> > >>> trying: 0x01501000
> > >>> -› 01501000
> > >>> alloc_bottom : 01601000
> > >>> alloc_top : 20000000
> > >>> alloc_top_hi : 20000000
> > >>> nmo_top : 20000000
> > >>> ram_top : 20000000
> > >>> Building dt strings...
> > >>> Building dt structure...
> > >>> reserved memory map:
> > >>> 00d40000 - 006c1000
> > >>> Device tree strings 0x01502000 -> 0x00000007
> > >>> Device tree struct 0x01503000 -> 0x00000007
> > >>> Quiescing Open Firmware ...
> > >>> Booting Linux via __start() @ 0x001400000
> > >>> ->dt_headr_start=0x01501000
> > >>>
> > >>> Any suggestions before I start a bisect ?
> > >>>
> > >>
> > >> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
> > >
> > > Using locally:
> > >
> > > diff --git a/arch/powerpc/configs/g4_defconfig
> > > b/arch/powerpc/configs/g4_defconfig
> > > index 14d0376f637d..916bce8ce9c3 100644
> > > --- a/arch/powerpc/configs/g4_defconfig
> > > +++ b/arch/powerpc/configs/g4_defconfig
> > > @@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
> > > # CONFIG_COMPAT_BRK is not set
> > > CONFIG_PROFILING=y
> > > CONFIG_G4_CPU=y
> > > +# CONFIG_PPC_KUEP is not set
> > > +# CONFIG_PPC_KUAP is not set
> > > CONFIG_PANIC_TIMEOUT=0
> > > # CONFIG_PPC_CHRP is not set
> > > CONFIG_CPU_FREQ=y
> > >
> > >
> > > Leads to almost the same error (some values have changed):
> >
> > Ok.
> >
> > When you say you are using 'master', what do you mean ? Can you give the
> > commit Id ?
> >
> > Does it boots with Kernel 5.1.4 ?
>
> I was able to boot v5.1:
>
> $ dmesg | head
> [ 0.000000] printk: bootconsole [udbg0] enabled
> [ 0.000000] Total memory = 512MB; using 1024kB for hash table (at (ptrval))
> [ 0.000000] Linux version 5.1.0+ (malat@debian.org) (gcc version
> 8.3.0 (Debian 8.3.0-7)) #8 Thu May 23 06:26:38 UTC 2019
>
> Commit id is:
>
> e93c9c99a629 (tag: v5.1) Linux 5.1
>
> > Did you try latest powerpc/merge branch ?
>
> Will try that next.
I confirm powerpc/merge does not boot for me (same config). Commit id:
a27eaa62326d (powerpc/merge) Automatic merge of branches 'master',
'next' and 'fixes' into merge
> > Can you send your full .config ?
>
> Config is attached.
>
> Thanks,
>
> > Christophe
> >
> > >
> > > done
> > > Setting btext !
> > > W=640 H=488 LB=768 addr=0x9c008000
> > > copying OF device tree...
> > > starting device tree allocs at 01300000
> > > alloc_up(00100000, 0013d948)
> > > trying: 0x01300000
> > > trying: 0x01400000
> > > -› 01400000
> > > alloc_bottom : 01500000
> > > alloc_top : 20000000
> > > alloc_top_hi : 20000000
> > > nmo_top : 20000000
> > > ram_top : 20000000
> > > Building dt strings...
> > > Building dt structure...
> > > reserved memory map:
> > > 00c40000 - 006c0000
> > > Device tree strings 0x01401000 -> 0x00000007
> > > Device tree struct 0x01402000 -> 0x00000007
> > > Quiescing Open Firmware ...
> > > Booting Linux via __start() @ 0x001400000
> > > ->dt_headr_start=0x01400000
> > >
> > > Thanks anyway,
> > >
^ permalink raw reply
* Re: Failure to boot G4: dt_headr_start=0x01501000
From: Christophe Leroy @ 2019-05-23 9:45 UTC (permalink / raw)
To: Mathieu Malaterre; +Cc: linuxppc-dev
In-Reply-To: <CA+7wUszcau+OBj+ZTr007_vuTJsOmT0izZ64_W98x1=MPLU6aA@mail.gmail.com>
Le 23/05/2019 à 10:53, Mathieu Malaterre a écrit :
> On Thu, May 23, 2019 at 10:29 AM Mathieu Malaterre <malat@debian.org> wrote:
>>
>> On Thu, May 23, 2019 at 8:39 AM Christophe Leroy
>> <christophe.leroy@c-s.fr> wrote:
>>>
>>> Salut Mathieu,
>>>
>>> Le 23/05/2019 à 08:24, Mathieu Malaterre a écrit :
>>>> Salut Christophe,
>>>>
>>>> On Wed, May 22, 2019 at 2:20 PM Christophe Leroy
>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>
>>>>>
>>>>>
>>>>> Le 22/05/2019 à 14:15, Mathieu Malaterre a écrit :
>>>>>> Hi all,
>>>>>>
>>>>>> I have not boot my G4 in a while, today using master here is what I see:
>>>>>>
>>>>>> done
>>>>>> Setting btext !
>>>>>> W=640 H=488 LB=768 addr=0x9c008000
>>>>>> copying OF device tree...
>>>>>> starting device tree allocs at 01401000
>>>>>> otloc_up(00100000, 0013d948)
>>>>>> trying: 0x01401000
>>>>>> trying: 0x01501000
>>>>>> -› 01501000
>>>>>> alloc_bottom : 01601000
>>>>>> alloc_top : 20000000
>>>>>> alloc_top_hi : 20000000
>>>>>> nmo_top : 20000000
>>>>>> ram_top : 20000000
>>>>>> Building dt strings...
>>>>>> Building dt structure...
>>>>>> reserved memory map:
>>>>>> 00d40000 - 006c1000
>>>>>> Device tree strings 0x01502000 -> 0x00000007
>>>>>> Device tree struct 0x01503000 -> 0x00000007
>>>>>> Quiescing Open Firmware ...
>>>>>> Booting Linux via __start() @ 0x001400000
>>>>>> ->dt_headr_start=0x01501000
>>>>>>
>>>>>> Any suggestions before I start a bisect ?
>>>>>>
>>>>>
>>>>> Have you tried without CONFIG_PPC_KUEP and CONFIG_PPC_KUAP ?
>>>>
>>>> Using locally:
>>>>
>>>> diff --git a/arch/powerpc/configs/g4_defconfig
>>>> b/arch/powerpc/configs/g4_defconfig
>>>> index 14d0376f637d..916bce8ce9c3 100644
>>>> --- a/arch/powerpc/configs/g4_defconfig
>>>> +++ b/arch/powerpc/configs/g4_defconfig
>>>> @@ -32,6 +32,8 @@ CONFIG_USERFAULTFD=y
>>>> # CONFIG_COMPAT_BRK is not set
>>>> CONFIG_PROFILING=y
>>>> CONFIG_G4_CPU=y
>>>> +# CONFIG_PPC_KUEP is not set
>>>> +# CONFIG_PPC_KUAP is not set
>>>> CONFIG_PANIC_TIMEOUT=0
>>>> # CONFIG_PPC_CHRP is not set
>>>> CONFIG_CPU_FREQ=y
>>>>
>>>>
>>>> Leads to almost the same error (some values have changed):
>>>
>>> Ok.
>>>
>>> When you say you are using 'master', what do you mean ? Can you give the
>>> commit Id ?
>>>
>>> Does it boots with Kernel 5.1.4 ?
>>
>> I was able to boot v5.1:
>>
>> $ dmesg | head
>> [ 0.000000] printk: bootconsole [udbg0] enabled
>> [ 0.000000] Total memory = 512MB; using 1024kB for hash table (at (ptrval))
>> [ 0.000000] Linux version 5.1.0+ (malat@debian.org) (gcc version
>> 8.3.0 (Debian 8.3.0-7)) #8 Thu May 23 06:26:38 UTC 2019
>>
>> Commit id is:
>>
>> e93c9c99a629 (tag: v5.1) Linux 5.1
>>
>>> Did you try latest powerpc/merge branch ?
>>
>> Will try that next.
>
> I confirm powerpc/merge does not boot for me (same config). Commit id:
>
> a27eaa62326d (powerpc/merge) Automatic merge of branches 'master',
> 'next' and 'fixes' into merge
I see in the config you sent me that you have selected CONFIG_KASAN,
which is a big new stuff.
Can you try without it ?
Christophe
>
>
>>> Can you send your full .config ?
>>
>> Config is attached.
>>
>> Thanks,
>>
>>> Christophe
>>>
>>>>
>>>> done
>>>> Setting btext !
>>>> W=640 H=488 LB=768 addr=0x9c008000
>>>> copying OF device tree...
>>>> starting device tree allocs at 01300000
>>>> alloc_up(00100000, 0013d948)
>>>> trying: 0x01300000
>>>> trying: 0x01400000
>>>> -› 01400000
>>>> alloc_bottom : 01500000
>>>> alloc_top : 20000000
>>>> alloc_top_hi : 20000000
>>>> nmo_top : 20000000
>>>> ram_top : 20000000
>>>> Building dt strings...
>>>> Building dt structure...
>>>> reserved memory map:
>>>> 00c40000 - 006c0000
>>>> Device tree strings 0x01401000 -> 0x00000007
>>>> Device tree struct 0x01402000 -> 0x00000007
>>>> Quiescing Open Firmware ...
>>>> Booting Linux via __start() @ 0x001400000
>>>> ->dt_headr_start=0x01400000
>>>>
>>>> Thanks anyway,
>>>>
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_esai: fix the channel swap issue after xrun
From: S.j. Wang @ 2019-05-23 9:53 UTC (permalink / raw)
To: Nicolin Chen
Cc: alsa-devel@alsa-project.org, timur@kernel.org,
Xiubo.Lee@gmail.com, festevam@gmail.com,
linux-kernel@vger.kernel.org, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
Hi
> > + /*
> > + * Add fifo reset here, because the regcache_sync will
> > + * write one more data to ETDR.
> > + * Which will cause channel shift.
>
> Sounds like a bug to me...should fix it first by marking the data registers as
> volatile.
>
The ETDR is a writable register, it is not volatile. Even we change it to
Volatile, I don't think we can't avoid this issue. for the regcache_sync
Just to write this register, it is correct behavior.
Best regards
Wang shengjiu
^ 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