All of lore.kernel.org
 help / color / mirror / Atom feed
* PAGE_GUARDED
@ 2016-05-23  4:38 Christian Zigotzky
  2016-05-23  8:01 ` PAGE_GUARDED Benjamin Herrenschmidt
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-05-23  4:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: darren

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1280 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: PAGE_GUARDED
  2016-05-23  4:38 PAGE_GUARDED Christian Zigotzky
@ 2016-05-23  8:01 ` Benjamin Herrenschmidt
  2016-05-24 10:48   ` PAGE_GUARDED Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Benjamin Herrenschmidt @ 2016-05-23  8:01 UTC (permalink / raw)
  To: Christian Zigotzky, linuxppc-dev; +Cc: darren

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.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* PAGE_GUARDED
  2016-05-23  8:01 ` PAGE_GUARDED Benjamin Herrenschmidt
@ 2016-05-24 10:48   ` Christian Zigotzky
  2016-05-24 11:16     ` PAGE_GUARDED Benjamin Herrenschmidt
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-05-24 10:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev, darren

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: PAGE_GUARDED
  2016-05-24 10:48   ` PAGE_GUARDED Christian Zigotzky
@ 2016-05-24 11:16     ` Benjamin Herrenschmidt
  2016-05-24 13:37       ` PAGE_GUARDED Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Benjamin Herrenschmidt @ 2016-05-24 11:16 UTC (permalink / raw)
  To: Christian Zigotzky, linuxppc-dev, darren
  Cc: Aneesh Kumar K.V, Michael Ellerman

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* PAGE_GUARDED
  2016-05-24 11:16     ` PAGE_GUARDED Benjamin Herrenschmidt
@ 2016-05-24 13:37       ` Christian Zigotzky
  2016-05-24 15:37         ` PAGE_GUARDED Aneesh Kumar K.V
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-05-24 13:37 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev, darren
  Cc: Aneesh Kumar K.V, Michael Ellerman

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.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: PAGE_GUARDED
  2016-05-24 13:37       ` PAGE_GUARDED Christian Zigotzky
@ 2016-05-24 15:37         ` Aneesh Kumar K.V
  2016-05-25  6:58           ` PAGE_GUARDED Christian Zigotzky
  2016-06-04  7:19           ` Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE Christian Zigotzky
  0 siblings, 2 replies; 45+ messages in thread
From: Aneesh Kumar K.V @ 2016-05-24 15:37 UTC (permalink / raw)
  To: Christian Zigotzky, Benjamin Herrenschmidt, linuxppc-dev, darren
  Cc: Michael Ellerman

Christian Zigotzky <chzigotzky@xenosoft.de> writes:

> Ben,
>
> I tried:
>
> /* Workaround for lack of device tree */
>                         if (primary) {
>                                 __ioremap_at(range.cpu_addr, (void=20
> *)ISA_IO_BASE,
>                                 range.size, pgprot_noncached(PAGE_KERNEL)=
);
>                         hose->io_base_virt =3D (void *)_IO_BASE;
>                         printk("Initialised io_base_virt 0x%lx _IO_BASE=20
> 0x%llx\n", (unsigned long)hose->io_base_virt, (unsigned long long)_IO_BAS=
E);
>                      }
>
> Unfortunately I got some error messages:
>
> arch/powerpc/kernel/pci-common.c: In function=20
> =E2=80=98pci_process_bridge_OF_ranges=E2=80=99:
> arch/powerpc/kernel/pci-common.c:731:32: error: incompatible type for=20
> argument 4 of =E2=80=98__ioremap_at=E2=80=99
>                                  __ioremap_at(range.cpu_addr, (void=20
> *)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 =E2=80=98long unsi=
gned=20
> int=E2=80=99 but argument is of type =E2=80=98pgprot_t=E2=80=99
>   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 ) =3D=3D _PAGE_NON_IDEMPOTENT)
		rflags |=3D (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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* PAGE_GUARDED
  2016-05-24 15:37         ` PAGE_GUARDED Aneesh Kumar K.V
@ 2016-05-25  6:58           ` Christian Zigotzky
  2016-05-25 11:44             ` PAGE_GUARDED Christian Zigotzky
  2016-06-04  7:19           ` Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE Christian Zigotzky
  1 sibling, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-05-25  6:58 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren
  Cc: Michael Ellerman

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* PAGE_GUARDED
  2016-05-25  6:58           ` PAGE_GUARDED Christian Zigotzky
@ 2016-05-25 11:44             ` Christian Zigotzky
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-05-25 11:44 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren
  Cc: Michael Ellerman

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-05-24 15:37         ` PAGE_GUARDED Aneesh Kumar K.V
  2016-05-25  6:58           ` PAGE_GUARDED Christian Zigotzky
@ 2016-06-04  7:19           ` Christian Zigotzky
  2016-06-04  7:40             ` Christian Zigotzky
  1 sibling, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04  7:19 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04  7:19           ` Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE Christian Zigotzky
@ 2016-06-04  7:40             ` Christian Zigotzky
  2016-06-04 11:08               ` Christian Zigotzky
  2016-06-04 14:42               ` Aneesh Kumar K.V
  0 siblings, 2 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04  7:40 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04  7:40             ` Christian Zigotzky
@ 2016-06-04 11:08               ` Christian Zigotzky
  2016-06-04 14:46                 ` Aneesh Kumar K.V
  2016-06-04 14:42               ` Aneesh Kumar K.V
  1 sibling, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04 11:08 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox, R.T.Dickinson,
	R.T.Dickinson, Pat Wall, Pat Wall, contact, Matthew Leaman,
	luigi burdo, Christian Zigotzky

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.

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

I replaced

__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))));

After that it compiled.

Unfortunately it doesn't boot. :-(

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

Cheers,

Christian

On 04 June 2016 at 09:40 AM, Christian Zigotzky wrote:
> 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:chzigotzky@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:chzigotzky@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
>>>
>>
>>
>>
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04  7:40             ` Christian Zigotzky
  2016-06-04 11:08               ` Christian Zigotzky
@ 2016-06-04 14:42               ` Aneesh Kumar K.V
  2016-06-04 15:07                 ` Christian Zigotzky
  1 sibling, 1 reply; 45+ messages in thread
From: Aneesh Kumar K.V @ 2016-06-04 14:42 UTC (permalink / raw)
  To: Christian Zigotzky, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox

Christian Zigotzky <chzigotzky@xenosoft.de> 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 11:08               ` Christian Zigotzky
@ 2016-06-04 14:46                 ` Aneesh Kumar K.V
  2016-06-04 15:13                   ` Christian Zigotzky
  2016-06-06  0:54                   ` Michael Ellerman
  0 siblings, 2 replies; 45+ messages in thread
From: Aneesh Kumar K.V @ 2016-06-04 14:46 UTC (permalink / raw)
  To: Christian Zigotzky, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox, R.T.Dickinson,
	R.T.Dickinson, Pat Wall, Pat Wall, contact, Matthew Leaman,
	luigi burdo, Christian Zigotzky

Christian Zigotzky <chzigotzky@xenosoft.de> writes:

> Hi All,
>
> I compiled the latest git version of kernel 4.7 with all PowerPC=20
> commits. Maybe the latest commit powerpc-4.7-2 solved the boot issues.=20
> Our latest Nemo patch 4.7-1 works without any problems with the latest=20
> 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=20
> =E2=80=98pci_process_bridge_OF_ranges=E2=80=99:
> arch/powerpc/kernel/pci-common.c:732:59: error: =E2=80=98_PAGE_GUARDED=E2=
=80=99=20
> undeclared (first use in this function)
>                                  range.size, _PAGE_NO_CACHE|_PAGE_GUARDED=
);
>                                                             ^
> arch/powerpc/kernel/pci-common.c:732:59: note: each undeclared=20
> 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 =3D range.pci_addr + range.s=
ize;
 730                         hose->io_base_phys =3D range.cpu_addr - range.=
pci_addr;
 731=20
 732                         /* Build resource */
 733                         res =3D &hose->io_resource;
 734                         range.cpu_addr =3D range.pci_addr;
 735                         break;
 736                 case IORESOURCE_MEM:


-aneesh

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 14:42               ` Aneesh Kumar K.V
@ 2016-06-04 15:07                 ` Christian Zigotzky
  2016-06-06  0:51                   ` Michael Ellerman
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04 15:07 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 14:46                 ` Aneesh Kumar K.V
@ 2016-06-04 15:13                   ` Christian Zigotzky
  2016-06-04 15:25                     ` Christian Zigotzky
  2016-06-06  0:54                   ` Michael Ellerman
  1 sibling, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04 15:13 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox

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 = &hose->io_resource;
>   734                         range.cpu_addr = range.pci_addr;
>   735                         break;
>   736                 case IORESOURCE_MEM:
>
>
> -aneesh
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 15:13                   ` Christian Zigotzky
@ 2016-06-04 15:25                     ` Christian Zigotzky
  2016-06-05 16:09                       ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-04 15:25 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox, rtd, rtd2,
	pjwall, pjwall, matthew, intermediadc, contact, info

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 <chzigotzky@xenosoft.de> wrot=
e:
>=20
> Aneesh,
>=20
> It's from the Nemo patch. I patch the kernel 4.7 with our Nemo patch. [1]
>=20
> Cheers,
>=20
> Christian
>=20
> [1] http://www.xenosoft.de/nemo_4.7-1.patch
>=20
>> On 04 June 2016 at 4:46 PM, Aneesh Kumar K.V wrote:
>>=20
>> Which kernel is that ? For upstream I have at that line
>>=20
>>  729                         hose->pci_io_size =3D range.pci_addr + range=
.size;
>>  730                         hose->io_base_phys =3D range.cpu_addr - rang=
e.pci_addr;
>>  731
>>  732                         /* Build resource */
>>  733                         res =3D &hose->io_resource;
>>  734                         range.cpu_addr =3D range.pci_addr;
>>  735                         break;
>>  736                 case IORESOURCE_MEM:
>>=20
>>=20
>> -aneesh
>=20

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 15:25                     ` Christian Zigotzky
@ 2016-06-05 16:09                       ` Christian Zigotzky
  2016-06-06  0:57                         ` Michael Ellerman
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-05 16:09 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev, darren,
	Michael Ellerman, Julian Margetson, Adrian Cox, rtd, rtd2,
	pjwall, pjwall, matthew, intermediadc, contact, info

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 15:07                 ` Christian Zigotzky
@ 2016-06-06  0:51                   ` Michael Ellerman
  2016-06-06  5:21                     ` Christian Zigotzky
  2016-06-07 20:17                     ` Christian Zigotzky
  0 siblings, 2 replies; 45+ messages in thread
From: Michael Ellerman @ 2016-06-06  0:51 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-04 14:46                 ` Aneesh Kumar K.V
  2016-06-04 15:13                   ` Christian Zigotzky
@ 2016-06-06  0:54                   ` Michael Ellerman
  1 sibling, 0 replies; 45+ messages in thread
From: Michael Ellerman @ 2016-06-06  0:54 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Christian Zigotzky, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

On Sat, 2016-06-04 at 20:16 +0530, Aneesh Kumar K.V wrote:
> Christian Zigotzky <chzigotzky@xenosoft.de> 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-05 16:09                       ` Christian Zigotzky
@ 2016-06-06  0:57                         ` Michael Ellerman
  2016-06-06  1:23                           ` Julian Margetson
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Ellerman @ 2016-06-06  0:57 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, rtd, rtd2, pjwall, pjwall, matthew, intermediadc,
	contact, info

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-06  0:57                         ` Michael Ellerman
@ 2016-06-06  1:23                           ` Julian Margetson
  2016-06-06  2:00                             ` Michael Ellerman
  0 siblings, 1 reply; 45+ messages in thread
From: Julian Margetson @ 2016-06-06  1:23 UTC (permalink / raw)
  To: Michael Ellerman, Christian Zigotzky, Aneesh Kumar K.V,
	Benjamin Herrenschmidt, linuxppc-dev, darren, Michael Ellerman,
	Adrian Cox, rtd, rtd2, pjwall, pjwall, matthew, intermediadc,
	contact, info

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 <runaway@candw.ms> 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 <anonymous>}’ 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 <anonymous>}’ 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-06  1:23                           ` Julian Margetson
@ 2016-06-06  2:00                             ` Michael Ellerman
  2016-06-06  8:59                               ` Julian Margetson
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Ellerman @ 2016-06-06  2:00 UTC (permalink / raw)
  To: Julian Margetson, Christian Zigotzky, Aneesh Kumar K.V,
	Benjamin Herrenschmidt, linuxppc-dev, darren, Michael Ellerman,
	Adrian Cox, rtd, rtd2, pjwall, pjwall, matthew, intermediadc,
	contact, info

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 <anonymous>}’ 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 <anonymous>}’ 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-06  0:51                   ` Michael Ellerman
@ 2016-06-06  5:21                     ` Christian Zigotzky
  2016-06-07 20:17                     ` Christian Zigotzky
  1 sibling, 0 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-06  5:21 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-06  2:00                             ` Michael Ellerman
