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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-22 Thread Christian Zigotzky
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.
>>
>>

diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index f61cad3..cd3e915 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -45,17 +45,17 @@
 /*
  * Define the address range of the kernel non-linear virtual area
  */
-#define H_KERN_VIRT_START ASM_CONST(0xD000)
-#define H_KERN_VIRT_SIZE	ASM_CONST(0x1000)
+#define KERN_VIRT_START ASM_CONST(0xD000)
+#define KERN_VIRT_SIZE	ASM_CONST(0x1000)
 
 /*
  * The vmalloc space starts at the beginning of that region, and
  * occupies half of it on hash CPUs and a quarter of it on Book3E
  * (we keep a quarter for the virtual memmap)
  */
-#define H_VMALLOC_START	H_KERN_VIRT_START
-#define H_VMALLOC_SIZE	(H_KERN_VIRT_SIZE >> 1)
-#define H_VMALLOC_END	(H_VMALLOC_START + H_VMALLOC_SIZE)
+#define VMALLOC_START	KERN_VIRT_START
+#define VMALLOC_SIZE	(KERN_VIRT_SIZE >> 1)
+#define VMALLOC_END	(VMALLOC_START + VMALLOC_SIZE)
 
 /*
  * Region IDs
@@ -64,7 +64,7 @@
 #define REGION_MASK		(0xfUL << REGION_SHIFT)
 #define REGION_ID(ea)		(((unsigned long)(ea)) >> REGION_SHIFT)
 
-#define VMALLOC_REGION_ID	(REGION_ID(H_VMALLOC_START))
+#define VMALLOC_REGION_ID	(REGION_ID(VMALLOC_START))
 #define KERNEL_REGION_ID	(REGION_ID(PAGE_OFFSET))
 #define VMEMMAP_REGION_ID	(0xfUL)	/* Server only */
 #define USER_REGION_ID		(0UL)
@@ -73,7 +73,7 @@
  * Defines the address of the vmemap area, in its own region on
  * hash table CPUs.
  */
-#define H_VMEMMAP_BASE		(VMEMMAP_REGION_ID << REGION_SHIFT)
+#define VMEMMAP_BASE		(VMEMMAP_REGION_ID << REGION_SHIFT)
 
 #ifdef CONFIG_PPC_MM_SLICES
 #define HAVE_ARCH_UNMAPPED_AREA
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 88a5eca..bdfea62 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -218,18 +218,6 @@ extern unsigned long __pte_frag_size_shift;
 #define PUD_MASKED_BITS		0xc0ffUL
 /* Bits to mask out from a PGD to get to the PUD page */
 #define PGD_MASKED_BITS		0xc0ffUL
-
-extern unsigned long __vmalloc_start;
-extern unsigned long __vmalloc_end;
-#define VMALLOC_START	__vmalloc_start
-#define VMALLOC_END	__vmalloc_end
-
-extern unsigned long __kernel_virt_start;
-extern unsigned long __kernel_virt_size;
-#define KERN_VIRT_START __kernel_virt_start
-#define KERN_VIRT_SIZE  __kernel_virt_size
-extern struct page *vmemmap;
-extern unsigned long ioremap_bot;
 #endif /* __ASSEMBLY__ */
 
 #include 
@@ -242,6 +230,7 @@ extern unsigned long ioremap_bot;
 #endif
 
 #include 
+
 /*
  * The second half of the kernel virtual space is used for IO mappings,
  * it's itself carved into the PIO region (ISA and PHB IO space) and
@@ -260,6 +249,8 @@ extern unsigned long ioremap_bot;
 #define IOREMAP_BASE	(PHB_IO_END)
 #define IOREMAP_END	(KERN_VIRT_START + KERN_VIRT_SIZE)
 
+#define vmmemap			((struct page *)VMEMMAP_BASE)
+
 /* Advertise special mapping type for AGP */
 #define HAVE_PAGE_AGP
 
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index 937d4e2..a8b24d6 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -31,74 +31,6 @@
 			  RADIX_PUD_INDEX_SIZE + RADIX_PGD_INDEX_SIZE + PAGE_SHIFT)
 #define RADIX_PGTABLE_RANGE (ASM_CONST(1) << RADIX_PGTABLE_EADDR_SIZE)
 
-/*
- * We support 52 bit address space, Use top bit for kernel
- * virtual mapping. Also make sure kernel fit in the top
- * quadrant.
- *
- *   +--+
- *   +--+  Kernel virtual map (0xc008)
- *   |  |
- *   |  |
- *   |  |
- * 0b11..+--+  Kernel linear map (0xc)
- *   |  |
- *   | 2 quadrant   |
- *   |  |
- * 0b10..+--+
- *   |  |
- *   |1 quadrant|
- *   |  |
- * 0b01..+--+
- *   |  |
- *   |0 quadrant   

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-13 Thread Christian Zigotzky
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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Christian Zigotzky

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_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-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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-09 Thread Christian Zigotzky
Shall I modify the workaround? Is the workaround for lack of the device 
tree the problem?


FYI: The SB600 doesn't follow normal PCIe address decoding rules, as in 
its original use as an AMD south bridge it was designed to appear as if 
it were integrated into the north bridge.


What shall I do? I don't know how long I can revert the PowerPC updates.

- Christian

On 08 June 2016 at 5:47 PM, Christian Zigotzky wrote:

Hi Aneesh,

We use it only in the file "pci-common.c".

Part of the Nemo patch with ISA_IO_BASE:

diff -rupN linux-4.7/arch/powerpc/kernel/pci-common.c 
linux-4.7-nemo/arch/powerpc/kernel/pci-common.c
--- linux-4.7/arch/powerpc/kernel/pci-common.c2016-05-20 
10:23:06.588299920 +0200
+++ linux-4.7-nemo/arch/powerpc/kernel/pci-common.c2016-05-20 
10:21:28.652296699 +0200

@@ -723,6 +723,19 @@ void pci_process_bridge_OF_ranges(struct
 isa_io_base =
 (unsigned long)hose->io_base_virt;
 #endif /* CONFIG_PPC32 */
+
+
+#ifdef CONFIG_PPC_PASEMI_SB600
+   /* Workaround for lack of device tree. New for 
kernel 3.17: range.cpu_addr instead of cpu_addr and range.size instead 
of size Ch. Zigotzky */

+   if (primary) {
+   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,
+   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;

+   hose->io_base_virt = (void *)_IO_BASE;
+   /* _IO_BASE needs unsigned long long for the kernel 
3.17 Ch. Zigotzky */
+   printk("Initialised io_base_virt 0x%lx 
_IO_BASE 0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long 
long)_IO_BASE);

+}
+#endif
+

Cheers,

Christian

On 08 June 2016 at 5:11 PM, Aneesh Kumar K.V wrote:


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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Christian Zigotzky

Hi Aneesh,

We use it only in the file "pci-common.c".

Part of the Nemo patch with ISA_IO_BASE:

diff -rupN linux-4.7/arch/powerpc/kernel/pci-common.c 
linux-4.7-nemo/arch/powerpc/kernel/pci-common.c
--- linux-4.7/arch/powerpc/kernel/pci-common.c2016-05-20 
10:23:06.588299920 +0200
+++ linux-4.7-nemo/arch/powerpc/kernel/pci-common.c2016-05-20 
10:21:28.652296699 +0200

@@ -723,6 +723,19 @@ void pci_process_bridge_OF_ranges(struct
 isa_io_base =
 (unsigned long)hose->io_base_virt;
 #endif /* CONFIG_PPC32 */
+
+
+#ifdef CONFIG_PPC_PASEMI_SB600
+   /* Workaround for lack of device tree. New for 
kernel 3.17: range.cpu_addr instead of cpu_addr and range.size instead 
of size Ch. Zigotzky */

+   if (primary) {
+   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,
+   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;

+   hose->io_base_virt = (void *)_IO_BASE;
+   /* _IO_BASE needs unsigned long long for the kernel 3.17 
Ch. Zigotzky */
+   printk("Initialised io_base_virt 0x%lx _IO_BASE 
0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long long)_IO_BASE);

+}
+#endif
+

Cheers,

Christian

On 08 June 2016 at 5:11 PM, Aneesh Kumar K.V wrote:


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 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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Christian Zigotzky

Hi All,

I tried to revert this commit but unfortunately I doesn't work:

git revert d6a9996e84ac4beb7713e9485f4563e100a9b03e

error: could not revert d6a9996... powerpc/mm: vmalloc abstraction in 
preparation for radix

hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add ' or 'git rm '
hint: and commit the result with 'git commit'


Any hints?

Thanks,

Christian

On 08 June 2016 at 1:33 PM, Darren Stevens wrote:

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 

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



___
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 

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Christian Zigotzky

Hi Darren,

Many thanks for your help. I started my bisect with the following commits:

git bisect start

git bisect good 8ffb4103f5e28d7e7890ed4774d8e009f253f56e

git bisect bad 1a695a905c18548062509178b98bc91e67510864 (Linux 4.7-rc1)

Did you start your bisect with the same bad and good commit?

I will revert your bad commit and compile a new test kernel.

Thanks,

Christian

On 08 June 2016 at 1:33 PM, Darren Stevens wrote:

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 

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



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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Christian Zigotzky

Hi Michael,

Thanks a lot for the hint. I compiled it without the commit below but 
unfortunately it doesn't boot.


Cheers,

Christian

On 08 June 2016 at 1:30 PM, Michael Ellerman wrote:


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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-08 Thread Christian Zigotzky

Hi Michael,

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?

cheers


$ 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?

Cheers,

Christian

___
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: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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-07 Thread Christian Zigotzky

Hi All,

I replaced the file "slice.c" with the old one from kernel 4.6. It 
compiled but unfortunately it doesn't boot.


Cheers,

Christian

On 07 June 2016 at 10:17 PM, Christian Zigotzky wrote:

Hi Michael,

On 06 June 2016 at 02:51 AM, Michael Ellerman wrote:

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


"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 

Cheers,

Christian


Git Log:

git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
linux-git


git bisect start

git bisect good 8ffb4103f5e28d7e7890ed4774d8e009f253f56e

git bisect bad 1a695a905c18548062509178b98bc91e67510864 (Linux 4.7-rc1)

Output:

Bisecting: 6333 revisions left to test after this (roughly 13 steps)
[4741526b83c5d3a3d661d1896f9e7414c5730bcb] mm, page_alloc: restore the 
original nodemask if the fast path allocation failed




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-05145-g4741526-dirty #1 SMP Mon Jun 6 
14:35:01 CEST 2016 ppc64 GNU/Linux)


Output:

Bisecting: 3014 revisions left to test after this (roughly 12 steps)
[2f37dd131c5d3a2eac21cd5baf80658b1b02a8ac] Merge tag 'staging-4.7-rc1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 1693 revisions left to test after this (roughly 11 steps)
[54cf809b9512be95f53ed4a5e3b631d1ac42f0fa] locking,qspinlock: Fix 
spin_is_locked() and spin_unlock_wait()




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 721 revisions left to test after this (roughly 10 steps)
[f4c80d5a16eb4b08a0d9ade154af1ebdc63f5752] Merge tag 'sound-4.7-rc1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-05931-gf4c80d5-dirty #1 SMP Mon Jun 6 
19:13:42 CEST 2016 ppc64 GNU/Linux)


Output:

Bisecting: 324 revisions left to test after this (roughly 9 steps)
[c04a5880299eab3da8c10547db96ea9cdffd44a6] Merge tag 'powerpc-4.7-1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 186 revisions left to test after this (roughly 8 steps)
[e9ad9b9bd3a3b95c89a29b2a197476e662db4233] Merge tag 'docs-for-linus' 
of git://git.lwn.net/linux




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-06141-ge9ad9b9-dirty #1 SMP Tue Jun 7 
08:32:33 CEST 2016 ppc64 GNU/Linux)


Bisecting: 93 revisions left to test after this (roughly 7 steps)
[0e5b5ba17ac33a05d9f4a48b5eb8b5e30f2274d7] cxl: Remove duplicate #defines



I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 46 revisions left to test after this (roughly 6 steps)

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-07 Thread Christian Zigotzky

Hi Michael,

On 06 June 2016 at 02:51 AM, Michael Ellerman wrote:

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


"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 

Cheers,

Christian


Git Log:

git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux-git


git bisect start

git bisect good 8ffb4103f5e28d7e7890ed4774d8e009f253f56e

git bisect bad 1a695a905c18548062509178b98bc91e67510864 (Linux 4.7-rc1)

Output:

Bisecting: 6333 revisions left to test after this (roughly 13 steps)
[4741526b83c5d3a3d661d1896f9e7414c5730bcb] mm, page_alloc: restore the 
original nodemask if the fast path allocation failed




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-05145-g4741526-dirty #1 SMP Mon Jun 6 
14:35:01 CEST 2016 ppc64 GNU/Linux)


Output:

Bisecting: 3014 revisions left to test after this (roughly 12 steps)
[2f37dd131c5d3a2eac21cd5baf80658b1b02a8ac] Merge tag 'staging-4.7-rc1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 1693 revisions left to test after this (roughly 11 steps)
[54cf809b9512be95f53ed4a5e3b631d1ac42f0fa] locking,qspinlock: Fix 
spin_is_locked() and spin_unlock_wait()




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 721 revisions left to test after this (roughly 10 steps)
[f4c80d5a16eb4b08a0d9ade154af1ebdc63f5752] Merge tag 'sound-4.7-rc1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-05931-gf4c80d5-dirty #1 SMP Mon Jun 6 
19:13:42 CEST 2016 ppc64 GNU/Linux)


Output:

Bisecting: 324 revisions left to test after this (roughly 9 steps)
[c04a5880299eab3da8c10547db96ea9cdffd44a6] Merge tag 'powerpc-4.7-1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux




I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 186 revisions left to test after this (roughly 8 steps)
[e9ad9b9bd3a3b95c89a29b2a197476e662db4233] Merge tag 'docs-for-linus' of 
git://git.lwn.net/linux




git bisect good (Linux AmigaoneX1000 
4.6.0_A-EON_AmigaONE_X1000_Nemo-06141-ge9ad9b9-dirty #1 SMP Tue Jun 7 
08:32:33 CEST 2016 ppc64 GNU/Linux)


Bisecting: 93 revisions left to test after this (roughly 7 steps)
[0e5b5ba17ac33a05d9f4a48b5eb8b5e30f2274d7] cxl: Remove duplicate #defines



I had to replace

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

with

__ioremap_at(range.cpu_addr, (void *)ISA_IO_BASE,
   range.size, 
pgprot_val(pgprot_noncached(__pgprot(0;



in the file "pci-common.c". After that it compiled but it doesn't boot 
so "git bisect bad"


Output:

Bisecting: 46 revisions left to test after this (roughly 6 steps)
[764041e0f43cc7846f6d8eb246d65b53cc06c764] powerpc/mm/radix: Add checks 
in slice code to catch radix usage




It doesn't boot. Booting Linux via __start()... didn't appear in the CFE.

git bisect 

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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Christian Zigotzky

Thanks. I'll try it.

- Christian

On 06 June 2016 at 02:51 AM, Michael Ellerman wrote:

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-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 = >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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-05 Thread Christian Zigotzky

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.


I am not a fan of reverting the PowerPC commits but there are some other 
new things in the new kernel e.g. DRM 2.45.0 which are very interesting 
for the Nemo board.


@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:

Which files are responsible for the early boot phase in the commit 
powerpc-4.7-1? Perhaps the problem is there.

- Christian

Sent from my iPhone



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

Hello Adrian

On 28/05/2016, Adrian Cox wrote:

From: Christian Zigotzky [mailto:chzigot...@xenosoft.de]
Sent: 28 May 2016 07:06
Adrian, what is the expected WIMG bit mapping for the Nemo board?


I'm not able to help much here, I'm afraid. I don't have a Nemo board at
the moment, and it's been a few years. From memory all the peripherals
required standard uncached and guarded mappings on Nemo.

Before everybody gets too involved, from what I've seen with my tests today
the kernel is crashing long before it gets to the pci-common code.

I've attached 2 boot logs, one from a 4.4 kernel I've been working on, and
from a build of the latest git.

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.

The last time we had a hang this early in the boot it turned out to be a
problem in head_64.S, I think there is something else wrong in the commit
Christian has identified

I will see if this is something I can fix, but it may need better low level
knowledge of PPC hardware than I have.

Regards
Darren



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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Christian Zigotzky
Which files are responsible for the early boot phase in the commit 
powerpc-4.7-1? Perhaps the problem is there.

- Christian

Sent from my iPhone

> On 04 Jun 2016, at 17:13, Christian Zigotzky  wrote:
> 
> Aneesh,
> 
> It's from the Nemo patch. I patch the kernel 4.7 with our Nemo patch. [1]
> 
> Cheers,
> 
> Christian
> 
> [1] http://www.xenosoft.de/nemo_4.7-1.patch
> 
>> On 04 June 2016 at 4:46 PM, Aneesh Kumar K.V wrote:
>> 
>> 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 = >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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Christian Zigotzky

Aneesh,

It's from the Nemo patch. I patch the kernel 4.7 with our Nemo patch. [1]

Cheers,

Christian

[1] http://www.xenosoft.de/nemo_4.7-1.patch

On 04 June 2016 at 4:46 PM, Aneesh Kumar K.V wrote:


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 = >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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Christian Zigotzky

Aneesh,

Shall I bisect the kernel from the powerpc git?

git clone 
https://kernel.googlesource.com/pub/scm/linux/kernel/git/powerpc/linux


https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/log/

Shall I start with the following commit?

https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?id=8ffb4103f5e28d7e7890ed4774d8e009f253f56e

Thanks,

Christian

On 04 June 2016 at 4:42 PM, Aneesh Kumar K.V wrote:


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

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 = >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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Christian Zigotzky

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,

Christian

On 04 June 2016 at 09:19 AM, Christian Zigotzky wrote:

Hi All,

The commit powerpc-4.7-2 [2] was released yesterday.

There is a conflict in my local kernel git directory if I use git pull 
because I have reverted the commit powerpc-4.7-1. [1]


The commit powerpc-4.7-2 [2] needs the commit powerpc-4.7-1. [1]

I created a new local kernel git directory for the RC2 with:

git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
linux-git-without-powerpc-commits


After that I reverted the two commits:

powerpc-4.7-2 [2]:

git revert 5306d766f15e72bc79c61d88f77e5a6b1fcc0e68 -m 1

powerpc-4.7-1 [1]:

git revert c04a5880299eab3da8c10547db96ea9cdffd44a6 -m 1

Afterwards I successfully tested our latest Nemo patch 4.7-1 [3] with 
the following commands:


cp -R linux-git-without-powerpc-commits linux-4.7

patch -p0 < nemo_4.7-1.patch

I tried to solve the boot issue last week. I modified the code a lot 
and I replaced some files. Unfortunately without any success. The RC1 
without the commit powerpc-4.7-1 [1] boots and works fantastic. I 
don't have any ideas anymore. Please help me to solve the boot problems.


Thanks in advance,

Christian

[1] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6
[2] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5306d766f15e72bc79c61d88f77e5a6b1fcc0e68

[3] http://www.xenosoft.de/nemo_4.7-1.patch

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

Hello Adrian

On 28/05/2016, Adrian Cox wrote:

From: Christian Zigotzky [mailto:chzigot...@xenosoft.de]
Sent: 28 May 2016 07:06
Adrian, what is the expected WIMG bit mapping for the Nemo board?

I'm not able to help much here, I'm afraid. I don't have a Nemo 
board at

the moment, and it's been a few years. From memory all the peripherals
required standard uncached and guarded mappings on Nemo.
Before everybody gets too involved, from what I've seen with my tests 
today

the kernel is crashing long before it gets to the pci-common code.

I've attached 2 boot logs, one from a 4.4 kernel I've been working 
on, and

from a build of the latest git.

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.

The last time we had a hang this early in the boot it turned out to be a
problem in head_64.S, I think there is something else wrong in the 
commit

Christian has identified

I will see if this is something I can fix, but it may need better low 
level

knowledge of PPC hardware than I have.

Regards
Darren


On 28 May 2016 at 6:53 PM, Adrian Cox wrote:

From: Christian Zigotzky [mailto:chzigot...@xenosoft.de]
Sent: 28 May 2016 07:06
Adrian, what is the expected WIMG bit mapping for the Nemo board?

I'm not able to help much here, I'm afraid. I don't have a Nemo board 
at the moment, and it's been a few years. From memory all the 
peripherals required standard uncached and guarded mappings on Nemo.


The difficult bit that usually breaks on kernel upgrades is not the 
WIMG settings, but the PCI probing routine.  The SB600 doesn't follow 
normal PCIe address decoding rules, as in its original use as an AMD 
south bridge it was designed to appear as if it were integrated into 
the north bridge.


--
Adrian







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

Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE

2016-06-04 Thread Christian Zigotzky

Hi All,

The commit powerpc-4.7-2 [2] was released yesterday.

There is a conflict in my local kernel git directory if I use git pull 
because I have reverted the commit powerpc-4.7-1. [1]


The commit powerpc-4.7-2 [2] needs the commit powerpc-4.7-1. [1]

I created a new local kernel git directory for the RC2 with:

git clone 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
linux-git-without-powerpc-commits


After that I reverted the two commits:

powerpc-4.7-2 [2]:

git revert 5306d766f15e72bc79c61d88f77e5a6b1fcc0e68 -m 1

powerpc-4.7-1 [1]:

git revert c04a5880299eab3da8c10547db96ea9cdffd44a6 -m 1

Afterwards I successfully tested our latest Nemo patch 4.7-1 [3] with 
the following commands:


cp -R linux-git-without-powerpc-commits linux-4.7

patch -p0 < nemo_4.7-1.patch

I tried to solve the boot issue last week. I modified the code a lot and 
I replaced some files. Unfortunately without any success. The RC1 
without the commit powerpc-4.7-1 [1] boots and works fantastic. I don't 
have any ideas anymore. Please help me to solve the boot problems.


Thanks in advance,

Christian

[1] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6
[2] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5306d766f15e72bc79c61d88f77e5a6b1fcc0e68

[3] http://www.xenosoft.de/nemo_4.7-1.patch

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

Hello Adrian

On 28/05/2016, Adrian Cox wrote:

From: Christian Zigotzky [mailto:chzigot...@xenosoft.de]
Sent: 28 May 2016 07:06
Adrian, what is the expected WIMG bit mapping for the Nemo board?


I'm not able to help much here, I'm afraid. I don't have a Nemo board at
the moment, and it's been a few years. From memory all the peripherals
required standard uncached and guarded mappings on Nemo.

Before everybody gets too involved, from what I've seen with my tests today
the kernel is crashing long before it gets to the pci-common code.

I've attached 2 boot logs, one from a 4.4 kernel I've been working on, and
from a build of the latest git.

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.

The last time we had a hang this early in the boot it turned out to be a
problem in head_64.S, I think there is something else wrong in the commit
Christian has identified

I will see if this is something I can fix, but it may need better low level
knowledge of PPC hardware than I have.

Regards
Darren


On 28 May 2016 at 6:53 PM, Adrian Cox wrote:

From: Christian Zigotzky [mailto:chzigot...@xenosoft.de]
Sent: 28 May 2016 07:06
Adrian, what is the expected WIMG bit mapping for the Nemo board?


I'm not able to help much here, I'm afraid. I don't have a Nemo board at the 
moment, and it's been a few years. From memory all the peripherals required 
standard uncached and guarded mappings on Nemo.

The difficult bit that usually breaks on kernel upgrades is not the WIMG 
settings, but the PCI probing routine.  The SB600 doesn't follow normal PCIe 
address decoding rules, as in its original use as an AMD south bridge it was 
designed to appear as if it were integrated into the north bridge.

--
Adrian




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

PAGE_GUARDED

2016-05-25 Thread Christian Zigotzky

Aneesh,

I understand what you mean. I tried

range.size, pgprot_val(pgprot_noncached(__pgprot(0;

a few days ago. It compiled but the kernel doesn't boot.

Cheers,

Christian


On 25 May 2016 at 08:58 AM, Christian Zigotzky wrote:

Aneesh,

Thank you for your help. I tried

/* Workaround for lack of device tree */
   if (primary) {
   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,

   range.size, HPTE_R_C | HPTE_R_M);
   hose->io_base_virt = (void *)_IO_BASE;
   printk("Initialised io_base_virt 0x%lx _IO_BASE 
0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long 
long)_IO_BASE);

}

Unfortunately the kernel doesn't boot.

Cheers,

Christian

On 24 May 2016 at 5:37 PM, Aneesh Kumar K.V wrote:

You can look at commit 72176dd0ad36c ("powerpc/mm: Use a helper for
finding pte bits mapping I/O area") to find similar conversion we did.

For ex:
  __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, _PAGE_NO_CACHE|_PAGE_GUARDED);

gets replaced by

  __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, pgprot_val(pgprot_noncached(__pgprot(0;

Now that gets mapped to the below hpte bits

pte bit -> _PAGE_NON_IDEMPOTENT

Which get converted in htab_convert_pte_flags(unsigned long pteflags)
to

if ((pteflags & _PAGE_CACHE_CTL ) == _PAGE_NON_IDEMPOTENT)
rflags |= (HPTE_R_I | HPTE_R_G);

BTW we default add (HPTE_R_C | HPTE_R_M ).

Hence the final pte WIMG bits will be MIG. I guess that is what you
wanted ?


If that doesn't work, can you point me the current code so that I can
look at it and suggest correct alternative.

-aneesh






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

PAGE_GUARDED

2016-05-25 Thread Christian Zigotzky

Aneesh,

Thank you for your help. I tried

/* Workaround for lack of device tree */
   if (primary) {
   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,

   range.size, HPTE_R_C | HPTE_R_M);
   hose->io_base_virt = (void *)_IO_BASE;
   printk("Initialised io_base_virt 0x%lx _IO_BASE 
0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long long)_IO_BASE);

}

Unfortunately the kernel doesn't boot.

Cheers,

Christian

On 24 May 2016 at 5:37 PM, Aneesh Kumar K.V wrote:

You can look at commit 72176dd0ad36c ("powerpc/mm: Use a helper for
finding pte bits mapping I/O area") to find similar conversion we did.

For ex:
__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, _PAGE_NO_CACHE|_PAGE_GUARDED);

gets replaced by

__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, pgprot_val(pgprot_noncached(__pgprot(0;

Now that gets mapped to the below hpte bits

pte bit -> _PAGE_NON_IDEMPOTENT

Which get converted in htab_convert_pte_flags(unsigned long pteflags)
to

if ((pteflags & _PAGE_CACHE_CTL ) == _PAGE_NON_IDEMPOTENT)
rflags |= (HPTE_R_I | HPTE_R_G);

BTW we default add (HPTE_R_C | HPTE_R_M ).

Hence the final pte WIMG bits will be MIG. I guess that is what you
wanted ?


If that doesn't work, can you point me the current code so that I can
look at it and suggest correct alternative.

-aneesh




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

Re: PAGE_GUARDED

2016-05-24 Thread Aneesh Kumar K.V
Christian Zigotzky  writes:

> Ben,
>
> I tried:
>
> /* Workaround for lack of device tree */
> if (primary) {
> __ioremap_at(range.cpu_addr, (void 
> *)ISA_IO_BASE,
> range.size, pgprot_noncached(PAGE_KERNEL));
> hose->io_base_virt = (void *)_IO_BASE;
> printk("Initialised io_base_virt 0x%lx _IO_BASE 
> 0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long long)_IO_BASE);
>  }
>
> Unfortunately I got some error messages:
>
> arch/powerpc/kernel/pci-common.c: In function 
> ‘pci_process_bridge_OF_ranges’:
> arch/powerpc/kernel/pci-common.c:731:32: error: incompatible type for 
> argument 4 of ‘__ioremap_at’
>  __ioremap_at(range.cpu_addr, (void 
> *)ISA_IO_BASE,
>  ^
> In file included from include/linux/io.h:25:0,
>   from include/linux/pci.h:31,
>   from arch/powerpc/kernel/pci-common.c:20:
> ./arch/powerpc/include/asm/io.h:746:23: note: expected ‘long unsigned 
> int’ but argument is of type ‘pgprot_t’
>   extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,
>

You can look at commit 72176dd0ad36c ("powerpc/mm: Use a helper for
finding pte bits mapping I/O area") to find similar conversion we did.

For ex:
__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, _PAGE_NO_CACHE|_PAGE_GUARDED);

gets replaced by

__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
 size, pgprot_val(pgprot_noncached(__pgprot(0;

Now that gets mapped to the below hpte bits

pte bit -> _PAGE_NON_IDEMPOTENT

Which get converted in htab_convert_pte_flags(unsigned long pteflags)
to

if ((pteflags & _PAGE_CACHE_CTL ) == _PAGE_NON_IDEMPOTENT)
rflags |= (HPTE_R_I | HPTE_R_G);

BTW we default add (HPTE_R_C | HPTE_R_M ).

Hence the final pte WIMG bits will be MIG. I guess that is what you
wanted ?


If that doesn't work, can you point me the current code so that I can
look at it and suggest correct alternative.

-aneesh

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

PAGE_GUARDED

2016-05-24 Thread Christian Zigotzky

Ben,

I tried:

/* Workaround for lack of device tree */
   if (primary) {
   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,

   range.size, pgprot_noncached(PAGE_KERNEL));
   hose->io_base_virt = (void *)_IO_BASE;
   printk("Initialised io_base_virt 0x%lx _IO_BASE 
0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long long)_IO_BASE);

}

Unfortunately I got some error messages:

arch/powerpc/kernel/pci-common.c: In function 
‘pci_process_bridge_OF_ranges’:
arch/powerpc/kernel/pci-common.c:731:32: error: incompatible type for 
argument 4 of ‘__ioremap_at’
__ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,

^
In file included from include/linux/io.h:25:0,
 from include/linux/pci.h:31,
 from arch/powerpc/kernel/pci-common.c:20:
./arch/powerpc/include/asm/io.h:746:23: note: expected ‘long unsigned 
int’ but argument is of type ‘pgprot_t’

 extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,

Cheers,

Christian


On 24 May 2016 at 1:16 PM, Benjamin Herrenschmidt wrote:

Actually, can you try pgprot_noncached(PAGE_KERNEL) ? If that works,
then I wonder what that's going on in pci_64.c ...

Cheers,
Ben.


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

Re: PAGE_GUARDED

2016-05-24 Thread Benjamin Herrenschmidt
On Tue, 2016-05-24 at 12:48 +0200, Christian Zigotzky wrote:
> Ben,
> 
> Thanks for the hint. I'm sorry I don't know how pgprot_noncached()
> works.
> 
> I tried:
> 
> 1) range.size, pgprot_noncached()
> 
> 2) range.size, pgprot_val(pgprot_noncached(__pgprot(0;

Hrm... The above is what is used elsewhere, I'm not sure what's wrong.

Aneesh, any idea ?

Michael, does it work on our PA-Semi board ? (DO we have that
southbridge on it ?)

Actually, can you try pgprot_noncached(PAGE_KERNEL) ? If that works,
then I wonder what that's going on in pci_64.c ...

Cheers,
Ben.

> 3) range.size, pgprot_val(pgprot_noncached_wc(__pgprot(0;
> 
> Unfortunately without any success.
> 
> I'd like to modify the following code for the ATi SB600 southbridge
> chipset:
> 
> /* Workaround for lack of device tree */
> if (primary) {
> __ioremap_at(range.cpu_addr, (void 
> *)ISA_IO_BASE,
> range.size,
> _PAGE_NO_CACHE|_PAGE_GUARDED);
> hose->io_base_virt = (void
> *)_IO_BASE;
> printk("Initialised io_base_virt
> 0x%lx 
> _IO_BASE 0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned
> long 
> long)_IO_BASE);
>  }
> 
> This workaround works with the kernel 4.6 final. After the commit 
> powerpc-4.7-1, the computer doesn't boot anymore.
> 
> Last message in the CFE firmware:
> 
> Booting Linux via __start()...
> 
> Cheers,
> 
> Christian
> 
> 
> On 23 May 2016 at 10:01 AM, Benjamin Herrenschmidt wrote:
> > 
> > On Mon, 2016-05-23 at 06:38 +0200, Christian Zigotzky wrote:
> > > 
> > > Hi All,
> > > 
> > > You removed PAGE_GUARDED in the commit
> > > 
> > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/c
> > > ommi
> > > t/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6
> > > 
> > > We use
> > > 
> > > range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
> > > 
> > > This doesn't work anymore. What can we use instead?
> > You should just use pgprot_noncached()
> > 
> > Cheers,
> > Ben.
> > 
> > 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

PAGE_GUARDED

2016-05-24 Thread Christian Zigotzky

Ben,

Thanks for the hint. I'm sorry I don't know how pgprot_noncached() works.

I tried:

1) range.size, pgprot_noncached()

2) range.size, pgprot_val(pgprot_noncached(__pgprot(0;

3) range.size, pgprot_val(pgprot_noncached_wc(__pgprot(0;

Unfortunately without any success.

I'd like to modify the following code for the ATi SB600 southbridge chipset:

/* Workaround for lack of device tree */
   if (primary) {
   __ioremap_at(range.cpu_addr, (void 
*)ISA_IO_BASE,

   range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
   hose->io_base_virt = (void *)_IO_BASE;
   printk("Initialised io_base_virt 0x%lx 
_IO_BASE 0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long 
long)_IO_BASE);

}

This workaround works with the kernel 4.6 final. After the commit 
powerpc-4.7-1, the computer doesn't boot anymore.


Last message in the CFE firmware:

Booting Linux via __start()...

Cheers,

Christian


On 23 May 2016 at 10:01 AM, Benjamin Herrenschmidt wrote:

On Mon, 2016-05-23 at 06:38 +0200, Christian Zigotzky wrote:

Hi All,

You removed PAGE_GUARDED in the commit

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commi
t/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6

We use

range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

This doesn't work anymore. What can we use instead?

You should just use pgprot_noncached()

Cheers,
Ben.




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

Re: PAGE_GUARDED

2016-05-23 Thread Benjamin Herrenschmidt
On Mon, 2016-05-23 at 06:38 +0200, Christian Zigotzky wrote:
> Hi All,
> 
> You removed PAGE_GUARDED in the commit  
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commi
> t/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6
> 
> We use
> 
> range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);
> 
> This doesn't work anymore. What can we use instead?

You should just use pgprot_noncached()

Cheers,
Ben.

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

PAGE_GUARDED

2016-05-23 Thread Christian Zigotzky
Hi All,

You removed PAGE_GUARDED in the commit  

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c04a5880299eab3da8c10547db96ea9cdffd44a6

We use

range.size, _PAGE_NO_CACHE|_PAGE_GUARDED);

This doesn't work anymore. What can we use instead?

Thanks in advance,

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