mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] MIPS: Pistachio: Enable KASLR
@ 2016-05-25 10:49 Matt Redfearn
  2016-05-25 10:56 ` James Hogan
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Redfearn @ 2016-05-25 10:49 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Matt Redfearn, linux-mips, Andrew Bresticker, linux-kernel,
	James Hogan, Jonas Gorski

Allow KASLR to be selected on Pistachio based systems. Tested on a
Creator Ci40.

Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>

---

 arch/mips/Kconfig          | 1 +
 arch/mips/pistachio/init.c | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c5bedce4122d..f1e59cbf5fe4 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -398,6 +398,7 @@ config MACH_PISTACHIO
 	select SYS_SUPPORTS_MIPS_CPS
 	select SYS_SUPPORTS_MULTITHREADING
 	select SYS_SUPPORTS_ZBOOT
+	select SYS_SUPPORTS_RELOCATABLE
 	select SYS_HAS_EARLY_PRINTK
 	select USE_GENERIC_EARLY_PRINTK_8250
 	select USE_OF
diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
index 96ba2cc9ad3e..95f8767ce52e 100644
--- a/arch/mips/pistachio/init.c
+++ b/arch/mips/pistachio/init.c
@@ -52,12 +52,16 @@ static void __init plat_setup_iocoherency(void)
 	}
 }
 
-void __init plat_mem_setup(void)
+void __init *plat_get_fdt(void)
 {
 	if (fw_arg0 != -2)
 		panic("Device-tree not present");
+	return (void *)fw_arg1;
+}
 
-	__dt_setup_arch((void *)fw_arg1);
+void __init plat_mem_setup(void)
+{
+	__dt_setup_arch(plat_get_fdt());
 
 	plat_setup_iocoherency();
 }
-- 
2.5.0

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

* Re: [PATCH] MIPS: Pistachio: Enable KASLR
  2016-05-25 10:49 [PATCH] MIPS: Pistachio: Enable KASLR Matt Redfearn
@ 2016-05-25 10:56 ` James Hogan
  0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2016-05-25 10:56 UTC (permalink / raw)
  To: Matt Redfearn
  Cc: Ralf Baechle, linux-mips, Andrew Bresticker, linux-kernel, Jonas Gorski

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

On Wed, May 25, 2016 at 11:49:47AM +0100, Matt Redfearn wrote:
> Allow KASLR to be selected on Pistachio based systems. Tested on a
> Creator Ci40.
> 
> Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
> 
> ---
> 
>  arch/mips/Kconfig          | 1 +
>  arch/mips/pistachio/init.c | 8 ++++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index c5bedce4122d..f1e59cbf5fe4 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -398,6 +398,7 @@ config MACH_PISTACHIO
>  	select SYS_SUPPORTS_MIPS_CPS
>  	select SYS_SUPPORTS_MULTITHREADING
>  	select SYS_SUPPORTS_ZBOOT
> +	select SYS_SUPPORTS_RELOCATABLE

This list is (mostly) already sorted, so probably best to add this
before SYS_SUPPORTS_ZBOOT.

Other than that,
Reviewed-by: James Hogan <james.hogan@imgtec.com>

Cheers
James

>  	select SYS_HAS_EARLY_PRINTK
>  	select USE_GENERIC_EARLY_PRINTK_8250
>  	select USE_OF
> diff --git a/arch/mips/pistachio/init.c b/arch/mips/pistachio/init.c
> index 96ba2cc9ad3e..95f8767ce52e 100644
> --- a/arch/mips/pistachio/init.c
> +++ b/arch/mips/pistachio/init.c
> @@ -52,12 +52,16 @@ static void __init plat_setup_iocoherency(void)
>  	}
>  }
>  
> -void __init plat_mem_setup(void)
> +void __init *plat_get_fdt(void)
>  {
>  	if (fw_arg0 != -2)
>  		panic("Device-tree not present");
> +	return (void *)fw_arg1;
> +}
>  
> -	__dt_setup_arch((void *)fw_arg1);
> +void __init plat_mem_setup(void)
> +{
> +	__dt_setup_arch(plat_get_fdt());
>  
>  	plat_setup_iocoherency();
>  }
> -- 
> 2.5.0
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-05-25 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 10:49 [PATCH] MIPS: Pistachio: Enable KASLR Matt Redfearn
2016-05-25 10:56 ` James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®