@ 2016-06-06  8:59                               ` Julian Margetson
  0 siblings, 0 replies; 45+ messages in thread
From: Julian Margetson @ 2016-06-06  8:59 UTC (permalink / raw)
  To: Michael Ellerman, Christian Zigotzky, Aneesh Kumar K.V,
	Benjamin Herrenschmidt, linuxppc-dev, darren, Michael Ellerman,
	Adrian Cox, rtd, rtd2, pjwall, pjwall, matthew, intermediadc,
	contact, info

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 <anonymous>}’ 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 <anonymous>}’ 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-06  0:51                   ` Michael Ellerman
  2016-06-06  5:21                     ` Christian Zigotzky
@ 2016-06-07 20:17                     ` Christian Zigotzky
  2016-06-07 22:14                       ` Christian Zigotzky
                                         ` (2 more replies)
  1 sibling, 3 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-07 20:17 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo

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 <aneesh.kumar@linux.vnet.ibm.com>
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 <aneesh.kumar@linux.vnet.ibm.com>
     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

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 bad

Output:

Bisecting: 22 revisions left to test after this (roughly 5 steps)
[2e8735198af0392d9032a356ee6c82686afca779] powerpc/mm: Move common pte 
bits and accessors to book3s/64/pgtable.h

----

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 and booted with 
"range.size, pgprot_val(pgprot_noncached(__pgprot(0))));". That means, 
"range.size, pgprot_val(pgprot_noncached(__pgprot(0))));" isn't the 
problem. :-)

git bisect good (Linux AmigaoneX1000 
4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00067-g2e87351-dirty #1 SMP Tue Jun 
7 15:29:19 CEST 2016 ppc64 GNU/Linux)

Output:

Bisecting: 11 revisions left to test after this (roughly 4 steps)
[2bfd65e45e877fb5704730244da67c748d28a1b8] powerpc/mm/radix: Add radix 
callbacks for early init routines

----

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 and it also booted 
with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!

git bisect good (Linux AmigaoneX1000 
4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00078-g2bfd65e-dirty #1 SMP Tue Jun 
7 16:50:47 CEST 2016 ppc64 GNU/Linux)

Output:

Bisecting: 5 revisions left to test after this (roughly 3 steps)
[676012a66f651a98808459bc8ab75661828ed96f] powerpc/mm: Hash abstraction 
for tlbflush routines

----

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 and it also booted 
with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!

git bisect good (Linux AmigaoneX1000 
4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00084-g676012a-dirty #1 SMP Tue Jun 
7 19:03:59 CEST 2016 ppc64 GNU/Linux)

Output:

Bisecting: 2 revisions left to test after this (roughly 2 steps)
[a8ed87c92adf1fd45142323e04f15b522117d575] powerpc/mm/radix: Add 
MMU_FTR_RADIX

----

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 and it also booted 
with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!

git bisect good (Linux AmigaoneX1000 
4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00087-ga8ed87c-dirty #1 SMP Tue Jun 
7 20:25:11 CEST 2016 ppc64 GNU/Linux)

Output:

Bisecting: 0 revisions left to test after this (roughly 1 step)
[d8c476eeb697c9aac46b390e9cbd7af7032814f1] powerpc/mm/radix: Isolate 
hash table function from pseries guest code

----

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 and it also booted 
with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!

git bisect good (Linux AmigaoneX1000 
4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00089-gd8c476e-dirty #1 SMP Tue Jun 
7 21:53:24 CEST 2016 ppc64 GNU/Linux)

Output:

764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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 <aneesh.kumar@linux.vnet.ibm.com>
     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

