Re: [PATCH V4 05/26] arm64/mm: Move protection_map[] inside the platform

2022-06-24 Thread Catalin Marinas
On Fri, Jun 24, 2022 at 10:13:18AM +0530, Anshuman Khandual wrote:
> This moves protection_map[] inside the platform and makes it a static.
> 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-ker...@vger.kernel.org
> Signed-off-by: Anshuman Khandual 

Reviewed-by: Catalin Marinas 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name

2022-06-24 Thread Krzysztof Kozlowski
On 24/06/2022 16:16, Serge Semin wrote:
> In accordance with the Generic EHCI/OHCI bindings the corresponding node
> name is suppose to comply with the Generic USB HCD DT schema, which
> requires the USB nodes to have the name acceptable by the regexp:
> "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible
> nodes are correctly named.
> 
> Signed-off-by: Serge Semin 
> Acked-by: Vladimir Zapolskiy 
> Acked-by: Krzysztof Kozlowski 
> ---
>  arch/arm/boot/dts/lpc18xx.dtsi | 4 ++--

You should split the patchset per architecture, because maybe that's why
no one picks it up?

Let me pick up ARM bits through my cleanup series. If anyone objects,
please let me know.

Best regards,
Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 5/5] arm64: dts: apm: Harmonize DWC USB3 DT nodes name

2022-06-24 Thread Krzysztof Kozlowski
On 24/06/2022 16:16, Serge Semin wrote:
> In accordance with the DWC USB3 bindings the corresponding node
> name is suppose to comply with the Generic USB HCD DT schema, which
> requires the USB nodes to have the name acceptable by the regexp:
> "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly
> named despite of the warning comment about possible backward
> compatibility issues.

Sometimes node name is exposed to user-space which depends on it. How
did you check there is no issue here?

> 
> Signed-off-by: Serge Semin 
> Acked-by: Krzysztof Kozlowski 
> ---
>  arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++--
>  arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi 
> b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> index a83c82c50e29..832dd85b00bd 100644
> --- a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> +++ b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> @@ -597,8 +597,8 @@ serial0: serial@1060 {
>   interrupts = <0x0 0x4c 0x4>;
>   };
>  
> - /* Do not change dwusb name, coded for backward compatibility */
> - usb0: dwusb@1900 {
> + /* Node-name might need to be coded as dwusb for backward 
> compatibility */
> + usb0: usb@1900 {
>   status = "disabled";
>   compatible = "snps,dwc3";
>   reg =  <0x0 0x1900 0x0 0x10>;
> diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi 
> b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> index 0f37e77f5459..1520a945b7f9 100644
> --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
> +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> @@ -923,8 +923,8 @@ sata3: sata@1a80 {
>   phy-names = "sata-phy";
>   };
>  
> - /* Do not change dwusb name, coded for backward compatibility */
> - usb0: dwusb@1900 {
> + /* Node-name might need to be coded as dwusb for backward 
> compatibility */
> + usb0: usb@1900 {
>   status = "disabled";
>   compatible = "snps,dwc3";
>   reg =  <0x0 0x1900 0x0 0x10>;
> @@ -933,7 +933,7 @@ usb0: dwusb@1900 {
>   dr_mode = "host";
>   };
>  
> - usb1: dwusb@1980 {
> + usb1: usb@1980 {
>   status = "disabled";
>   compatible = "snps,dwc3";
>   reg =  <0x0 0x1980 0x0 0x10>;


Best regards,
Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 4/5] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name

2022-06-24 Thread Krzysztof Kozlowski
On 24/06/2022 16:16, Serge Semin wrote:
> In accordance with the DWC USB3 bindings the corresponding node
> name is suppose to comply with the Generic USB HCD DT schema, which
> requires the USB nodes to have the name acceptable by the regexp:
> "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly
> named.
> 
> Signed-off-by: Serge Semin 
> Acked-by: Krzysztof Kozlowski 
> Reviewed-by: Patrice Chotard 
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/stih407-family.dtsi 
> b/arch/arm/boot/dts/stih407-family.dtsi
> index 1713f7878117..7ba528315dbe 100644
> --- a/arch/arm/boot/dts/stih407-family.dtsi
> +++ b/arch/arm/boot/dts/stih407-family.dtsi
> @@ -725,7 +725,7 @@ st_dwc3: dwc3@8f94000 {
>  
>   status = "disabled";
>  
> - dwc3: dwc3@990 {
> + dwc3: usb@990 {

This does not apply. What tree is it based on?


Best regards,
Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: (subset) [PATCH RESEND v9 2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name

2022-06-24 Thread Krzysztof Kozlowski
On Fri, 24 Jun 2022 17:16:18 +0300, Serge Semin wrote:
> In accordance with the Generic EHCI/OHCI bindings the corresponding node
> name is suppose to comply with the Generic USB HCD DT schema, which
> requires the USB nodes to have the name acceptable by the regexp:
> "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible
> nodes are correctly named.
> 
> 
> [...]

Applied, thanks!

[2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name
  
https://git.kernel.org/krzk/linux/c/986fd5fe55cb369c34a1dc65b1469aac536a6d50

Best regards,
-- 
Krzysztof Kozlowski 

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 2/5] arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name

2022-06-24 Thread Serge Semin
On Fri, Jun 24, 2022 at 07:14:44PM +0200, Krzysztof Kozlowski wrote:
> On 24/06/2022 16:16, Serge Semin wrote:
> > In accordance with the Generic EHCI/OHCI bindings the corresponding node
> > name is suppose to comply with the Generic USB HCD DT schema, which
> > requires the USB nodes to have the name acceptable by the regexp:
> > "^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible
> > nodes are correctly named.
> > 
> > Signed-off-by: Serge Semin 
> > Acked-by: Vladimir Zapolskiy 
> > Acked-by: Krzysztof Kozlowski 
> > ---
> >  arch/arm/boot/dts/lpc18xx.dtsi | 4 ++--
> 

> You should split the patchset per architecture, because maybe that's why
> no one picks it up?

Each patch is sent out to the corresponding mailing list and the
maintainers. I don't think splitting the patchset into the subsets will
be more efficient especially seeing the initial patchset consisted of
30 patches of which only five left.

I was very busy last year with another activities so what was left of this
patchset was stalling on my local repo all that time. I have been very
surprised to realise that the submitted part still hasn't been merged in for
all that time. So I've got back to resubmitting the series.

* Though the Qualcom dts have been fixed by you lately.

> 
> Let me pick up ARM bits through my cleanup series. If anyone objects,
> please let me know.

Ok. Thanks.

-Sergey

> 
> Best regards,
> Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 4/5] arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name

2022-06-24 Thread Serge Semin
On Fri, Jun 24, 2022 at 07:18:57PM +0200, Krzysztof Kozlowski wrote:
> On 24/06/2022 16:16, Serge Semin wrote:
> > In accordance with the DWC USB3 bindings the corresponding node
> > name is suppose to comply with the Generic USB HCD DT schema, which
> > requires the USB nodes to have the name acceptable by the regexp:
> > "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly
> > named.
> > 
> > Signed-off-by: Serge Semin 
> > Acked-by: Krzysztof Kozlowski 
> > Reviewed-by: Patrice Chotard 
> > ---
> >  arch/arm/boot/dts/stih407-family.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/boot/dts/stih407-family.dtsi 
> > b/arch/arm/boot/dts/stih407-family.dtsi
> > index 1713f7878117..7ba528315dbe 100644
> > --- a/arch/arm/boot/dts/stih407-family.dtsi
> > +++ b/arch/arm/boot/dts/stih407-family.dtsi
> > @@ -725,7 +725,7 @@ st_dwc3: dwc3@8f94000 {
> >  
> > status = "disabled";
> >  
> > -   dwc3: dwc3@990 {
> > +   dwc3: usb@990 {
> 

> This does not apply. What tree is it based on?

That's weird. The series has been rebased onto the mainline kernel v5.19-rc3.
Do you have the stih407 dtsi fixed on your local repo?

-Sergey

> 
> 
> Best regards,
> Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 5/5] arm64: dts: apm: Harmonize DWC USB3 DT nodes name

2022-06-24 Thread Serge Semin
On Fri, Jun 24, 2022 at 07:17:53PM +0200, Krzysztof Kozlowski wrote:
> On 24/06/2022 16:16, Serge Semin wrote:
> > In accordance with the DWC USB3 bindings the corresponding node
> > name is suppose to comply with the Generic USB HCD DT schema, which
> > requires the USB nodes to have the name acceptable by the regexp:
> > "^usb(@.*)?" . Make sure the "snps,dwc3"-compatible nodes are correctly
> > named despite of the warning comment about possible backward
> > compatibility issues.
> 

> Sometimes node name is exposed to user-space which depends on it. How
> did you check there is no issue here?

I well remember the Qcom problem caused by one of my patch:
https://lore.kernel.org/lkml/calaqxlx_fnvfndedwtgbfpjszuabfqxqe07dibjfztftwej...@mail.gmail.com/

The next patch caused the same problem, but hasn't been reverted.
https://lore.kernel.org/lkml/calaqxlwgujgr7p8vb5s_rimrvyxwm5xf-c4nkkgmh-43web...@mail.gmail.com/

As before I am more inclined to thinking that the problem was mainly caused
by the improper node-name utilization. Anyway John later noted that the
problem was fixed in the user-space. That why afterwards you were able
to provide the commit b77a1c4d6b05 ("arm64: dts: qcom: correct DWC3
node names and unit addresses").

Anyway I am not able to track the way the node-name is used on the
affected platform and can't make sure that the dts would be still
working well on that devices. But seeing nobody responded/commented on
this patch for more than a year we can at least try to merge this in
and see whether it causes any problem should the denoted platform is
still in use. If it does we can revert the update back and forget
about it.

-Sergey

> 
> > 
> > Signed-off-by: Serge Semin 
> > Acked-by: Krzysztof Kozlowski 
> > ---
> >  arch/arm64/boot/dts/apm/apm-shadowcat.dtsi | 4 ++--
> >  arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 +++---
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi 
> > b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> > index a83c82c50e29..832dd85b00bd 100644
> > --- a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> > +++ b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
> > @@ -597,8 +597,8 @@ serial0: serial@1060 {
> > interrupts = <0x0 0x4c 0x4>;
> > };
> >  
> > -   /* Do not change dwusb name, coded for backward compatibility */
> > -   usb0: dwusb@1900 {
> > +   /* Node-name might need to be coded as dwusb for backward 
> > compatibility */
> > +   usb0: usb@1900 {
> > status = "disabled";
> > compatible = "snps,dwc3";
> > reg =  <0x0 0x1900 0x0 0x10>;
> > diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi 
> > b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> > index 0f37e77f5459..1520a945b7f9 100644
> > --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
> > +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
> > @@ -923,8 +923,8 @@ sata3: sata@1a80 {
> > phy-names = "sata-phy";
> > };
> >  
> > -   /* Do not change dwusb name, coded for backward compatibility */
> > -   usb0: dwusb@1900 {
> > +   /* Node-name might need to be coded as dwusb for backward 
> > compatibility */
> > +   usb0: usb@1900 {
> > status = "disabled";
> > compatible = "snps,dwc3";
> > reg =  <0x0 0x1900 0x0 0x10>;
> > @@ -933,7 +933,7 @@ usb0: dwusb@1900 {
> > dr_mode = "host";
> > };
> >  
> > -   usb1: dwusb@1980 {
> > +   usb1: usb@1980 {
> > status = "disabled";
> > compatible = "snps,dwc3";
> > reg =  <0x0 0x1980 0x0 0x10>;
> 
> 
> Best regards,
> Krzysztof

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 1/5] arc: dts: Harmonize EHCI/OHCI DT nodes name

2022-06-24 Thread Vineet Gupta



On 6/24/22 07:16, Serge Semin wrote:

In accordance with the Generic EHCI/OHCI bindings the corresponding node
name is suppose to comply with the Generic USB HCD DT schema, which
requires the USB nodes to have the name acceptable by the regexp:
"^usb(@.*)?"  . Make sure the "generic-ehci" and "generic-ohci"-compatible
nodes are correctly named.

Signed-off-by: Serge Semin
Acked-by: Alexey Brodkin
Acked-by: Krzysztof Kozlowski


This slipped thru cracks. Now on for-curr.

Thx,
-Vineet

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH RESEND v9 1/5] arc: dts: Harmonize EHCI/OHCI DT nodes name

2022-06-24 Thread Serge Semin
On Fri, Jun 24, 2022 at 03:11:43PM -0700, Vineet Gupta wrote:
> 
> On 6/24/22 07:16, Serge Semin wrote:
> > In accordance with the Generic EHCI/OHCI bindings the corresponding node
> > name is suppose to comply with the Generic USB HCD DT schema, which
> > requires the USB nodes to have the name acceptable by the regexp:
> > "^usb(@.*)?"  . Make sure the "generic-ehci" and "generic-ohci"-compatible
> > nodes are correctly named.
> > 
> > Signed-off-by: Serge Semin
> > Acked-by: Alexey Brodkin
> > Acked-by: Krzysztof Kozlowski
> 

> This slipped thru cracks. Now on for-curr.

Great! Thanks.

-Sergey

> 
> Thx,
> -Vineet

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V4 17/26] csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-24 Thread Guo Ren
For csky part.

Acked-by: Guo Ren 


On Fri, Jun 24, 2022 at 12:48 PM Anshuman Khandual
 wrote:
>
> This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard
> vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks
> up a private and static protection_map[] array. Subsequently all __SXXX and
> __PXXX macros can be dropped which are no longer needed.
>
> Cc: Geert Uytterhoeven 
> Cc: linux-c...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org
> Signed-off-by: Anshuman Khandual 
> ---
>  arch/csky/Kconfig   |  1 +
>  arch/csky/include/asm/pgtable.h | 18 --
>  arch/csky/mm/init.c | 20 
>  3 files changed, 21 insertions(+), 18 deletions(-)
>
> diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
> index 21d72b078eef..588b8a9c68ed 100644
> --- a/arch/csky/Kconfig
> +++ b/arch/csky/Kconfig
> @@ -6,6 +6,7 @@ config CSKY
> select ARCH_HAS_GCOV_PROFILE_ALL
> select ARCH_HAS_SYNC_DMA_FOR_CPU
> select ARCH_HAS_SYNC_DMA_FOR_DEVICE
> +   select ARCH_HAS_VM_GET_PAGE_PROT
> select ARCH_USE_BUILTIN_BSWAP
> select ARCH_USE_QUEUED_RWLOCKS
> select ARCH_WANT_FRAME_POINTERS if !CPU_CK610 && 
> $(cc-option,-mbacktrace)
> diff --git a/arch/csky/include/asm/pgtable.h b/arch/csky/include/asm/pgtable.h
> index bbe24511..229a5f4ad7fc 100644
> --- a/arch/csky/include/asm/pgtable.h
> +++ b/arch/csky/include/asm/pgtable.h
> @@ -77,24 +77,6 @@
>  #define MAX_SWAPFILES_CHECK() \
> BUILD_BUG_ON(MAX_SWAPFILES_SHIFT != 5)
>
> -#define __P000 PAGE_NONE
> -#define __P001 PAGE_READ
> -#define __P010 PAGE_READ
> -#define __P011 PAGE_READ
> -#define __P100 PAGE_READ
> -#define __P101 PAGE_READ
> -#define __P110 PAGE_READ
> -#define __P111 PAGE_READ
> -
> -#define __S000 PAGE_NONE
> -#define __S001 PAGE_READ
> -#define __S010 PAGE_WRITE
> -#define __S011 PAGE_WRITE
> -#define __S100 PAGE_READ
> -#define __S101 PAGE_READ
> -#define __S110 PAGE_WRITE
> -#define __S111 PAGE_WRITE
> -
>  extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
>  #define ZERO_PAGE(vaddr)   (virt_to_page(empty_zero_page))
>
> diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c
> index bf2004aa811a..1bf7b2a748fd 100644
> --- a/arch/csky/mm/init.c
> +++ b/arch/csky/mm/init.c
> @@ -197,3 +197,23 @@ void __init fixaddr_init(void)
> vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
> fixrange_init(vaddr, vaddr + PMD_SIZE, swapper_pg_dir);
>  }
> +
> +static pgprot_t protection_map[16] __ro_after_init = {
> +   [VM_NONE]   = PAGE_NONE,
> +   [VM_READ]   = PAGE_READ,
> +   [VM_WRITE]  = PAGE_READ,
> +   [VM_WRITE | VM_READ]= PAGE_READ,
> +   [VM_EXEC]   = PAGE_READ,
> +   [VM_EXEC | VM_READ] = PAGE_READ,
> +   [VM_EXEC | VM_WRITE]= PAGE_READ,
> +   [VM_EXEC | VM_WRITE | VM_READ]  = PAGE_READ,
> +   [VM_SHARED] = PAGE_NONE,
> +   [VM_SHARED | VM_READ]   = PAGE_READ,
> +   [VM_SHARED | VM_WRITE]  = PAGE_WRITE,
> +   [VM_SHARED | VM_WRITE | VM_READ]= PAGE_WRITE,
> +   [VM_SHARED | VM_EXEC]   = PAGE_READ,
> +   [VM_SHARED | VM_EXEC | VM_READ] = PAGE_READ,
> +   [VM_SHARED | VM_EXEC | VM_WRITE]= PAGE_WRITE,
> +   [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ]  = PAGE_WRITE
> +};
> +DECLARE_VM_GET_PAGE_PROT
> --
> 2.25.1
>


--
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH V4 10/26] openrisc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-06-24 Thread Stafford Horne
On Fri, Jun 24, 2022 at 10:13:23AM +0530, Anshuman Khandual wrote:
> This enables ARCH_HAS_VM_GET_PAGE_PROT on the platform and exports standard
> vm_get_page_prot() implementation via DECLARE_VM_GET_PAGE_PROT, which looks
> up a private and static protection_map[] array. Subsequently all __SXXX and
> __PXXX macros can be dropped which are no longer needed.
> 
> Cc: Jonas Bonn 
> Cc: openr...@lists.librecores.org
> Cc: linux-ker...@vger.kernel.org
> Signed-off-by: Anshuman Khandual 
> ---
>  arch/openrisc/Kconfig   |  1 +
>  arch/openrisc/include/asm/pgtable.h | 18 --
>  arch/openrisc/mm/init.c | 20 
>  3 files changed, 21 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
> index e814df4c483c..fe0dfb50eb86 100644
> --- a/arch/openrisc/Kconfig
> +++ b/arch/openrisc/Kconfig
> @@ -10,6 +10,7 @@ config OPENRISC
>   select ARCH_HAS_DMA_SET_UNCACHED
>   select ARCH_HAS_DMA_CLEAR_UNCACHED
>   select ARCH_HAS_SYNC_DMA_FOR_DEVICE
> + select ARCH_HAS_VM_GET_PAGE_PROT
>   select COMMON_CLK
>   select OF
>   select OF_EARLY_FLATTREE
> diff --git a/arch/openrisc/include/asm/pgtable.h 
> b/arch/openrisc/include/asm/pgtable.h
> index c3abbf71e09f..dcae8aea132f 100644
> --- a/arch/openrisc/include/asm/pgtable.h
> +++ b/arch/openrisc/include/asm/pgtable.h
> @@ -176,24 +176,6 @@ extern void paging_init(void);
>   __pgprot(_PAGE_ALL | _PAGE_SRE | _PAGE_SWE \
>| _PAGE_SHARED | _PAGE_DIRTY | _PAGE_EXEC | _PAGE_CI)
>  
> -#define __P000   PAGE_NONE
> -#define __P001   PAGE_READONLY_X
> -#define __P010   PAGE_COPY
> -#define __P011   PAGE_COPY_X
> -#define __P100   PAGE_READONLY
> -#define __P101   PAGE_READONLY_X
> -#define __P110   PAGE_COPY
> -#define __P111   PAGE_COPY_X
> -
> -#define __S000   PAGE_NONE
> -#define __S001   PAGE_READONLY_X
> -#define __S010   PAGE_SHARED
> -#define __S011   PAGE_SHARED_X
> -#define __S100   PAGE_READONLY
> -#define __S101   PAGE_READONLY_X
> -#define __S110   PAGE_SHARED
> -#define __S111   PAGE_SHARED_X
> -
>  /* zero page used for uninitialized stuff */
>  extern unsigned long empty_zero_page[2048];
>  #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
> diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
> index 3a021ab6f1ae..a654b9dcba91 100644
> --- a/arch/openrisc/mm/init.c
> +++ b/arch/openrisc/mm/init.c
> @@ -208,3 +208,23 @@ void __init mem_init(void)
>   mem_init_done = 1;
>   return;
>  }
> +
> +static pgprot_t protection_map[16] __ro_after_init = {
> + [VM_NONE]   = PAGE_NONE,
> + [VM_READ]   = PAGE_READONLY_X,
> + [VM_WRITE]  = PAGE_COPY,
> + [VM_WRITE | VM_READ]= PAGE_COPY_X,
> + [VM_EXEC]   = PAGE_READONLY,
> + [VM_EXEC | VM_READ] = PAGE_READONLY_X,
> + [VM_EXEC | VM_WRITE]= PAGE_COPY,
> + [VM_EXEC | VM_WRITE | VM_READ]  = PAGE_COPY_X,
> + [VM_SHARED] = PAGE_NONE,
> + [VM_SHARED | VM_READ]   = PAGE_READONLY_X,
> + [VM_SHARED | VM_WRITE]  = PAGE_SHARED,
> + [VM_SHARED | VM_WRITE | VM_READ]= PAGE_SHARED_X,
> + [VM_SHARED | VM_EXEC]   = PAGE_READONLY,
> + [VM_SHARED | VM_EXEC | VM_READ] = PAGE_READONLY_X,
> + [VM_SHARED | VM_EXEC | VM_WRITE]= PAGE_SHARED,
> + [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ]  = PAGE_SHARED_X
> +};
> +DECLARE_VM_GET_PAGE_PROT

Looks good.

Acked-by: Stafford Horne 


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc