RE: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-22 Thread luigi burdo
Christian, i think Darren patch override some memory region that on kernel.org 
was different and this make the kernel patched run and work

Luigi

Da: Christian Zigotzky [chzigot...@xenosoft.de]
Inviato: mercoledì 22 giugno 2016 21.07
A: Benjamin Herrenschmidt; Michael Ellerman; Aneesh Kumar K.V; Darren Stevens; 
linuxppc-dev@lists.ozlabs.org; Michael Ellerman; Julian Margetson; Adrian Cox; 
R.T.Dickinson; R.T.Dickinson; Pat Wall; Pat Wall; cont...@a-eon.com; Matthew 
Leaman; luigi burdo; Christian Zigotzky
Oggetto: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

Hi All,

Please find attached Darren's patch. With this patch, the Nemo board
boots. That means, the problematic source code is somewhere in this patch.
Which file in this patch is responsible for starting the kernel?

Thanks,

Christian

On 13 June 2016 at 8:09 PM, Christian Zigotzky wrote:
> Hi Ben,
>
> I could send you a patch but it doesn't work with the three PowerPC
> commits. I think we have to fix the boot issue at first. After that we
> can integrate the first patch for the Nemo board.
>
> Cheers,
>
> Christian
>
> On 13 June 2016 at 10:19 AM, Benjamin Herrenschmidt wrote:
>> The right way to not have this problem anymore is to cleanup and
>> submit your patches upstream so they don't break all the time :-)
>>
>> Cheers,
>> Ben.
>>
>>

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-13 Thread Christian Zigotzky
Hi All,

Can I disable the new PowerPC features with

Radix MMU Support (PPC_RADIX_MMU) [Y/n/?] (NEW) -> n

?

I can't compile the RC3 without the PowerPC commits. Our kernel lost the 
mainline kernel support. Revert of the three PowerPC commits works but the 
kernel doesn't compile anymore.

Cheers,

Christian

Sent from my iPhone

> On 09 Jun 2016, at 14:13, Christian Zigotzky  wrote:
> 
> Michael,
> 
> Thank you for your patch. I was able to compile the kernel but unfortunately 
> it doesn't boot.
> 
> Do you have another hint or patch for me?
> 
> Thanks in advance,
> 
> Christian
> 
>> On 09 June 2016 at 1:15 PM, Michael Ellerman wrote:
>>> On Thu, 2016-06-09 at 10:48 +0200, Christian Zigotzky wrote:
>>> 
>>> Shall I modify the workaround? Is the workaround for lack of the device
>>> tree the problem?
>> I don't think so.
>> 
>> You could try this patch to try and isolate it:
>> 
>> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
>> b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> index 88a5ecaa157b..ae2f2705e8a0 100644
>> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
>> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
>> @@ -251,7 +251,7 @@ extern unsigned long ioremap_bot;
>>   *  PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
>>   * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
>>   */
>> -#define KERN_IO_START(KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
>> +#define KERN_IO_START(H_KERN_VIRT_START + (H_KERN_VIRT_SIZE >> 1))
>>  #define FULL_IO_SIZE0x8000ul
>>  #define  ISA_IO_BASE(KERN_IO_START)
>>  #define  ISA_IO_END(KERN_IO_START + 0x1ul)
>> 
>> 
>> cheers
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-13 Thread Benjamin Herrenschmidt
On Mon, 2016-06-13 at 09:14 +0100, Christian Zigotzky wrote:
> Can I disable the new PowerPC features with
> 
> Radix MMU Support (PPC_RADIX_MMU) [Y/n/?] (NEW) -> n
> 
> ?
> 
> I can't compile the RC3 without the PowerPC commits. Our kernel lost
> the mainline kernel support. Revert of the three PowerPC commits
> works but the kernel doesn't compile anymore.

The right way to not have this problem anymore is to cleanup and
submit your patches upstream so they don't break all the time :-)

Cheers,
Ben.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Michael Ellerman
On Thu, 2016-06-09 at 10:48 +0200, Christian Zigotzky wrote:

> Shall I modify the workaround? Is the workaround for lack of the device 
> tree the problem?

I don't think so.

You could try this patch to try and isolate it:

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h 
b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 88a5ecaa157b..ae2f2705e8a0 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -251,7 +251,7 @@ extern unsigned long ioremap_bot;
  *  PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
  * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
  */
-#define KERN_IO_START  (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
+#define KERN_IO_START  (H_KERN_VIRT_START + (H_KERN_VIRT_SIZE >> 1))
 #define FULL_IO_SIZE   0x8000ul
 #define  ISA_IO_BASE   (KERN_IO_START)
 #define  ISA_IO_END(KERN_IO_START + 0x1ul)


cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Aneesh Kumar K.V
Darren Stevens  writes:

> Hello Christian

> That's not where I ended up with my bisect, this commit is about 10 before the
> one I found to be bad, which is:
>
> commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
> Author: Aneesh Kumar K.V 
> Date:   Fri Apr 29 23:26:21 2016 +1000
>
> powerpc/mm: vmalloc abstraction in preparation for radix
> 
> The vmalloc range differs between hash and radix config. Hence make
> VMALLOC_START and related constants a variable which will be runtime
> initialized depending on whether hash or radix mode is active.
> 
> Signed-off-by: Aneesh Kumar K.V 
> [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
> Signed-off-by: Michael Ellerman 
>

Can you check the value of ISA_IO_BASE where you are
using it. If you are calling it early, you will find wrong value in
that. With the latest kernel it is a variable and is initialized in
hash__early_init_mmu();

-aneesh

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Michael Ellerman
On Wed, 2016-06-08 at 12:33 +0100, Darren Stevens wrote:
> On 07/06/2016, Christian Zigotzky wrote:
> > 
> > 764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
> > commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
> > Author: Aneesh Kumar K.V 
> > Date:   Fri Apr 29 23:26:09 2016 +1000
> > 
> >  powerpc/mm/radix: Add checks in slice code to catch radix usage
> > 
> 
> That's not where I ended up with my bisect, this commit is about 10 before the
> one I found to be bad, which is:
> 
> commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
> Author: Aneesh Kumar K.V 
> Date:   Fri Apr 29 23:26:21 2016 +1000
> 
> powerpc/mm: vmalloc abstraction in preparation for radix
> 
> The vmalloc range differs between hash and radix config. Hence make
> VMALLOC_START and related constants a variable which will be runtime
> initialized depending on whether hash or radix mode is active.
> 
> Signed-off-by: Aneesh Kumar K.V 
> [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
> Signed-off-by: Michael Ellerman 
> 
> Not sure how we are getting different results though. I have attached my
> bisect log and the suspect commit, whcih is quite large. I'm not sure which
> part of it is at fault. I have some jobs to do now, but hope to get tesing
> this later today.

That one is more likely to be the problem, though I don't see anything glaringly
wrong with it.

Does your patch use any of the constants that are changed in that file? They now
aren't constants, they're initialised at boot, so if you use them too early
you'll get junk.

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Darren Stevens
Hello Christian

On 07/06/2016, Christian Zigotzky wrote:
> "range.size, pgprot_val(pgprot_noncached(__pgprot(0;" isn't the 
> problem. :-) It works.
>
> 764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
> commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
> Author: Aneesh Kumar K.V 
> Date:   Fri Apr 29 23:26:09 2016 +1000
>
>  powerpc/mm/radix: Add checks in slice code to catch radix usage
>
>  Radix doesn't need slice support. Catch incorrect usage of slice
>  code when radix is enabled.
>
>  Signed-off-by: Aneesh Kumar K.V 
>  Signed-off-by: Michael Ellerman 
>

That's not where I ended up with my bisect, this commit is about 10 before the
one I found to be bad, which is:

commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
Author: Aneesh Kumar K.V 
Date:   Fri Apr 29 23:26:21 2016 +1000

powerpc/mm: vmalloc abstraction in preparation for radix

The vmalloc range differs between hash and radix config. Hence make
VMALLOC_START and related constants a variable which will be runtime
initialized depending on whether hash or radix mode is active.

Signed-off-by: Aneesh Kumar K.V 
[mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
Signed-off-by: Michael Ellerman 

Not sure how we are getting different results though. I have attached my
bisect log and the suspect commit, whcih is quite large. I'm not sure which
part of it is at fault. I have some jobs to do now, but hope to get tesing
this later today.

Regards
Darren
git bisect start
# bad: [ed2608faa0f701b1dbc65277a9e5c7ff7118bfd4] Merge branch 'for-linus' of 
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
git bisect bad ed2608faa0f701b1dbc65277a9e5c7ff7118bfd4
# good: [8ffb4103f5e28d7e7890ed4774d8e009f253f56e] IB/qib: Use cache inhibitted 
and guarded mapping on powerpc
git bisect good 8ffb4103f5e28d7e7890ed4774d8e009f253f56e
# good: [801faf0db8947e01877920e848a4d338dd7a99e7] mm/slab: lockless decision 
to grow cache
git bisect good 801faf0db8947e01877920e848a4d338dd7a99e7
# bad: [2f37dd131c5d3a2eac21cd5baf80658b1b02a8ac] Merge tag 'staging-4.7-rc1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
git bisect bad 2f37dd131c5d3a2eac21cd5baf80658b1b02a8ac
# bad: [be1332c0994fbf016fa4ef0f0c4acda566fe6cb3] Merge tag 'gfs2-4.7.fixes' of 
git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
git bisect bad be1332c0994fbf016fa4ef0f0c4acda566fe6cb3
# good: [f4c80d5a16eb4b08a0d9ade154af1ebdc63f5752] Merge tag 'sound-4.7-rc1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
git bisect good f4c80d5a16eb4b08a0d9ade154af1ebdc63f5752
# good: [a1c28b75a95808161cacbb3531c418abe248994e] Merge branch 'for-linus' of 
git://git.armlinux.org.uk/~rmk/linux-arm
git bisect good a1c28b75a95808161cacbb3531c418abe248994e
# bad: [6eb59af580dcffc6f6982ac8ef6d27a1a5f26b27] Merge tag 'mfd-for-linus-4.7' 
of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
git bisect bad 6eb59af580dcffc6f6982ac8ef6d27a1a5f26b27
# bad: [4fad494321351f0ac412945c6a464109ad96734a] powerpc/powernv: Simplify 
pnv_eeh_reset()
git bisect bad 4fad494321351f0ac412945c6a464109ad96734a
# bad: [43a5c684270ee9b5b13c91ec048831dd5b7e0cdc] powerpc/mm/radix: Make sure 
swapper pgdir is properly aligned
git bisect bad 43a5c684270ee9b5b13c91ec048831dd5b7e0cdc
# good: [a9252aaefe7e72133e7a37e0eff4e950a4f33af1] powerpc/mm: Move hugetlb and 
THP related pmd accessors to pgtable.h
git bisect good a9252aaefe7e72133e7a37e0eff4e950a4f33af1
# good: [177ba7c647f37bc3f31667192059ee794347d79d] powerpc/mm/radix: Limit paca 
allocation in radix
git bisect good 177ba7c647f37bc3f31667192059ee794347d79d
# good: [934828edfadc43be07e53429ce501741bedf4a5e] powerpc/mm: Make 4K and 64K 
use pte_t for pgtable_t
git bisect good 934828edfadc43be07e53429ce501741bedf4a5e
# bad: [a3dece6d69b0ad21b64104dff508c67a1a1f14dd] powerpc/radix: Update MMU 
cache
git bisect bad a3dece6d69b0ad21b64104dff508c67a1a1f14dd
# good: [4dfb88ca9b66690d21030ccacc1cca73db90655e] powerpc/mm: Update pte 
filter for radix
git bisect good 4dfb88ca9b66690d21030ccacc1cca73db90655e
# bad: [d6a9996e84ac4beb7713e9485f4563e100a9b03e] powerpc/mm: vmalloc 
abstraction in preparation for radix
git bisect bad d6a9996e84ac4beb7713e9485f4563e100a9b03e
commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
Author: Aneesh Kumar K.V 
Date:   Fri Apr 29 23:26:21 2016 +1000

powerpc/mm: vmalloc abstraction in preparation for radix

The vmalloc range differs between hash and radix config. Hence make
VMALLOC_START and related constants a variable which will be runtime
initialized depending on whether hash or radix mode is active.

Signed-off-by: Aneesh Kumar K.V 
[mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
Signed-off-by: Michael Ellerman 

diff --git a/arch/powerpc/include/asm/book3s/64/hash.h 
b/arch/powerpc/include/asm/book3s/64/hash.h
index cd3e915..f61cad3 100644
--- a/arch/powerpc/include/asm/book3s/64/hash

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Michael Ellerman
On Wed, 2016-06-08 at 12:58 +0200, Christian Zigotzky wrote:
> On 08 June 2016 at 04:52 AM, Michael Ellerman wrote:
> > On Tue, 2016-06-07 at 22:17 +0200, Christian Zigotzky wrote:
> > > 764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
> > > commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
> > > Author: Aneesh Kumar K.V 
> > > Date:   Fri Apr 29 23:26:09 2016 +1000
> > > 
> > >  powerpc/mm/radix: Add checks in slice code to catch radix usage
> > > 
> > >  Radix doesn't need slice support. Catch incorrect usage of slice code
> > >  when radix is enabled.
> > > 
> > >  Signed-off-by: Aneesh Kumar K.V 
> > >  Signed-off-by: Michael Ellerman 
> > > 
> > Hmm, I find that hard to believe. But maybe I'm missing something.
> > 
> > Can you checkout Linus' master and then revert that commit?
> > 
> $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> linux-git
> $ git checkout
> Your branch is up-to-date with 'origin/master'.
> 
> $ git revert 764041e0f43cc7846f6d8eb246d65b53cc06c764 -m 1
> error: Mainline was specified but commit 
> 764041e0f43cc7846f6d8eb246d65b53cc06c764 is not a merge.
> fatal: revert failed
> 
> How can I checkout Linus' master and then revert that commit?

It's not a merge, so just plain git revert:

  $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
linux-git
  $ cd linux-git
  $ git revert 764041e0f43cc7846f6d8eb246d65b53cc06c764
  [master 5dd9737a173e] Revert "powerpc/mm/radix: Add checks in slice code to 
catch radix usage"
   1 file changed, 16 deletions(-)

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-07 Thread Michael Ellerman
On Tue, 2016-06-07 at 22:17 +0200, Christian Zigotzky wrote:
> 
> 764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
> commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
> Author: Aneesh Kumar K.V 
> Date:   Fri Apr 29 23:26:09 2016 +1000
> 
>  powerpc/mm/radix: Add checks in slice code to catch radix usage
> 
>  Radix doesn't need slice support. Catch incorrect usage of slice code
>  when radix is enabled.
> 
>  Signed-off-by: Aneesh Kumar K.V 
>  Signed-off-by: Michael Ellerman 
> 

Hmm, I find that hard to believe. But maybe I'm missing something.

Can you checkout Linus' master and then revert that commit?

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-07 Thread Michael Ellerman
On Wed, 2016-06-08 at 00:14 +0200, Christian Zigotzky wrote:
> Hi All,
> 
> I replaced the file "slice.c" with the old one from kernel 4.6. It 
> compiled but unfortunately it doesn't boot.

I would expect nothing else.

You can't just replace whole files from different versions, the unit of work is
a commit, not a file.

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-06 Thread Julian Margetson

On 6/5/2016 10:00 PM, Michael Ellerman wrote:

On Sun, 2016-06-05 at 21:23 -0400, Julian Margetson wrote:

drivers/gpu/drm/drm_vm.c: In function ‘drm_dma_prot’:
drivers/gpu/drm/drm_vm.c:83:6: error: invalid operands to binary |
(have ‘pgprot_t {aka struct }’ and ‘int’)
 tmp |= _PAGE_NO_CACHE;
 ^


That is because that usage is wrong based on type. _PAGE_NO_CACHE is not
of type pgprot_t. What you really need there is

tmp = __pgprot(pgprot_val(tmp) | _PAGE_NO_CACHE);

or a better option would be

tmp = pgprot_noncached_wc(tmp);

-aneesh

tmp = pgprot_noncached_wc(tmp);

compiles but  I then run in to the following

   CC  drivers/gpu/drm/drm_scatter.o
drivers/gpu/drm/drm_scatter.c: In function ‘drm_vmalloc_dma’:
drivers/gpu/drm/drm_scatter.c:44:49: error: invalid operands to binary |
(have ‘pgprot_t {aka struct }’ and ‘int’)
return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE);
   ^
drivers/gpu/drm/drm_scatter.c:48:1: warning: control reaches end of
non-void function [-Wreturn-type]
   }
   ^

Aneesh showed you how to fix that in his reply above.

 return __vmalloc(size, GFP_KERNEL, pgprot_noncached_wc(PAGE_KERNEL));

cheers




Thanks .

With the two adjustment

tmp = pgprot_noncached_wc(tmp);

and

return __vmalloc(size, GFP_KERNEL, pgprot_noncached_wc(PAGE_KERNEL));

The rc2 builds and boots  on Sam460ex

Regards

Julian


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Michael Ellerman
On Sun, 2016-06-05 at 21:23 -0400, Julian Margetson wrote:
> > > 
> > > drivers/gpu/drm/drm_vm.c: In function ‘drm_dma_prot’:
> > > drivers/gpu/drm/drm_vm.c:83:6: error: invalid operands to binary | 
> > > (have ‘pgprot_t {aka struct }’ and ‘int’)
> > > tmp |= _PAGE_NO_CACHE;
> > > ^
> > > 
> > That is because that usage is wrong based on type. _PAGE_NO_CACHE is not
> > of type pgprot_t. What you really need there is
> > 
> > tmp = __pgprot(pgprot_val(tmp) | _PAGE_NO_CACHE);
> > 
> > or a better option would be
> > 
> > tmp = pgprot_noncached_wc(tmp);
> > 
> > -aneesh
> 
> tmp = pgprot_noncached_wc(tmp);
> 
> compiles but  I then run in to the following
> 
>   CC  drivers/gpu/drm/drm_scatter.o
> drivers/gpu/drm/drm_scatter.c: In function ‘drm_vmalloc_dma’:
> drivers/gpu/drm/drm_scatter.c:44:49: error: invalid operands to binary | 
> (have ‘pgprot_t {aka struct }’ and ‘int’)
>return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE);
>   ^
> drivers/gpu/drm/drm_scatter.c:48:1: warning: control reaches end of 
> non-void function [-Wreturn-type]
>   }
>   ^

Aneesh showed you how to fix that in his reply above.

return __vmalloc(size, GFP_KERNEL, pgprot_noncached_wc(PAGE_KERNEL));

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Julian Margetson

On 6/5/2016 8:57 PM, Michael Ellerman wrote:

On Sun, 2016-06-05 at 18:09 +0200, Christian Zigotzky wrote:


All,

I need an answer because I think Darren's guess is correct. It isn't a
problem in the pci code. I replaced the file head_64.S that Darren
mentioned with the one from the kernel 4.6 and it compiled but
unfortunately it doesn't boot. We know "head_64.S" is one file for the
early boot phase but I think there are some other files.

There's lots of files used in the early boot, you can't revert individual files
and expect it to work.


On 28 May 2016 at 8:51 PM, Darren Stevens wrote:

You can see from this that the 4.7 kernel hangs right after the booting linux
via __start(), whereas in the 4.4 there's about 29 lines of output before it
gets to the Initialised io_base_virt printk in our patch.

If the last thing you see is "booting linux via __start()" that means the kernel
crashed early, before it could detect and initialise the console.

Do you have a serial or other console in that machine at a known location? If so
you can hard-code the kernel to use that console, which means you can get
messages earlier in boot. See udbg_early_init() for starters.

cheers



Julian Margetson  writes:


Hi Christian,

I am also having a problem with _PAGE_NO_CACHE on Sam460ex.

Regards
Julian

drivers/gpu/drm/drm_vm.c: In function ‘drm_dma_prot’:
drivers/gpu/drm/drm_vm.c:83:6: error: invalid operands to binary | 
(have ‘pgprot_t {aka struct }’ and ‘int’)

tmp |= _PAGE_NO_CACHE;
^
scripts/Makefile.build:289: recipe for target 
'drivers/gpu/drm/drm_vm.o' failed

make[3]: *** [drivers/gpu/drm/drm_vm.o] Error 1
scripts/Makefile.build:440: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:440: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:985: recipe for target 'drivers' failed
make: *** [drivers] Error 2



That is because that usage is wrong based on type. _PAGE_NO_CACHE is not
of type pgprot_t. What you really need there is

tmp = __pgprot(pgprot_val(tmp) | _PAGE_NO_CACHE);

or a better option would be

tmp = pgprot_noncached_wc(tmp);

-aneesh

@Julian

What about the issues with the Sam460ex? Have you solved the problem 
with the commit powerpc-4.7-1?


Cheers,

Christian

On 04 June 2016 at 5:25 PM, Christian Zigotzky wrote:



tmp = pgprot_noncached_wc(tmp);