:040000 040000 e66f81f989a42a4de238a49a2191f787ae65d4a2 
6b7b4380d14db00d9aae28b5990e5dd8d6cf23a0 M    arch

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-07 20:17                     ` Christian Zigotzky
@ 2016-06-07 22:14                       ` Christian Zigotzky
  2016-06-08  1:51                         ` Michael Ellerman
  2016-06-08  2:52                       ` Michael Ellerman
  2016-06-08 11:33                       ` Darren Stevens
  2 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-07 22:14 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, 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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> 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 bad
>
> Output:
>
> Bisecting: 22 revisions left to test after this (roughly 5 steps)
> [2e8735198af0392d9032a356ee6c82686afca779] powerpc/mm: Move common pte 
> bits and accessors to book3s/64/pgtable.h
>
> ----
>
> 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 and booted with 
> "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));". That means, 
> "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));" isn't the 
> problem. :-)
>
> git bisect good (Linux AmigaoneX1000 
> 4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00067-g2e87351-dirty #1 SMP Tue 
> Jun 7 15:29:19 CEST 2016 ppc64 GNU/Linux)
>
> Output:
>
> Bisecting: 11 revisions left to test after this (roughly 4 steps)
> [2bfd65e45e877fb5704730244da67c748d28a1b8] powerpc/mm/radix: Add radix 
> callbacks for early init routines
>
> ----
>
> 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 and it also booted 
> with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!
>
> git bisect good (Linux AmigaoneX1000 
> 4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00078-g2bfd65e-dirty #1 SMP Tue 
> Jun 7 16:50:47 CEST 2016 ppc64 GNU/Linux)
>
> Output:
>
> Bisecting: 5 revisions left to test after this (roughly 3 steps)
> [676012a66f651a98808459bc8ab75661828ed96f] powerpc/mm: Hash 
> abstraction for tlbflush routines
>
> ----
>
> 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 and it also booted 
> with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!
>
> git bisect good (Linux AmigaoneX1000 
> 4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00084-g676012a-dirty #1 SMP Tue 
> Jun 7 19:03:59 CEST 2016 ppc64 GNU/Linux)
>
> Output:
>
> Bisecting: 2 revisions left to test after this (roughly 2 steps)
> [a8ed87c92adf1fd45142323e04f15b522117d575] powerpc/mm/radix: Add 
> MMU_FTR_RADIX
>
> ----
>
> 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 and it also booted 
> with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!
>
> git bisect good (Linux AmigaoneX1000 
> 4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00087-ga8ed87c-dirty #1 SMP Tue 
> Jun 7 20:25:11 CEST 2016 ppc64 GNU/Linux)
>
> Output:
>
> Bisecting: 0 revisions left to test after this (roughly 1 step)
> [d8c476eeb697c9aac46b390e9cbd7af7032814f1] powerpc/mm/radix: Isolate 
> hash table function from pseries guest code
>
> ----
>
> 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 and it also booted 
> with "range.size, pgprot_val(pgprot_noncached(__pgprot(0))));"!
>
> git bisect good (Linux AmigaoneX1000 
> 4.6.0-rc3_A-EON_AmigaONE_X1000_Nemo-00089-gd8c476e-dirty #1 SMP Tue 
> Jun 7 21:53:24 CEST 2016 ppc64 GNU/Linux)
>
> Output:
>
> 764041e0f43cc7846f6d8eb246d65b53cc06c764 is the first bad commit
> commit 764041e0f43cc7846f6d8eb246d65b53cc06c764
> Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> :040000 040000 e66f81f989a42a4de238a49a2191f787ae65d4a2 
> 6b7b4380d14db00d9aae28b5990e5dd8d6cf23a0 M    arch
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-07 22:14                       ` Christian Zigotzky
@ 2016-06-08  1:51                         ` Michael Ellerman
  0 siblings, 0 replies; 45+ messages in thread
From: Michael Ellerman @ 2016-06-08  1:51 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-07 20:17                     ` Christian Zigotzky
  2016-06-07 22:14                       ` Christian Zigotzky
@ 2016-06-08  2:52                       ` Michael Ellerman
  2016-06-08 10:58                         ` Christian Zigotzky
  2016-06-08 11:33                       ` Darren Stevens
  2 siblings, 1 reply; 45+ messages in thread
From: Michael Ellerman @ 2016-06-08  2:52 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo

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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>      Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 

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

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

cheers

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08  2:52                       ` Michael Ellerman
@ 2016-06-08 10:58                         ` Christian Zigotzky
  2016-06-08 11:30                           ` Michael Ellerman
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-08 10:58 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]

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<aneesh.kumar@linux.vnet.ibm.com>
>> 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<aneesh.kumar@linux.vnet.ibm.com>
>>       Signed-off-by: Michael Ellerman<mpe@ellerman.id.au>
>>
> 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


[-- Attachment #2: Type: text/html, Size: 2040 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 10:58                         ` Christian Zigotzky
@ 2016-06-08 11:30                           ` Michael Ellerman
  2016-06-08 12:50                             ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Ellerman @ 2016-06-08 11:30 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

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 <aneesh.kumar@linux.vnet.ibm.com>
> > > 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 <aneesh.kumar@linux.vnet.ibm.com>
> > >      Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> > > 
> > 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-07 20:17                     ` Christian Zigotzky
  2016-06-07 22:14                       ` Christian Zigotzky
  2016-06-08  2:52                       ` Michael Ellerman
@ 2016-06-08 11:33                       ` Darren Stevens
  2016-06-08 13:24                         ` Christian Zigotzky
                                           ` (3 more replies)
  2 siblings, 4 replies; 45+ messages in thread
From: Darren Stevens @ 2016-06-08 11:33 UTC (permalink / raw)
  To: Christian Zigotzky
  Cc: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, Michael Ellerman, Julian Margetson, Adrian Cox,
	R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall, contact,
	Matthew Leaman, luigi burdo

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

  AmigaOS...........: http://yam.ch/
  Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/

General information about MIME can be found at:
http://en.wikipedia.org/wiki/MIME

[-- Attachment #2: Type: text/plain, Size: 1694 bytes --]

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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>      Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>

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 <aneesh.kumar@linux.vnet.ibm.com>
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 <aneesh.kumar@linux.vnet.ibm.com>
    [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

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

[-- Attachment #3: git.bisectlog.txt --]
[-- Type: text/plain, Size: 2744 bytes --]

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

[-- Attachment #4: HEAD.txt --]
[-- Type: text/plain, Size: 10182 bytes --]

commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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 <aneesh.kumar@linux.vnet.ibm.com>
    [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

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.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 KERN_VIRT_START ASM_CONST(0xD000000000000000)
-#define KERN_VIRT_SIZE	ASM_CONST(0x0000100000000000)
+#define H_KERN_VIRT_START ASM_CONST(0xD000000000000000)
+#define H_KERN_VIRT_SIZE	ASM_CONST(0x0000100000000000)
 
 /*
  * 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 VMALLOC_START	KERN_VIRT_START
-#define VMALLOC_SIZE	(KERN_VIRT_SIZE >> 1)
-#define VMALLOC_END	(VMALLOC_START + VMALLOC_SIZE)
+#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)
 
 /*
  * 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(VMALLOC_START))
+#define VMALLOC_REGION_ID	(REGION_ID(H_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 VMEMMAP_BASE		(VMEMMAP_REGION_ID << REGION_SHIFT)
+#define H_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 32a9756..f5628f9 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -208,6 +208,18 @@ extern unsigned long __pgd_val_bits;
 #define PUD_MASKED_BITS		0xc0000000000000ffUL
 /* Bits to mask out from a PGD to get to the PUD page */
 #define PGD_MASKED_BITS		0xc0000000000000ffUL
+
+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 <asm/book3s/64/hash.h>
@@ -220,7 +232,6 @@ extern unsigned long __pgd_val_bits;
 #endif
 
 #include <asm/barrier.h>
-
 /*
  * 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
@@ -239,8 +250,6 @@ extern unsigned long __pgd_val_bits;
 #define IOREMAP_BASE	(PHB_IO_END)
 #define IOREMAP_END	(KERN_VIRT_START + KERN_VIRT_SIZE)
 
-#define vmemmap			((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 63eb629..f470902 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -31,6 +31,74 @@
 			      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 (0xc008000000000000)
+ *           |                  |
+ *           |                  |
+ *           |                  |
+ * 0b11......+------------------+  Kernel linear map (0xc....)
+ *           |                  |
+ *           |     2 quadrant   |
+ *           |                  |
+ * 0b10......+------------------+
+ *           |                  |
+ *           |    1 quadrant    |
+ *           |                  |
+ * 0b01......+------------------+
+ *           |                  |
+ *           |    0 quadrant    |
+ *           |                  |
+ * 0b00......+------------------+
+ *
+ *
+ * 3rd quadrant expanded:
+ * +------------------------------+
+ * |                              |
+ * |                              |
+ * |                              |
+ * +------------------------------+  Kernel IO map end (0xc010000000000000)
+ * |                              |
+ * |                              |
+ * |      1/2 of virtual map      |
+ * |                              |
+ * |                              |
+ * +------------------------------+  Kernel IO map start
+ * |                              |
+ * |      1/4 of virtual map      |
+ * |                              |
+ * +------------------------------+  Kernel vmemap start
+ * |                              |
+ * |     1/4 of virtual map       |
+ * |                              |
+ * +------------------------------+  Kernel virt start (0xc008000000000000)
+ * |                              |
+ * |                              |
+ * |                              |
+ * +------------------------------+  Kernel linear (0xc.....)
+ */
+
+#define RADIX_KERN_VIRT_START ASM_CONST(0xc008000000000000)
+#define RADIX_KERN_VIRT_SIZE  ASM_CONST(0x0008000000000000)
+
+/*
+ * The vmalloc space starts at the beginning of that region, and
+ * occupies a quarter of it on radix config.
+ * (we keep a quarter for the virtual memmap)
+ */
+#define RADIX_VMALLOC_START	RADIX_KERN_VIRT_START
+#define RADIX_VMALLOC_SIZE	(RADIX_KERN_VIRT_SIZE >> 2)
+#define RADIX_VMALLOC_END	(RADIX_VMALLOC_START + RADIX_VMALLOC_SIZE)
+/*
+ * Defines the address of the vmemap area, in its own region on
+ * hash table CPUs.
+ */
+#define RADIX_VMEMMAP_BASE		(RADIX_VMALLOC_END)
+
 #ifndef __ASSEMBLY__
 #define RADIX_PTE_TABLE_SIZE	(sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
 #define RADIX_PMD_TABLE_SIZE	(sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 41503d7..3759df5 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -38,7 +38,7 @@
  * ISA drivers use hard coded offsets.  If no ISA bus exists nothing
  * is mapped on the first 64K of IO space
  */
-unsigned long pci_io_base = ISA_IO_BASE;
+unsigned long pci_io_base;
 EXPORT_SYMBOL(pci_io_base);
 
 static int __init pcibios_init(void)
@@ -47,6 +47,7 @@ static int __init pcibios_init(void)
 
 	printk(KERN_INFO "PCI: Probing PCI hardware\n");
 
+	pci_io_base = ISA_IO_BASE;
 	/* For now, override phys_mem_access_prot. If we need it,g
 	 * later, we may move that initialization to each ppc_md
 	 */
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 64165a7..68aee43 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -889,6 +889,14 @@ void __init hash__early_init_mmu(void)
 	__pmd_val_bits = 0;
 	__pud_val_bits = 0;
 	__pgd_val_bits = 0;
+
+	__kernel_virt_start = H_KERN_VIRT_START;
+	__kernel_virt_size = H_KERN_VIRT_SIZE;
+	__vmalloc_start = H_VMALLOC_START;
+	__vmalloc_end = H_VMALLOC_END;
+	vmemmap = (struct page *)H_VMEMMAP_BASE;
+	ioremap_bot = IOREMAP_BASE;
+
 	/* Initialize the MMU Hash table and create the linear mapping
 	 * of memory. Has to be done before SLB initialization as this is
 	 * currently where the page size encoding is obtained.
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 6182b6c..13afacd 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -328,6 +328,13 @@ void __init radix__early_init_mmu(void)
 	__pud_val_bits = RADIX_PUD_VAL_BITS;
 	__pgd_val_bits = RADIX_PGD_VAL_BITS;
 
+	__kernel_virt_start = RADIX_KERN_VIRT_START;
+	__kernel_virt_size = RADIX_KERN_VIRT_SIZE;
+	__vmalloc_start = RADIX_VMALLOC_START;
+	__vmalloc_end = RADIX_VMALLOC_END;
+	vmemmap = (struct page *)RADIX_VMEMMAP_BASE;
+	ioremap_bot = IOREMAP_BASE;
+
 	radix_init_page_sizes();
 	if (!firmware_has_feature(FW_FEATURE_LPAR))
 		radix_init_partition_table();
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index b8c75e6..216e2bd 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -97,9 +97,20 @@ unsigned long __pud_val_bits;
 EXPORT_SYMBOL(__pud_val_bits);
 unsigned long __pgd_val_bits;
 EXPORT_SYMBOL(__pgd_val_bits);
-
-#endif
+unsigned long __kernel_virt_start;
+EXPORT_SYMBOL(__kernel_virt_start);
+unsigned long __kernel_virt_size;
+EXPORT_SYMBOL(__kernel_virt_size);
+unsigned long __vmalloc_start;
+EXPORT_SYMBOL(__vmalloc_start);
+unsigned long __vmalloc_end;
+EXPORT_SYMBOL(__vmalloc_end);
+struct page *vmemmap;
+EXPORT_SYMBOL(vmemmap);
+unsigned long ioremap_bot;
+#else /* !CONFIG_PPC_BOOK3S_64 */
 unsigned long ioremap_bot = IOREMAP_BASE;
+#endif
 
 /**
  * __ioremap_at - Low level function to establish the page tables
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index 15b8f71..dfdb90c 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -91,7 +91,7 @@ slb_miss_kernel_load_vmemmap:
 	 * can be demoted from 64K -> 4K dynamically on some machines
 	 */
 	clrldi	r11,r10,48
-	cmpldi	r11,(VMALLOC_SIZE >> 28) - 1
+	cmpldi	r11,(H_VMALLOC_SIZE >> 28) - 1
 	bgt	5f
 	lhz	r11,PACAVMALLOCSLLP(r13)
 	b	6f

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 11:30                           ` Michael Ellerman
@ 2016-06-08 12:50                             ` Christian Zigotzky
  0 siblings, 0 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-08 12:50 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Benjamin Herrenschmidt,
	linuxppc-dev, darren, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, 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
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 11:33                       ` Darren Stevens
@ 2016-06-08 13:24                         ` Christian Zigotzky
  2016-06-08 13:51                         ` Christian Zigotzky
                                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-08 13:24 UTC (permalink / raw)
  To: Darren Stevens, Michael Ellerman, Aneesh Kumar K.V,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo

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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>      [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
>      Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 11:33                       ` Darren Stevens
  2016-06-08 13:24                         ` Christian Zigotzky
@ 2016-06-08 13:51                         ` Christian Zigotzky
  2016-06-08 13:52                         ` Michael Ellerman
  2016-06-08 15:11                         ` Aneesh Kumar K.V
  3 siblings, 0 replies; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-08 13:51 UTC (permalink / raw)
  To: Darren Stevens, Michael Ellerman, Aneesh Kumar K.V,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	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 <paths>' or 'git rm <paths>'
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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>      [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
>      Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 11:33                       ` Darren Stevens
  2016-06-08 13:24                         ` Christian Zigotzky
  2016-06-08 13:51                         ` Christian Zigotzky
@ 2016-06-08 13:52                         ` Michael Ellerman
  2016-06-08 15:11                         ` Aneesh Kumar K.V
  3 siblings, 0 replies; 45+ messages in thread
From: Michael Ellerman @ 2016-06-08 13:52 UTC (permalink / raw)
  To: Darren Stevens, Christian Zigotzky
  Cc: Aneesh Kumar K.V, Benjamin Herrenschmidt, linuxppc-dev,
	Michael Ellerman, Julian Margetson, Adrian Cox, R.T.Dickinson,
	R.T.Dickinson, Pat Wall, Pat Wall, contact, Matthew Leaman,
	luigi burdo

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 <aneesh.kumar@linux.vnet.ibm.com>
> > 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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>     [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
>     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> 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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 11:33                       ` Darren Stevens
                                           ` (2 preceding siblings ...)
  2016-06-08 13:52                         ` Michael Ellerman
@ 2016-06-08 15:11                         ` Aneesh Kumar K.V
  2016-06-08 15:47                           ` Christian Zigotzky
  3 siblings, 1 reply; 45+ messages in thread
From: Aneesh Kumar K.V @ 2016-06-08 15:11 UTC (permalink / raw)
  To: Darren Stevens, Christian Zigotzky
  Cc: Michael Ellerman, Benjamin Herrenschmidt, linuxppc-dev,
	Michael Ellerman, Julian Margetson, Adrian Cox, R.T.Dickinson,
	R.T.Dickinson, Pat Wall, Pat Wall, contact, Matthew Leaman,
	luigi burdo

Darren Stevens <darren@stevens-zone.net> 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 <aneesh.kumar@linux.vnet.ibm.com>
> 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 <aneesh.kumar@linux.vnet.ibm.com>
>     [mpe: Fix missing init of ioremap_bot in pgtable_64.c for ppc64e]
>     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>

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

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 15:11                         ` Aneesh Kumar K.V
@ 2016-06-08 15:47                           ` Christian Zigotzky
  2016-06-09  8:48                             ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-08 15:47 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Darren Stevens, Michael Ellerman,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo

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.c    2016-05-20 
10:23:06.588299920 +0200
+++ linux-4.7-nemo/arch/powerpc/kernel/pci-common.c    2016-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
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-08 15:47                           ` Christian Zigotzky
@ 2016-06-09  8:48                             ` Christian Zigotzky
  2016-06-09 11:15                               ` Michael Ellerman
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-09  8:48 UTC (permalink / raw)
  To: Aneesh Kumar K.V, Darren Stevens, Michael Ellerman,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	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.c    2016-05-20 
> 10:23:06.588299920 +0200
> +++ linux-4.7-nemo/arch/powerpc/kernel/pci-common.c    2016-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
>>
>>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-09  8:48                             ` Christian Zigotzky
@ 2016-06-09 11:15                               ` Michael Ellerman
  2016-06-09 13:13                                 ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Michael Ellerman @ 2016-06-09 11:15 UTC (permalink / raw)
  To: Christian Zigotzky, Aneesh Kumar K.V, Darren Stevens,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	Christian Zigotzky

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	0x80000000ul
 #define  ISA_IO_BASE	(KERN_IO_START)
 #define  ISA_IO_END	(KERN_IO_START + 0x10000ul)


cheers

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-09 11:15                               ` Michael Ellerman
@ 2016-06-09 13:13                                 ` Christian Zigotzky
  2016-06-13  8:14                                   ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-09 13:13 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Darren Stevens,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	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	0x80000000ul
>   #define  ISA_IO_BASE	(KERN_IO_START)
>   #define  ISA_IO_END	(KERN_IO_START + 0x10000ul)
>
>
> cheers
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-09 13:13                                 ` Christian Zigotzky
@ 2016-06-13  8:14                                   ` Christian Zigotzky
  2016-06-13  8:19                                     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-13  8:14 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V, Darren Stevens,
	Benjamin Herrenschmidt, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	Christian Zigotzky

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

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 <chzigotzky@xenosoft.de> 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_SIZE    0x80000000ul
>>  #define  ISA_IO_BASE    (KERN_IO_START)
>>  #define  ISA_IO_END    (KERN_IO_START + 0x10000ul)
>> 
>> 
>> cheers
> 

[-- Attachment #2: Type: text/html, Size: 4554 bytes --]

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Re: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-13  8:14                                   ` Christian Zigotzky
@ 2016-06-13  8:19                                     ` Benjamin Herrenschmidt
  2016-06-13 18:09                                       ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Benjamin Herrenschmidt @ 2016-06-13  8:19 UTC (permalink / raw)
  To: Christian Zigotzky, Michael Ellerman, Aneesh Kumar K.V,
	Darren Stevens, linuxppc-dev, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

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.

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-13  8:19                                     ` Benjamin Herrenschmidt
@ 2016-06-13 18:09                                       ` Christian Zigotzky
  2016-06-22 19:07                                         ` Christian Zigotzky
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-13 18:09 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Michael Ellerman, Aneesh Kumar K.V,
	Darren Stevens, linuxppc-dev, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, 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.
>
>

^ permalink raw reply	[flat|nested] 45+ messages in thread

* Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-13 18:09                                       ` Christian Zigotzky
@ 2016-06-22 19:07                                         ` Christian Zigotzky
  2016-06-22 19:58                                           ` luigi burdo
  0 siblings, 1 reply; 45+ messages in thread
From: Christian Zigotzky @ 2016-06-22 19:07 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Michael Ellerman, Aneesh Kumar K.V,
	Darren Stevens, linuxppc-dev, Michael Ellerman, Julian Margetson,
	Adrian Cox, R.T.Dickinson, R.T.Dickinson, Pat Wall, Pat Wall,
	contact, Matthew Leaman, luigi burdo, Christian Zigotzky

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

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


[-- Attachment #2: nemo_4.7.0rc3.patch --]
[-- Type: text/x-patch, Size: 9673 bytes --]

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(0xD000000000000000)
-#define H_KERN_VIRT_SIZE	ASM_CONST(0x0000100000000000)
+#define KERN_VIRT_START ASM_CONST(0xD000000000000000)
+#define KERN_VIRT_SIZE	ASM_CONST(0x0000100000000000)
 
 /*
  * 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		0xc0000000000000ffUL
 /* Bits to mask out from a PGD to get to the PUD page */
 #define PGD_MASKED_BITS		0xc0000000000000ffUL
-
-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 <asm/book3s/64/hash.h>
@@ -242,6 +230,7 @@ extern unsigned long ioremap_bot;
 #endif
 
 #include <asm/barrier.h>
+
 /*
  * 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 (0xc008000000000000)
- *           |                  |
- *           |                  |
- *           |                  |
- * 0b11......+------------------+  Kernel linear map (0xc....)
- *           |                  |
- *           |     2 quadrant   |
- *           |                  |
- * 0b10......+------------------+
- *           |                  |
- *           |    1 quadrant    |
- *           |                  |
- * 0b01......+------------------+
- *           |                  |
- *           |    0 quadrant    |
- *           |                  |
- * 0b00......+------------------+
- *
- *
- * 3rd quadrant expanded:
- * +------------------------------+
- * |                              |
- * |                              |
- * |                              |
- * +------------------------------+  Kernel IO map end (0xc010000000000000)
- * |                              |
- * |                              |
- * |      1/2 of virtual map      |
- * |                              |
- * |                              |
- * +------------------------------+  Kernel IO map start
- * |                              |
- * |      1/4 of virtual map      |
- * |                              |
- * +------------------------------+  Kernel vmemap start
- * |                              |
- * |     1/4 of virtual map       |
- * |                              |
- * +------------------------------+  Kernel virt start (0xc008000000000000)
- * |                              |
- * |                              |
- * |                              |
- * +------------------------------+  Kernel linear (0xc.....)
- */
-
-#define RADIX_KERN_VIRT_START ASM_CONST(0xc008000000000000)
-#define RADIX_KERN_VIRT_SIZE  ASM_CONST(0x0008000000000000)
-
-/*
- * The vmalloc space starts at the beginning of that region, and
- * occupies a quarter of it on radix config.
- * (we keep a quarter for the virtual memmap)
- */
-#define RADIX_VMALLOC_START	RADIX_KERN_VIRT_START
-#define RADIX_VMALLOC_SIZE	(RADIX_KERN_VIRT_SIZE >> 2)
-#define RADIX_VMALLOC_END	(RADIX_VMALLOC_START + RADIX_VMALLOC_SIZE)
-/*
- * Defines the address of the vmemap area, in its own region on
- * hash table CPUs.
- */
-#define RADIX_VMEMMAP_BASE		(RADIX_VMALLOC_END)
-
 #ifndef __ASSEMBLY__
 #define RADIX_PTE_TABLE_SIZE	(sizeof(pte_t) << RADIX_PTE_INDEX_SIZE)
 #define RADIX_PMD_TABLE_SIZE	(sizeof(pmd_t) << RADIX_PMD_INDEX_SIZE)
 
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 3759df5..41503d7 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -38,7 +38,7 @@
  * ISA drivers use hard coded offsets.  If no ISA bus exists nothing
  * is mapped on the first 64K of IO space
  */
-unsigned long pci_io_base;
+unsigned long pci_io_base = ISA_IO_BASE;
 EXPORT_SYMBOL(pci_io_base);
 
 static int __init pcibios_init(void)
@@ -47,7 +47,6 @@ static int __init pcibios_init(void)
 
 	printk(KERN_INFO "PCI: Probing PCI hardware\n");
 
-	pci_io_base = ISA_IO_BASE;
 	/* For now, override phys_mem_access_prot. If we need it,g
 	 * later, we may move that initialization to each ppc_md
 	 */

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index b2740c6..bfbb3c8 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -910,14 +910,6 @@ void __init hash__early_init_mmu(void)
 	__pmd_val_bits = 0;
 	__pud_val_bits = 0;
 	__pgd_val_bits = 0;
-
-	__kernel_virt_start = H_KERN_VIRT_START;
-	__kernel_virt_size = H_KERN_VIRT_SIZE;
-	__vmalloc_start = H_VMALLOC_START;
-	__vmalloc_end = H_VMALLOC_END;
-	vmemmap = (struct page *)H_VMEMMAP_BASE;
-	ioremap_bot = IOREMAP_BASE;
-
 	/* Initialize the MMU Hash table and create the linear mapping
 	 * of memory. Has to be done before SLB initialization as this is
 	 * currently where the page size encoding is obtained.
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index c939e6e..9c5de01f 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -325,12 +325,6 @@ void __init radix__early_init_mmu(void)
 	__pud_val_bits = RADIX_PUD_VAL_BITS;
 	__pgd_val_bits = RADIX_PGD_VAL_BITS;
 
-	__kernel_virt_start = RADIX_KERN_VIRT_START;
-	__kernel_virt_size = RADIX_KERN_VIRT_SIZE;
-	__vmalloc_start = RADIX_VMALLOC_START;
-	__vmalloc_end = RADIX_VMALLOC_END;
-	vmemmap = (struct page *)RADIX_VMEMMAP_BASE;
-	ioremap_bot = IOREMAP_BASE;
 	/*
 	 * For now radix also use the same frag size
 	 */
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index e009e06..1408776 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -94,24 +94,12 @@ unsigned long __pud_val_bits;
 EXPORT_SYMBOL(__pud_val_bits);
 unsigned long __pgd_val_bits;
 EXPORT_SYMBOL(__pgd_val_bits);
-unsigned long __kernel_virt_start;
-EXPORT_SYMBOL(__kernel_virt_start);
-unsigned long __kernel_virt_size;
-EXPORT_SYMBOL(__kernel_virt_size);
-unsigned long __vmalloc_start;
-EXPORT_SYMBOL(__vmalloc_start);
-unsigned long __vmalloc_end;
-EXPORT_SYMBOL(__vmalloc_end);
-struct page *vmemmap;
-EXPORT_SYMBOL(vmemmap);
 unsigned long __pte_frag_nr;
 EXPORT_SYMBOL(__pte_frag_nr);
 unsigned long __pte_frag_size_shift;
 EXPORT_SYMBOL(__pte_frag_size_shift);
-unsigned long ioremap_bot;
-#else /* !CONFIG_PPC_BOOK3S_64 */
+#endif /* !CONFIG_PPC_BOOK3S_64 */
 unsigned long ioremap_bot = IOREMAP_BASE;
-#endif
 
 /**
  * __ioremap_at - Low level function to establish the page tables
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index dfdb90c..15b8f71 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -91,7 +91,7 @@ slb_miss_kernel_load_vmemmap:
 	 * can be demoted from 64K -> 4K dynamically on some machines
 	 */
 	clrldi	r11,r10,48
-	cmpldi	r11,(H_VMALLOC_SIZE >> 28) - 1
+	cmpldi	r11,(VMALLOC_SIZE >> 28) - 1
 	bgt	5f
 	lhz	r11,PACAVMALLOCSLLP(r13)
 	b	6f

^ permalink raw reply related	[flat|nested] 45+ messages in thread

* RE: Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE
  2016-06-22 19:07                                         ` Christian Zigotzky
@ 2016-06-22 19:58                                           ` luigi burdo
  0 siblings, 0 replies; 45+ messages in thread
From: luigi burdo @ 2016-06-22 19:58 UTC (permalink / raw)
  To: Christian Zigotzky, Benjamin Herrenschmidt, Michael Ellerman,
	Aneesh Kumar K.V, Darren Stevens, linuxppc-dev, Michael Ellerman,
	Julian Margetson, Adrian Cox, R.T.Dickinson, R.T.Dickinson,
	Pat Wall, Pat Wall, contact, Matthew Leaman, luigi burdo,
	Christian Zigotzky

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 [chzigotzky@xenosoft.de]
Inviato: mercoled=EC 22 giugno 2016 21.07
A: Benjamin Herrenschmidt; Michael Ellerman; Aneesh Kumar K.V; Darren Steve=
ns; linuxppc-dev@lists.ozlabs.org; Michael Ellerman; Julian Margetson; Adri=
an Cox; R.T.Dickinson; R.T.Dickinson; Pat Wall; Pat Wall; contact@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.
>>
>>

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2016-06-22 20:03 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23  4:38 PAGE_GUARDED Christian Zigotzky
2016-05-23  8:01 ` PAGE_GUARDED Benjamin Herrenschmidt
2016-05-24 10:48   ` PAGE_GUARDED Christian Zigotzky
2016-05-24 11:16     ` PAGE_GUARDED Benjamin Herrenschmidt
2016-05-24 13:37       ` PAGE_GUARDED Christian Zigotzky
2016-05-24 15:37         ` PAGE_GUARDED Aneesh Kumar K.V
2016-05-25  6:58           ` PAGE_GUARDED Christian Zigotzky
2016-05-25 11:44             ` PAGE_GUARDED Christian Zigotzky
2016-06-04  7:19           ` Kernel 4.7: PAGE_GUARDED and _PAGE_NO_CACHE Christian Zigotzky
2016-06-04  7:40             ` Christian Zigotzky
2016-06-04 11:08               ` Christian Zigotzky
2016-06-04 14:46                 ` Aneesh Kumar K.V
2016-06-04 15:13                   ` Christian Zigotzky
2016-06-04 15:25                     ` Christian Zigotzky
2016-06-05 16:09                       ` Christian Zigotzky
2016-06-06  0:57                         ` Michael Ellerman
2016-06-06  1:23                           ` Julian Margetson
2016-06-06  2:00                             ` Michael Ellerman
2016-06-06  8:59                               ` Julian Margetson
2016-06-06  0:54                   ` Michael Ellerman
2016-06-04 14:42               ` Aneesh Kumar K.V
2016-06-04 15:07                 ` Christian Zigotzky
2016-06-06  0:51                   ` Michael Ellerman
2016-06-06  5:21                     ` Christian Zigotzky
2016-06-07 20:17                     ` Christian Zigotzky
2016-06-07 22:14                       ` Christian Zigotzky
2016-06-08  1:51                         ` Michael Ellerman
2016-06-08  2:52                       ` Michael Ellerman
2016-06-08 10:58                         ` Christian Zigotzky
2016-06-08 11:30                           ` Michael Ellerman
2016-06-08 12:50                             ` Christian Zigotzky
2016-06-08 11:33                       ` Darren Stevens
2016-06-08 13:24                         ` Christian Zigotzky
2016-06-08 13:51                         ` Christian Zigotzky
2016-06-08 13:52                         ` Michael Ellerman
2016-06-08 15:11                         ` Aneesh Kumar K.V
2016-06-08 15:47                           ` Christian Zigotzky
2016-06-09  8:48                             ` Christian Zigotzky
2016-06-09 11:15                               ` Michael Ellerman
2016-06-09 13:13                                 ` Christian Zigotzky
2016-06-13  8:14                                   ` Christian Zigotzky
2016-06-13  8:19                                     ` Benjamin Herrenschmidt
2016-06-13 18:09                                       ` Christian Zigotzky
2016-06-22 19:07                                         ` Christian Zigotzky
2016-06-22 19:58                                           ` luigi burdo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.