All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Christian Zigotzky <chzigotzky@xenosoft.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@lists.ozlabs.org, darren@stevens-zone.net
Cc: Michael Ellerman <michaele@au1.ibm.com>
Subject: Re: PAGE_GUARDED
Date: Tue, 24 May 2016 21:07:10 +0530	[thread overview]
Message-ID: <87d1obqxg9.fsf@skywalker.in.ibm.com> (raw)
In-Reply-To: <1298e1f6-beb7-5487-72a1-366ebd140c17@xenosoft.de>

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

  reply	other threads:[~2016-05-24 15:38 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` Aneesh Kumar K.V [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1obqxg9.fsf@skywalker.in.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=chzigotzky@xenosoft.de \
    --cc=darren@stevens-zone.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=michaele@au1.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.