compiles but  I then run in to the following

 CC  drivers/gpu/drm/drm_scatter.o
drivers/gpu/drm/drm_scatter.c: In function ‘drm_vmalloc_dma’:
drivers/gpu/drm/drm_scatter.c:44:49: error: invalid operands to binary | 
(have ‘pgprot_t {aka struct }’ and ‘int’)

  return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL | _PAGE_NO_CACHE);
 ^
drivers/gpu/drm/drm_scatter.c:48:1: warning: control reaches end of 
non-void function [-Wreturn-type]

 }
 ^
scripts/Makefile.build:289: recipe for target 
'drivers/gpu/drm/drm_scatter.o' failed

make[3]: *** [drivers/gpu/drm/drm_scatter.o] Error 1
scripts/Makefile.build:440: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:440: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:985: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Regards

Julian


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Michael Ellerman
On Sun, 2016-06-05 at 18:09 +0200, Christian Zigotzky wrote:

> All,
> 
> I need an answer because I think Darren's guess is correct. It isn't a 
> problem in the pci code. I replaced the file head_64.S that Darren 
> mentioned with the one from the kernel 4.6 and it compiled but 
> unfortunately it doesn't boot. We know "head_64.S" is one file for the 
> early boot phase but I think there are some other files.

There's lots of files used in the early boot, you can't revert individual files
and expect it to work.

> On 28 May 2016 at 8:51 PM, Darren Stevens wrote:
> > You can see from this that the 4.7 kernel hangs right after the booting 
> > linux
> > via __start(), whereas in the 4.4 there's about 29 lines of output before it
> > gets to the Initialised io_base_virt printk in our patch.

If the last thing you see is "booting linux via __start()" that means the kernel
crashed early, before it could detect and initialise the console.

Do you have a serial or other console in that machine at a known location? If so
you can hard-code the kernel to use that console, which means you can get
messages earlier in boot. See udbg_early_init() for starters.

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Michael Ellerman
On Sat, 2016-06-04 at 20:16 +0530, Aneesh Kumar K.V wrote:
> Christian Zigotzky  writes:
> 
> > Hi All,
> > 
> > I compiled the latest git version of kernel 4.7 with all PowerPC 
> > commits. Maybe the latest commit powerpc-4.7-2 solved the boot issues. 
> > Our latest Nemo patch 4.7-1 works without any problems with the latest 
> > git version.
> 
> 
> instead of using powerpc-4.7-2 can you use the upstream SHA1 commit id
> ?. I am not sure how to map 4.7-2 to a kernel version.

That's my tag:

  
https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/tag/?h=powerpc-4.7-2

> > I got the following error message:
> > 
> > arch/powerpc/kernel/pci-common.c: In function 
> > ‘pci_process_bridge_OF_ranges’:
> > arch/powerpc/kernel/pci-common.c:732:59: error: ‘_PAGE_GUARDED’ 
> > undeclared (first use in this function)
> >  range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
> > ^
> > arch/powerpc/kernel/pci-common.c:732:59: note: each undeclared 
> > identifier is reported only once for each function it appears in
> > make[1]: *** [arch/powerpc/kernel/pci-common.o] Error 1
> > make: *** [arch/powerpc/kernel] Error 2
> 
> Which kernel is that ? For upstream I have at that line
> 
>  729 hose->pci_io_size = range.pci_addr + range.size;
>  730 hose->io_base_phys = range.cpu_addr - 
> range.pci_addr;
>  731 
>  732 /* Build resource */
>  733 res = &hose->io_resource;
>  734 range.cpu_addr = range.pci_addr;
>  735 break;
>  736 case IORESOURCE_MEM:

Christian is running an out-of-tree patch for the nemo board. He did post it to
the list at some point.

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Michael Ellerman
On Sat, 2016-06-04 at 17:07 +0200, Christian Zigotzky wrote:

> Aneesh,
> 
> Shall I bisect the kernel from the powerpc git?

No just use linus' tree.

> Shall I start with the following commit?
> 
> https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?id=8ffb4103f5e28d7e7890ed4774d8e009f253f56e

Yeah that would be a good one to start with.

Then mark rc1 as bad and bisect should do the rest.

cheers

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Aneesh Kumar K.V
Christian Zigotzky  writes:

> Hi All,
>
> I compiled the latest git version of kernel 4.7 with all PowerPC 
> commits. Maybe the latest commit powerpc-4.7-2 solved the boot issues. 
> Our latest Nemo patch 4.7-1 works without any problems with the latest 
> git version.


instead of using powerpc-4.7-2 can you use the upstream SHA1 commit id
?. I am not sure how to map 4.7-2 to a kernel version.

>
> I got the following error message:
>
> arch/powerpc/kernel/pci-common.c: In function 
> ‘pci_process_bridge_OF_ranges’:
> arch/powerpc/kernel/pci-common.c:732:59: error: ‘_PAGE_GUARDED’ 
> undeclared (first use in this function)
>  range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
> ^
> arch/powerpc/kernel/pci-common.c:732:59: note: each undeclared 
> identifier is reported only once for each function it appears in
> make[1]: *** [arch/powerpc/kernel/pci-common.o] Error 1
> make: *** [arch/powerpc/kernel] Error 2



Which kernel is that ? For upstream I have at that line

 729 hose->pci_io_size = range.pci_addr + range.size;
 730 hose->io_base_phys = range.cpu_addr - 
range.pci_addr;
 731 
 732 /* Build resource */
 733 res = &hose->io_resource;
 734 range.cpu_addr = range.pci_addr;
 735 break;
 736 case IORESOURCE_MEM:


-aneesh

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Aneesh Kumar K.V
Christian Zigotzky  writes:

> Aneesh,
>
> Could you please send me only your patch for the Power ISA 3.0 (Power9) 
> Radix Tree MMU? You have done the most modifications for the kernel 4.7. 
> If the kernel boots with your modifications then I have to look to the 
> other few modifications.
>
> Thanks in advance,
>

Are you looking for changes too kernel that will add ISA 3.0 MMU model
without making changes to other part of kernel ?. I don't think we ever
had a kernel patch which did the ISA 3.0 work like that. In order to add
the new ISA support we did have to make changes to other part of the
kernel.

To debug your boot issue, I still haven't understood why the suggested
changes are not working. Because for a  non cache guarded page the
mapping didn't change at all. Hence I was asking for what the expected
WIMG values are for your board.

One other option is to bisect test the kernel and if you can isolate
which patch is breaking the boot, we can possibly understand it better.
ie, instead of reverting the entire merge, try a git bisect.

-aneesh

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev