linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: compile kernel for linkstations optimized for size
@ 2008-10-13  4:07 Rogério Brito
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-13  4:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: rbrito, linuxppc-dev, akpm

From: Rogério Brito <rbrito@ime.usp.br>

Since Linkstations and Kuroboxes often have *very* little memory (as
they are embedded systems), it is desirable to get their kernels
compiled optimized for size.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>

---

I have been using kernels optimized for size on my Kurobox (standard)
for many different releases and I have experienced no problem with this
option enabled. Thus, this patch.

--- linux/arch/powerpc/configs/linkstation_defconfig.old	2008-10-13 00:33:00.000000000 -0300
+++ linux/arch/powerpc/configs/linkstation_defconfig	2008-10-13 00:38:58.000000000 -0300
@@ -90,7 +90,7 @@ CONFIG_NAMESPACES=y
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
 # CONFIG_EMBEDDED is not set
 CONFIG_SYSCTL_SYSCALL=y


-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13  4:07 [PATCH] powerpc: compile kernel for linkstations optimized for size Rogério Brito
@ 2008-10-13  4:51 ` Rogério Brito
  2008-10-13 18:05   ` Guennadi Liakhovetski
                     ` (2 more replies)
  2008-10-13 18:03 ` [PATCH] powerpc: compile kernel for linkstations optimized for size Guennadi Liakhovetski
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-13  4:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: rbrito, linuxppc-dev, akpm

The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
Randomization" option enabled.

Since some of these machines are facing the internet, it helps to have
heap randomization enabled. This patch enables it.


Signed-off-by: Rogério Brito <rbrito@ime.usp.br>

---

--- linux/arch/powerpc/configs/linkstation_defconfig.old	2008-10-13 00:33:00.000000000 -0300
+++ linux/arch/powerpc/configs/linkstation_defconfig	2008-10-13 01:11:28.000000000 -0300
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-rc4
-# Thu Aug 21 00:52:05 2008
+# Linux kernel version: 2.6.27
+# Mon Oct 13 01:11:21 2008
 #
 # CONFIG_PPC64 is not set
 
@@ -101,7 +101,7 @@ CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
-CONFIG_COMPAT_BRK=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
@@ -1211,7 +1211,6 @@ CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_ALAUDA is not set
 # CONFIG_USB_STORAGE_ONETOUCH is not set
 # CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_STORAGE_SIERRA is not set
 # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
 # CONFIG_USB_LIBUSUAL is not set
 

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: compile kernel for linkstations optimized for size
  2008-10-13  4:07 [PATCH] powerpc: compile kernel for linkstations optimized for size Rogério Brito
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
@ 2008-10-13 18:03 ` Guennadi Liakhovetski
  2008-10-13 21:28   ` Rogério Brito
  2008-10-17  9:37 ` Rogério Brito
  2008-10-28 13:58 ` Kumar Gala
  3 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-13 18:03 UTC (permalink / raw)
  To: Rogério Brito; +Cc: linuxppc-dev, akpm, linux-kernel

On Mon, 13 Oct 2008, Rog=E9rio Brito wrote:

> From: Rog=E9rio Brito <rbrito@ime.usp.br>
>=20
> Since Linkstations and Kuroboxes often have *very* little memory (as
> they are embedded systems), it is desirable to get their kernels
> compiled optimized for size.
>=20
> Signed-off-by: Rog=E9rio Brito <rbrito@ime.usp.br>
>=20
> ---
>=20
> I have been using kernels optimized for size on my Kurobox (standard)
> for many different releases and I have experienced no problem with this
> option enabled. Thus, this patch.

The comment for this option says: "watch out for broken compilers," if=20
this doesn't hold any more, it should be remove, if it still holds, I=20
wouldn't turn this on by default, as I don't think we can test all=20
possible (cross- or native-) compilers users might want to use. In any=20
case this is one of options that users can select themselves, if it suits=
=20
them. Also I don't think your CC list is correct, you wanted to send this=
=20
to the powerpc list and one of powerpc / subarch maintainer.

Thanks
Guennadi

>=20
> --- linux/arch/powerpc/configs/linkstation_defconfig.old=092008-10-13 00:=
33:00.000000000 -0300
> +++ linux/arch/powerpc/configs/linkstation_defconfig=092008-10-13 00:38:5=
8.000000000 -0300
> @@ -90,7 +90,7 @@ CONFIG_NAMESPACES=3Dy
>  # CONFIG_PID_NS is not set
>  CONFIG_BLK_DEV_INITRD=3Dy
>  CONFIG_INITRAMFS_SOURCE=3D""
> -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> +CONFIG_CC_OPTIMIZE_FOR_SIZE=3Dy
>  CONFIG_SYSCTL=3Dy
>  # CONFIG_EMBEDDED is not set
>  CONFIG_SYSCTL_SYSCALL=3Dy
>=20
>=20
> --=20
> Rog=E9rio Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
> http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
> Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>=20

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
@ 2008-10-13 18:05   ` Guennadi Liakhovetski
  2008-10-13 18:44     ` Scott Wood
  2008-10-17  9:38   ` Rogério Brito
  2008-10-28 13:58   ` Kumar Gala
  2 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-13 18:05 UTC (permalink / raw)
  To: Rogério Brito; +Cc: linuxppc-dev, akpm, linux-kernel

On Mon, 13 Oct 2008, Rog=E9rio Brito wrote:

> The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
> Randomization" option enabled.
>=20
> Since some of these machines are facing the internet, it helps to have
> heap randomization enabled. This patch enables it.

Same as the previous patch - this is one of options, that users select=20
according to their needs. If any specific distribution enables this option=
=20
by default in their kernels, they can do this too, don't think this is=20
critical enough to patch the defconfig.

Thanks
Guennadi

>=20
>=20
> Signed-off-by: Rog=E9rio Brito <rbrito@ime.usp.br>
>=20
> ---
>=20
> --- linux/arch/powerpc/configs/linkstation_defconfig.old=092008-10-13 00:=
33:00.000000000 -0300
> +++ linux/arch/powerpc/configs/linkstation_defconfig=092008-10-13 01:11:2=
8.000000000 -0300
> @@ -1,7 +1,7 @@
>  #
>  # Automatically generated make config: don't edit
> -# Linux kernel version: 2.6.27-rc4
> -# Thu Aug 21 00:52:05 2008
> +# Linux kernel version: 2.6.27
> +# Mon Oct 13 01:11:21 2008
>  #
>  # CONFIG_PPC64 is not set
> =20
> @@ -101,7 +101,7 @@ CONFIG_HOTPLUG=3Dy
>  CONFIG_PRINTK=3Dy
>  CONFIG_BUG=3Dy
>  CONFIG_ELF_CORE=3Dy
> -CONFIG_COMPAT_BRK=3Dy
> +# CONFIG_COMPAT_BRK is not set
>  CONFIG_BASE_FULL=3Dy
>  CONFIG_FUTEX=3Dy
>  CONFIG_ANON_INODES=3Dy
> @@ -1211,7 +1211,6 @@ CONFIG_USB_STORAGE=3Dm
>  # CONFIG_USB_STORAGE_ALAUDA is not set
>  # CONFIG_USB_STORAGE_ONETOUCH is not set
>  # CONFIG_USB_STORAGE_KARMA is not set
> -# CONFIG_USB_STORAGE_SIERRA is not set
>  # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
>  # CONFIG_USB_LIBUSUAL is not set
> =20
>=20
> --=20
> Rog=E9rio Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
> http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
> Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>=20

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13 18:05   ` Guennadi Liakhovetski
@ 2008-10-13 18:44     ` Scott Wood
  2008-10-13 19:27       ` Guennadi Liakhovetski
                         ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Scott Wood @ 2008-10-13 18:44 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Rogério Brito, linuxppc-dev, akpm, linux-kernel

On Mon, Oct 13, 2008 at 08:05:09PM +0200, Guennadi Liakhovetski wrote:
> On Mon, 13 Oct 2008, Rogério Brito wrote:
> 
> > The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
> > Randomization" option enabled.
> > 
> > Since some of these machines are facing the internet, it helps to have
> > heap randomization enabled. This patch enables it.
> 
> Same as the previous patch - this is one of options, that users select 
> according to their needs. If any specific distribution enables this option 
> by default in their kernels, they can do this too, don't think this is 
> critical enough to patch the defconfig.

Just because users/distros can change it doesn't mean it's pointless to
discuss what default is sane, and make changes if the current default
isn't.

For security-related options it's usually best to default to the more
secure state, especially since the option description talks about it
being needed mainly for libc5 compatibility -- did libc5 ever even exist
for powerpc?  

The only reason it was turned on in the first place was likely the
"default y", which in turn is there to avoid breaking old x86 distros.

-Scott

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13 18:44     ` Scott Wood
@ 2008-10-13 19:27       ` Guennadi Liakhovetski
  2008-10-13 20:56       ` Rogério Brito
  2008-10-19  2:53       ` Rogério Brito
  2 siblings, 0 replies; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-13 19:27 UTC (permalink / raw)
  To: Scott Wood; +Cc: Rogério Brito, linuxppc-dev, akpm, linux-kernel

On Mon, 13 Oct 2008, Scott Wood wrote:

> On Mon, Oct 13, 2008 at 08:05:09PM +0200, Guennadi Liakhovetski wrote:
> > On Mon, 13 Oct 2008, Rog=E9rio Brito wrote:
> >=20
> > > The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
> > > Randomization" option enabled.
> > >=20
> > > Since some of these machines are facing the internet, it helps to hav=
e
> > > heap randomization enabled. This patch enables it.
> >=20
> > Same as the previous patch - this is one of options, that users select=
=20
> > according to their needs. If any specific distribution enables this opt=
ion=20
> > by default in their kernels, they can do this too, don't think this is=
=20
> > critical enough to patch the defconfig.
>=20
> Just because users/distros can change it doesn't mean it's pointless to
> discuss what default is sane, and make changes if the current default
> isn't.
>=20
> For security-related options it's usually best to default to the more
> secure state, especially since the option description talks about it
> being needed mainly for libc5 compatibility -- did libc5 ever even exist
> for powerpc? =20

In a 2.6.27-rc5-ish snapshot I counted 68 enabled and 11 disabled=20
CONFIG_COMPAT_BRK under arch/powerpc/configs/. Ok, enabling it for all=20
would be a bit rude, and one has to start somewhere...

> The only reason it was turned on in the first place was likely the
> "default y", which in turn is there to avoid breaking old x86 distros.

Then maybe it would be better to make default y only for some platforms?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13 18:44     ` Scott Wood
  2008-10-13 19:27       ` Guennadi Liakhovetski
@ 2008-10-13 20:56       ` Rogério Brito
  2008-10-19  2:53       ` Rogério Brito
  2 siblings, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-13 20:56 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, akpm, Guennadi Liakhovetski, linux-kernel

Hi, Scott, Guennadi.

On 13/10/2008, at 16:44, Scott Wood wrote:

> On Mon, Oct 13, 2008 at 08:05:09PM +0200, Guennadi Liakhovetski wrote:
>> On Mon, 13 Oct 2008, Rog=E9rio Brito wrote:
>>
>>> The current defconfig for Linkstation/Kuroboxes has the "Disable =20
>>> Heap
>>> Randomization" option enabled.
>>>
>>> Since some of these machines are facing the internet, it helps to =20=

>>> have
>>> heap randomization enabled. This patch enables it.
>>
>> Same as the previous patch - this is one of options, that users =20
>> select
>> according to their needs. If any specific distribution enables =20
>> this option
>> by default in their kernels, they can do this too, don't think =20
>> this is
>> critical enough to patch the defconfig.

I think that the matter is not being critical or not, but of =20
including a sane default as the kernel should be a place for best-=20
current-practices.

> Just because users/distros can change it doesn't mean it's =20
> pointless to
> discuss what default is sane, and make changes if the current default
> isn't.

Exactly my point.

> For security-related options it's usually best to default to the more
> secure state, especially since the option description talks about it
> being needed mainly for libc5 compatibility -- did libc5 ever even =20
> exist
> for powerpc?

I don't know, but even Debian's very ancient distributions all came =20
with libc6 on powerpc.

> The only reason it was turned on in the first place was likely the
> "default y", which in turn is there to avoid breaking old x86 distros.

Exactly. Agreed 100%.


Regards, Rog=E9rio Brito.

--=20
Rog=E9rio Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: compile kernel for linkstations optimized for size
  2008-10-13 18:03 ` [PATCH] powerpc: compile kernel for linkstations optimized for size Guennadi Liakhovetski
@ 2008-10-13 21:28   ` Rogério Brito
  0 siblings, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-13 21:28 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linuxppc-dev, akpm, linux-kernel

Hi, Guennadi.

On 13/10/2008, at 16:03, Guennadi Liakhovetski wrote:

> On Mon, 13 Oct 2008, Rog=E9rio Brito wrote:
>
>> From: Rog=E9rio Brito <rbrito@ime.usp.br>
>>
>> Since Linkstations and Kuroboxes often have *very* little memory (as
>> they are embedded systems), it is desirable to get their kernels
>> compiled optimized for size.
>>
>> Signed-off-by: Rog=E9rio Brito <rbrito@ime.usp.br>
>>
>> ---
>>
>> I have been using kernels optimized for size on my Kurobox (standard)
>> for many different releases and I have experienced no problem with =20=

>> this
>> option enabled. Thus, this patch.
>
> The comment for this option says: "watch out for broken compilers," if
> this doesn't hold any more, it should be remove, if it still holds, I
> wouldn't turn this on by default, as I don't think we can test all

Pragmatically speaking, -O2 can be broken too (and see the amount of =20
ICEs that you can get with newer kernels even compiling with -O2). =20
Unless you prove that the compiler is correct and keeps all its =20
invariants, then you can rely on this. But, pragmatically speaking =20
again, gcc has bugs.

But leaving the mathematical situation aside (Dijkstra would have =20
spanked all of us here :)), as I mentioned below the signed off line, =20=

I have been using -Os and it is working fine. It's serving me quite =20
well and with a decent uptime:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =20=

- - -
lutz:~# uptime
  19:22:53 up 17 days,  5:56,  1 user,  load average: 0.00, 0.00, 0.00
lutz:~# uname -a
Linux lutz 2.6.27-rc6.try02 #8 Fri Sep 26 11:29:55 BRT 2008 ppc GNU/=20
Linux
lutz:~#
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =20=

- - -

And, despite the 0.00 load, I'm streaming music with it via mt-daapd =20
and serving cifs mounts.

> possible (cross- or native-) compilers users might want to use. In any
> case this is one of options that users can select themselves, if it =20=

> suits
> them.

And that is, not to mention, with a very home-brew and quick'n'dirty =20
cross-compiled kernel (with a vanilla gcc 4.2.0 taken straight from =20
gcc.gnu.org; the same with the kernel: no patches applied).

--=20
Rog=E9rio Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: compile kernel for linkstations optimized for size
  2008-10-13  4:07 [PATCH] powerpc: compile kernel for linkstations optimized for size Rogério Brito
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
  2008-10-13 18:03 ` [PATCH] powerpc: compile kernel for linkstations optimized for size Guennadi Liakhovetski
@ 2008-10-17  9:37 ` Rogério Brito
  2008-10-28 13:58 ` Kumar Gala
  3 siblings, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-17  9:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev, akpm, paulus

Hi,

It's been some days since I sent the patch below. I would appreciate if any
feedback was given.


Thanks, Rogério Brito.

On Oct 13 2008, Rogério Brito wrote:
> From: Rogério Brito <rbrito@ime.usp.br>
> 
> Since Linkstations and Kuroboxes often have *very* little memory (as
> they are embedded systems), it is desirable to get their kernels
> compiled optimized for size.
> 
> Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
> 
> ---
> 
> I have been using kernels optimized for size on my Kurobox (standard)
> for many different releases and I have experienced no problem with this
> option enabled. Thus, this patch.
> 
> --- linux/arch/powerpc/configs/linkstation_defconfig.old	2008-10-13 00:33:00.000000000 -0300
> +++ linux/arch/powerpc/configs/linkstation_defconfig	2008-10-13 00:38:58.000000000 -0300
> @@ -90,7 +90,7 @@ CONFIG_NAMESPACES=y
>  # CONFIG_PID_NS is not set
>  CONFIG_BLK_DEV_INITRD=y
>  CONFIG_INITRAMFS_SOURCE=""
> -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>  CONFIG_SYSCTL=y
>  # CONFIG_EMBEDDED is not set
>  CONFIG_SYSCTL_SYSCALL=y
> 
> 
> -- 
> Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
> http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
> Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
  2008-10-13 18:05   ` Guennadi Liakhovetski
@ 2008-10-17  9:38   ` Rogério Brito
  2008-10-28 13:58   ` Kumar Gala
  2 siblings, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-17  9:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev, akpm, paulus

Hi,

This other patch was also sent some days ago and I would appreciate some
feedback on it.


Regards, Rogério Brito.

On Oct 13 2008, Rogério Brito wrote:
> The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
> Randomization" option enabled.
> 
> Since some of these machines are facing the internet, it helps to have
> heap randomization enabled. This patch enables it.
> 
> 
> Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
> 
> ---
> 
> --- linux/arch/powerpc/configs/linkstation_defconfig.old	2008-10-13 00:33:00.000000000 -0300
> +++ linux/arch/powerpc/configs/linkstation_defconfig	2008-10-13 01:11:28.000000000 -0300
> @@ -1,7 +1,7 @@
>  #
>  # Automatically generated make config: don't edit
> -# Linux kernel version: 2.6.27-rc4
> -# Thu Aug 21 00:52:05 2008
> +# Linux kernel version: 2.6.27
> +# Mon Oct 13 01:11:21 2008
>  #
>  # CONFIG_PPC64 is not set
>  
> @@ -101,7 +101,7 @@ CONFIG_HOTPLUG=y
>  CONFIG_PRINTK=y
>  CONFIG_BUG=y
>  CONFIG_ELF_CORE=y
> -CONFIG_COMPAT_BRK=y
> +# CONFIG_COMPAT_BRK is not set
>  CONFIG_BASE_FULL=y
>  CONFIG_FUTEX=y
>  CONFIG_ANON_INODES=y
> @@ -1211,7 +1211,6 @@ CONFIG_USB_STORAGE=m
>  # CONFIG_USB_STORAGE_ALAUDA is not set
>  # CONFIG_USB_STORAGE_ONETOUCH is not set
>  # CONFIG_USB_STORAGE_KARMA is not set
> -# CONFIG_USB_STORAGE_SIERRA is not set
>  # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
>  # CONFIG_USB_LIBUSUAL is not set
>  
> 
> -- 
> Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
> http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
> Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13 18:44     ` Scott Wood
  2008-10-13 19:27       ` Guennadi Liakhovetski
  2008-10-13 20:56       ` Rogério Brito
@ 2008-10-19  2:53       ` Rogério Brito
  2008-10-19  3:16         ` Rogério Brito
  2008-10-19 20:59         ` Guennadi Liakhovetski
  2 siblings, 2 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-19  2:53 UTC (permalink / raw)
  To: Scott Wood
  Cc: linux-kernel, linuxppc-dev, paulus, akpm, Guennadi Liakhovetski

Hi.

On Oct 13 2008, Scott Wood wrote:
> On Mon, Oct 13, 2008 at 08:05:09PM +0200, Guennadi Liakhovetski wrote:
> > On Mon, 13 Oct 2008, Rogério Brito wrote:
> > > The current defconfig for Linkstation/Kuroboxes has the "Disable
> > > Heap Randomization" option enabled.
> > > 
> > > Since some of these machines are facing the internet, it helps to
> > > have heap randomization enabled. This patch enables it.
> > 
> > Same as the previous patch - this is one of options, that users
> > select according to their needs. If any specific distribution
> > enables this option by default in their kernels, they can do this
> > too, don't think this is critical enough to patch the defconfig.

I guess, Guennadi, that this is questionable. Many people would base
their configs on the defconfig.

Also, the defconfig has many questionable settings for an embedded
platform like the Kurobox.

And it seems that there is something not quite right for these embedded
systems. Here is something that I get with a vanilla linkstation_defconfig:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This gets me (with bootlogd enabled):

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Wed Dec 31 21:00:15 1969: Cannot access the Hardware Clock via any known method.
Wed Dec 31 21:00:15 1969: Use the --debug option to see the details of our search for an access method.
Wed Dec 31 21:00:15 1969: Unable to set System Clock to: Thu Jan 1 00:00:15 UTC 1970 ^[[33m(warning).^[[39;49m
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I just saw that in the default config:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CONFIG_PPC_CLOCK is not set
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Maybe this should be enabled? I can iterate once more to see if this
option would make any difference here.

> Just because users/distros can change it doesn't mean it's pointless
> to discuss what default is sane, and make changes if the current
> default isn't.

100% agreed again, Scott. To repeat myself here, I think that the
defconfig should show the users the best current practices.

> For security-related options it's usually best to default to the more
> secure state, especially since the option description talks about it
> being needed mainly for libc5 compatibility -- did libc5 ever even
> exist for powerpc?
> 
> The only reason it was turned on in the first place was likely the
> "default y", which in turn is there to avoid breaking old x86 distros.

I'm including both Paul and BenH here.


Regards, Rogério Brito.

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19  2:53       ` Rogério Brito
@ 2008-10-19  3:16         ` Rogério Brito
  2008-10-19 20:59         ` Guennadi Liakhovetski
  1 sibling, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-19  3:16 UTC (permalink / raw)
  To: Scott Wood
  Cc: linux-kernel, rbrito, linuxppc-dev, paulus, akpm, Guennadi Liakhovetski

Hi again.

On Oct 18 2008, Rogério Brito wrote:
> And it seems that there is something not quite right for these embedded
> systems. Here is something that I get with a vanilla linkstation_defconfig:
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(...)
> I just saw that in the default config:
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # CONFIG_PPC_CLOCK is not set
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> Maybe this should be enabled? I can iterate once more to see if this
> option would make any difference here.

Even if I enable this option, I still get the same problem as above. :-(


Regards, Rogério Brito.

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19  2:53       ` Rogério Brito
  2008-10-19  3:16         ` Rogério Brito
@ 2008-10-19 20:59         ` Guennadi Liakhovetski
  2008-10-19 21:32           ` Jon Smirl
  1 sibling, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-19 20:59 UTC (permalink / raw)
  To: Rogério Brito; +Cc: Scott Wood, linuxppc-dev

(modified the cc-list somewhat)

On Sat, 18 Oct 2008, Rog=E9rio Brito wrote:

> systems. Here is something that I get with a vanilla linkstation_defconfi=
g:
>=20
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>=20
> This gets me (with bootlogd enabled):
>=20
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Wed Dec 31 21:00:15 1969: Cannot access the Hardware Clock via any known =
method.
> Wed Dec 31 21:00:15 1969: Use the --debug option to see the details of ou=
r search for an access method.
> Wed Dec 31 21:00:15 1969: Unable to set System Clock to: Thu Jan 1 00:00:=
15 UTC 1970 ^[[33m(warning).^[[39;49m
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Yes, there seems to be a problem here now. The i2c adapter does not get=20
probed, i.e., of-matching doesn't work. A quick look through other=20
device-trees, using the same i2c driver, through git-logs of the i2c=20
driver and the dts didn't bring me to a solution. Can anyone spot what's=20
wrong with kuroboxHG.dts? lsprop output looks reasonable. Last working=20
kernel was 2.6.25-rc6-ish.

> I just saw that in the default config:
>=20
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # CONFIG_PPC_CLOCK is not set
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

No, kurobox uses generic RTC class.

Thanks for the report
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 20:59         ` Guennadi Liakhovetski
@ 2008-10-19 21:32           ` Jon Smirl
  2008-10-19 21:49             ` Guennadi Liakhovetski
  0 siblings, 1 reply; 27+ messages in thread
From: Jon Smirl @ 2008-10-19 21:32 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, Oct 19, 2008 at 4:59 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> (modified the cc-list somewhat)
>
> On Sat, 18 Oct 2008, Rog=E9rio Brito wrote:
>
>> systems. Here is something that I get with a vanilla linkstation_defconf=
ig:
>>
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> This gets me (with bootlogd enabled):
>>
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> Wed Dec 31 21:00:15 1969: Cannot access the Hardware Clock via any known=
 method.
>> Wed Dec 31 21:00:15 1969: Use the --debug option to see the details of o=
ur search for an access method.
>> Wed Dec 31 21:00:15 1969: Unable to set System Clock to: Thu Jan 1 00:00=
:15 UTC 1970 ^[[33m(warning).^[[39;49m
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> Yes, there seems to be a problem here now. The i2c adapter does not get
> probed, i.e., of-matching doesn't work. A quick look through other
> device-trees, using the same i2c driver, through git-logs of the i2c
> driver and the dts didn't bring me to a solution. Can anyone spot what's
> wrong with kuroboxHG.dts? lsprop output looks reasonable. Last working
> kernel was 2.6.25-rc6-ish.
>
>> I just saw that in the default config:
>>
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> # CONFIG_PPC_CLOCK is not set
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> No, kurobox uses generic RTC class.

I don't see anything obviously wrong.

Is rtc-rs5c372 built into your kernel?

You may need to add some debug statements in drivers/of/of_i2c.c to
figure out what is wrong.
It could be something like a _ not matching a -.


>
> Thanks for the report
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
>



--=20
Jon Smirl
jonsmirl@gmail.com

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 21:32           ` Jon Smirl
@ 2008-10-19 21:49             ` Guennadi Liakhovetski
  2008-10-19 22:05               ` Jon Smirl
  0 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-19 21:49 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, 19 Oct 2008, Jon Smirl wrote:

> On Sun, Oct 19, 2008 at 4:59 PM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> >
> > Yes, there seems to be a problem here now. The i2c adapter does not get
> > probed, i.e., of-matching doesn't work. A quick look through other
> > device-trees, using the same i2c driver, through git-logs of the i2c
> > driver and the dts didn't bring me to a solution. Can anyone spot what's
> > wrong with kuroboxHG.dts? lsprop output looks reasonable. Last working
> > kernel was 2.6.25-rc6-ish.
> >
> >> I just saw that in the default config:
> >>
> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >> # CONFIG_PPC_CLOCK is not set
> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >
> > No, kurobox uses generic RTC class.
> 
> I don't see anything obviously wrong.
> 
> Is rtc-rs5c372 built into your kernel?
> 
> You may need to add some debug statements in drivers/of/of_i2c.c to
> figure out what is wrong.
> It could be something like a _ not matching a -.

Above I said:

> > Yes, there seems to be a problem here now. The i2c adapter does not get
> > probed, i.e., of-matching doesn't work. A quick look through other

i.e., i2c-mpc is not matched against its fdt-node, not the rtc.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 21:49             ` Guennadi Liakhovetski
@ 2008-10-19 22:05               ` Jon Smirl
  2008-10-19 22:28                 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 27+ messages in thread
From: Jon Smirl @ 2008-10-19 22:05 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, Oct 19, 2008 at 5:49 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Sun, 19 Oct 2008, Jon Smirl wrote:
>
>> On Sun, Oct 19, 2008 at 4:59 PM, Guennadi Liakhovetski
>> <g.liakhovetski@gmx.de> wrote:
>> >
>> > Yes, there seems to be a problem here now. The i2c adapter does not get
>> > probed, i.e., of-matching doesn't work. A quick look through other
>> > device-trees, using the same i2c driver, through git-logs of the i2c
>> > driver and the dts didn't bring me to a solution. Can anyone spot what's
>> > wrong with kuroboxHG.dts? lsprop output looks reasonable. Last working
>> > kernel was 2.6.25-rc6-ish.
>> >
>> >> I just saw that in the default config:
>> >>
>> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> >> # CONFIG_PPC_CLOCK is not set
>> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> >
>> > No, kurobox uses generic RTC class.
>>
>> I don't see anything obviously wrong.
>>
>> Is rtc-rs5c372 built into your kernel?
>>
>> You may need to add some debug statements in drivers/of/of_i2c.c to
>> figure out what is wrong.
>> It could be something like a _ not matching a -.
>
> Above I said:
>
>> > Yes, there seems to be a problem here now. The i2c adapter does not get
>> > probed, i.e., of-matching doesn't work. A quick look through other
>
> i.e., i2c-mpc is not matched against its fdt-node, not the rtc.

i2c-mpc.c has:

static const struct of_device_id mpc_i2c_of_match[] = {
	{.compatible = "fsl-i2c",},
	{},
};
MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);


/* Structure for a device driver */
static struct of_platform_driver mpc_i2c_driver = {
	.match_table	= mpc_i2c_of_match,
	.probe		= fsl_i2c_probe,
	.remove		= __devexit_p(fsl_i2c_remove),
	.driver		= {
		.owner	= THIS_MODULE,
		.name	= DRV_NAME,
	},
};

That should match:

		i2c@80003000 {
			#address-cells = <1>;
			#size-cells = <0>;
			cell-index = <0>;
			compatible = "fsl-i2c";
			reg = <0x80003000 0x1000>;
			interrupts = <5 2>;
			interrupt-parent = <&mpic>;

			rtc@32 {
				device_type = "rtc";
				compatible = "ricoh,rs5c372a";
				reg = <0x32>;
			};
		};

This code works on my mpc5200 board.

Maybe fsl_i2c_probe() is failing?

Add some printks in i2c-mpc to help debug the problem.
Any errors from i2c-mpc in dmesg?


>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
>



-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 22:05               ` Jon Smirl
@ 2008-10-19 22:28                 ` Guennadi Liakhovetski
  2008-10-19 22:40                   ` Jon Smirl
  2008-10-21 15:16                   ` [PATCH] powerpc: enable heap randomization for linkstations Scott Wood
  0 siblings, 2 replies; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-19 22:28 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, 19 Oct 2008, Jon Smirl wrote:

> i2c-mpc.c has:
> 
> static const struct of_device_id mpc_i2c_of_match[] = {
> 	{.compatible = "fsl-i2c",},
> 	{},
> };
> MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
> 
> 
> /* Structure for a device driver */
> static struct of_platform_driver mpc_i2c_driver = {
> 	.match_table	= mpc_i2c_of_match,
> 	.probe		= fsl_i2c_probe,
> 	.remove		= __devexit_p(fsl_i2c_remove),
> 	.driver		= {
> 		.owner	= THIS_MODULE,
> 		.name	= DRV_NAME,
> 	},
> };
> 
> That should match:
> 
> 		i2c@80003000 {
> 			#address-cells = <1>;
> 			#size-cells = <0>;
> 			cell-index = <0>;
> 			compatible = "fsl-i2c";
> 			reg = <0x80003000 0x1000>;
> 			interrupts = <5 2>;
> 			interrupt-parent = <&mpic>;
> 
> 			rtc@32 {
> 				device_type = "rtc";
> 				compatible = "ricoh,rs5c372a";
> 				reg = <0x32>;
> 			};
> 		};

It should, but it doesn't.

> This code works on my mpc5200 board.

Don't know which 5200 board you have, but, for example lite5200 has

			compatible = "fsl,mpc5200-i2c","fsl-i2c";

see the difference?

> Maybe fsl_i2c_probe() is failing?

It has a printk at each error case (ok, except kzalloc, but I don't think 
that is the case), I see none of them.

> Add some printks in i2c-mpc to help debug the problem.
> Any errors from i2c-mpc in dmesg?

None, and, as I said, there are no error messages from it, so, it doesn't 
get called at all. To be quite sure I added a printk at the entry - as 
expected it didn't get printed.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 22:28                 ` Guennadi Liakhovetski
@ 2008-10-19 22:40                   ` Jon Smirl
  2008-10-20  5:55                     ` Guennadi Liakhovetski
  2008-10-21 15:16                   ` [PATCH] powerpc: enable heap randomization for linkstations Scott Wood
  1 sibling, 1 reply; 27+ messages in thread
From: Jon Smirl @ 2008-10-19 22:40 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, Oct 19, 2008 at 6:28 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Sun, 19 Oct 2008, Jon Smirl wrote:
>
>> i2c-mpc.c has:
>>
>> static const struct of_device_id mpc_i2c_of_match[] = {
>>       {.compatible = "fsl-i2c",},
>>       {},
>> };
>> MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
>>
>>
>> /* Structure for a device driver */
>> static struct of_platform_driver mpc_i2c_driver = {
>>       .match_table    = mpc_i2c_of_match,
>>       .probe          = fsl_i2c_probe,
>>       .remove         = __devexit_p(fsl_i2c_remove),
>>       .driver         = {
>>               .owner  = THIS_MODULE,
>>               .name   = DRV_NAME,
>>       },
>> };
>>
>> That should match:
>>
>>               i2c@80003000 {
>>                       #address-cells = <1>;
>>                       #size-cells = <0>;
>>                       cell-index = <0>;
>>                       compatible = "fsl-i2c";
>>                       reg = <0x80003000 0x1000>;
>>                       interrupts = <5 2>;
>>                       interrupt-parent = <&mpic>;
>>
>>                       rtc@32 {
>>                               device_type = "rtc";
>>                               compatible = "ricoh,rs5c372a";
>>                               reg = <0x32>;
>>                       };
>>               };
>
> It should, but it doesn't.
>
>> This code works on my mpc5200 board.
>
> Don't know which 5200 board you have, but, for example lite5200 has
>
>                        compatible = "fsl,mpc5200-i2c","fsl-i2c";
>
> see the difference?
>
>> Maybe fsl_i2c_probe() is failing?
>
> It has a printk at each error case (ok, except kzalloc, but I don't think
> that is the case), I see none of them.
>
>> Add some printks in i2c-mpc to help debug the problem.
>> Any errors from i2c-mpc in dmesg?
>
> None, and, as I said, there are no error messages from it, so, it doesn't
> get called at all. To be quite sure I added a printk at the entry - as
> expected it didn't get printed.

Is i2c-mpc built into your kernel? It's not going to module auto-load
because the names don't match - fsl-i2c and i2c-mpc.

But a message on init and make sure it is loading.
static int __init fsl_i2c_init(void)
{
	int rv;

	rv = of_register_platform_driver(&mpc_i2c_driver);
	if (rv)
		printk(KERN_ERR DRV_NAME
		       " of_register_platform_driver failed (%i)\n", rv);
	return rv;
}

>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
>



-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 22:40                   ` Jon Smirl
@ 2008-10-20  5:55                     ` Guennadi Liakhovetski
  2008-10-20 12:19                       ` Jon Smirl
  0 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-20  5:55 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Sun, 19 Oct 2008, Jon Smirl wrote:

> Is i2c-mpc built into your kernel? It's not going to module auto-load
> because the names don't match - fsl-i2c and i2c-mpc.

It is built into the kernel.

Thanks
Guennadi

> 
> But a message on init and make sure it is loading.
> static int __init fsl_i2c_init(void)
> {
> 	int rv;
> 
> 	rv = of_register_platform_driver(&mpc_i2c_driver);
> 	if (rv)
> 		printk(KERN_ERR DRV_NAME
> 		       " of_register_platform_driver failed (%i)\n", rv);
> 	return rv;
> }
> 
> >
> > Thanks
> > Guennadi
> > ---
> > Guennadi Liakhovetski, Ph.D.
> > Freelance Open-Source Software Developer
> >
> 
> 
> 
> -- 
> Jon Smirl
> jonsmirl@gmail.com
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-20  5:55                     ` Guennadi Liakhovetski
@ 2008-10-20 12:19                       ` Jon Smirl
  2008-10-21  6:42                         ` [REGRESSION 2.6.27] i2c-mpc not probing on linkstation (was Re: [PATCH] powerpc: enable heap randomization for linkstations) Guennadi Liakhovetski
  0 siblings, 1 reply; 27+ messages in thread
From: Jon Smirl @ 2008-10-20 12:19 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Mon, Oct 20, 2008 at 1:55 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Sun, 19 Oct 2008, Jon Smirl wrote:
>
>> Is i2c-mpc built into your kernel? It's not going to module auto-load
>> because the names don't match - fsl-i2c and i2c-mpc.
>
> It is built into the kernel.

Put a printk in it's init function to make sure it is initializing.

Next thing I do is put printks over in arch/powerpc/.. to tell me
which strings from the device tree are being looked for.

You can also look in /proc/device_tree and make sure fsl-i2c is in there.

When you find the problem is will probably be something simple like a
mismatch between _ and -. I have been down this path before and spent
a day figuring out why a module wouldn't load and it was a simple
typo.

>
> Thanks
> Guennadi
>
>>
>> But a message on init and make sure it is loading.
>> static int __init fsl_i2c_init(void)
>> {
>>       int rv;
>>
>>       rv = of_register_platform_driver(&mpc_i2c_driver);
>>       if (rv)
>>               printk(KERN_ERR DRV_NAME
>>                      " of_register_platform_driver failed (%i)\n", rv);
>>       return rv;
>> }
>>
>> >
>> > Thanks
>> > Guennadi
>> > ---
>> > Guennadi Liakhovetski, Ph.D.
>> > Freelance Open-Source Software Developer
>> >
>>
>>
>>
>> --
>> Jon Smirl
>> jonsmirl@gmail.com
>>
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
>



-- 
Jon Smirl
jonsmirl@gmail.com

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

* [REGRESSION 2.6.27] i2c-mpc not probing on linkstation (was Re: [PATCH] powerpc: enable heap randomization for linkstations)
  2008-10-20 12:19                       ` Jon Smirl
@ 2008-10-21  6:42                         ` Guennadi Liakhovetski
  2008-10-21  7:19                           ` [REGRESSION 2.6.27] i2c-mpc not probing on linkstation Rogério Brito
  0 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-21  6:42 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Rogério Brito, Scott Wood, linuxppc-dev

On Mon, 20 Oct 2008, Jon Smirl wrote:

> On Mon, Oct 20, 2008 at 1:55 AM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> > On Sun, 19 Oct 2008, Jon Smirl wrote:
> >
> >> Is i2c-mpc built into your kernel? It's not going to module auto-load
> >> because the names don't match - fsl-i2c and i2c-mpc.
> >
> > It is built into the kernel.
> 
> Put a printk in it's init function to make sure it is initializing.

I don't need that, I see it here:

/sys/bus/of_platform/drivers/mpc-i2c

> Next thing I do is put printks over in arch/powerpc/.. to tell me
> which strings from the device tree are being looked for.
> 
> You can also look in /proc/device_tree and make sure fsl-i2c is in there.
> 
> When you find the problem is will probably be something simple like a
> mismatch between _ and -. I have been down this path before and spent
> a day figuring out why a module wouldn't load and it was a simple
> typo.

Thanks, I know, that I can find the reason and, probably, a fix after a 
day of printk debugging. The thing is - I don't have this day, and I am 
sure there are people on this list, who can spot and fix the problem 
within minutes, that's why I posted it here after I realised, that 2 hours 
of me searching for the problem didn't bring any result.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [REGRESSION 2.6.27] i2c-mpc not probing on linkstation
  2008-10-21  6:42                         ` [REGRESSION 2.6.27] i2c-mpc not probing on linkstation (was Re: [PATCH] powerpc: enable heap randomization for linkstations) Guennadi Liakhovetski
@ 2008-10-21  7:19                           ` Rogério Brito
  0 siblings, 0 replies; 27+ messages in thread
From: Rogério Brito @ 2008-10-21  7:19 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Scott Wood, linuxppc-dev

On Oct 21 2008, Guennadi Liakhovetski wrote:
> On Mon, 20 Oct 2008, Jon Smirl wrote:
> > Put a printk in it's init function to make sure it is initializing.
> 
> I don't need that, I see it here:
> 
> /sys/bus/of_platform/drivers/mpc-i2c

I also see this:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lutz:/# tree /sys/bus/of_platform/drivers/mpc-i2c/
/sys/bus/of_platform/drivers/mpc-i2c/
|-- bind
|-- uevent
`-- unbind

0 directories, 3 files
lutz:/#
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

> > Next thing I do is put printks over in arch/powerpc/.. to tell me
> > which strings from the device tree are being looked for.
> > 
> > You can also look in /proc/device_tree and make sure fsl-i2c is in there.

Here is what I get in /proc/device_tree:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lutz:/proc/device-tree# tree
.
|-- #address-cells
|-- #size-cells
|-- aliases
|   |-- name
|   |-- pci0
|   |-- serial0
|   `-- serial1
|-- chosen
|   |-- bootargs
|   |-- linux,platform
|   |-- linux,stdout-path
|   `-- name
|-- compatible
|-- cpus
|   |-- #address-cells
|   |-- #size-cells
|   |-- PowerPC,603e
|   |   |-- bus-frequency
|   |   |-- clock-frequency
|   |   |-- d-cache-size
|   |   |-- device_type
|   |   |-- i-cache-size
|   |   |-- name
|   |   |-- reg
|   |   `-- timebase-frequency
|   `-- name
|-- memory
|   |-- device_type
|   |-- name
|   `-- reg
|-- model
|-- name
`-- soc10x
    |-- #address-cells
    |-- #size-cells
    |-- compatible
    |-- device_type
    |-- i2c@80003000
    |   |-- #address-cells
    |   |-- #size-cells
    |   |-- cell-index
    |   |-- compatible
    |   |-- interrupt-parent
    |   |-- interrupts
    |   |-- name
    |   |-- reg
    |   `-- rtc@32
    |       |-- compatible
    |       |-- device_type
    |       |-- name
    |       `-- reg
    |-- interrupt-controller@80040000
    |   |-- #address-cells
    |   |-- #interrupt-cells
    |   |-- compatible
    |   |-- device_type
    |   |-- interrupt-controller
    |   |-- linux,phandle
    |   |-- name
    |   `-- reg
    |-- name
    |-- pci@fec00000
    |   |-- #address-cells
    |   |-- #interrupt-cells
    |   |-- #size-cells
    |   |-- bus-range
    |   |-- clock-frequency
    |   |-- compatible
    |   |-- device_type
    |   |-- interrupt-map
    |   |-- interrupt-map-mask
    |   |-- interrupt-parent
    |   |-- name
    |   |-- ranges
    |   `-- reg
    |-- ranges
    |-- reg
    |-- serial@80004500
    |   |-- cell-index
    |   |-- clock-frequency
    |   |-- compatible
    |   |-- current-speed
    |   |-- device_type
    |   |-- interrupt-parent
    |   |-- interrupts
    |   |-- name
    |   `-- reg
    |-- serial@80004600
    |   |-- cell-index
    |   |-- clock-frequency
    |   |-- compatible
    |   |-- current-speed
    |   |-- device_type
    |   |-- interrupt-parent
    |   |-- interrupts
    |   |-- name
    |   `-- reg
    `-- store-gathering

12 directories, 86 files
lutz:/proc/device-tree# 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Under that I see:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
lutz:/proc/device-tree# grep -r -i fsl .
Binary file ./soc10x/i2c@80003000/compatible matches
lutz:/proc/device-tree# 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The contents of that file:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
fsl-i2c^@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Is there any further information that I can provide so that we can get
things fixed?

Thanks,

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-19 22:28                 ` Guennadi Liakhovetski
  2008-10-19 22:40                   ` Jon Smirl
@ 2008-10-21 15:16                   ` Scott Wood
  2008-10-21 15:26                     ` Guennadi Liakhovetski
  1 sibling, 1 reply; 27+ messages in thread
From: Scott Wood @ 2008-10-21 15:16 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, linuxppc-dev

On Mon, Oct 20, 2008 at 12:28:09AM +0200, Guennadi Liakhovetski wrote:
> On Sun, 19 Oct 2008, Jon Smirl wrote:
> > That should match:
> > 
> > 		i2c@80003000 {
> > 			#address-cells = <1>;
> > 			#size-cells = <0>;
> > 			cell-index = <0>;
> > 			compatible = "fsl-i2c";
> > 			reg = <0x80003000 0x1000>;
> > 			interrupts = <5 2>;
> > 			interrupt-parent = <&mpic>;
> > 
> > 			rtc@32 {
> > 				device_type = "rtc";
> > 				compatible = "ricoh,rs5c372a";
> > 				reg = <0x32>;
> > 			};
> > 		};
> 
> It should, but it doesn't.

Is the parent of the i2c node covered by the list passed to
of_platform_bus_probe() on this board?

-Scott

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-21 15:16                   ` [PATCH] powerpc: enable heap randomization for linkstations Scott Wood
@ 2008-10-21 15:26                     ` Guennadi Liakhovetski
  2008-10-21 15:32                       ` Scott Wood
  0 siblings, 1 reply; 27+ messages in thread
From: Guennadi Liakhovetski @ 2008-10-21 15:26 UTC (permalink / raw)
  To: Scott Wood; +Cc: Rogério Brito, linuxppc-dev

On Tue, 21 Oct 2008, Scott Wood wrote:

> On Mon, Oct 20, 2008 at 12:28:09AM +0200, Guennadi Liakhovetski wrote:
> > On Sun, 19 Oct 2008, Jon Smirl wrote:
> > > That should match:
> > > 
> > > 		i2c@80003000 {
> > > 			#address-cells = <1>;
> > > 			#size-cells = <0>;
> > > 			cell-index = <0>;
> > > 			compatible = "fsl-i2c";
> > > 			reg = <0x80003000 0x1000>;
> > > 			interrupts = <5 2>;
> > > 			interrupt-parent = <&mpic>;
> > > 
> > > 			rtc@32 {
> > > 				device_type = "rtc";
> > > 				compatible = "ricoh,rs5c372a";
> > > 				reg = <0x32>;
> > > 			};
> > > 		};
> > 
> > It should, but it doesn't.
> 
> Is the parent of the i2c node covered by the list passed to
> of_platform_bus_probe() on this board?

You mean something like this:

static __initdata struct of_device_id storcenter_of_bus[] = {
        { .name = "soc", },
        {},
};

static int __init storcenter_device_probe(void)
{
        of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
        return 0;
}
machine_device_initcall(storcenter, storcenter_device_probe);

? No, linkstation doesn't do that. Somehow, as this API has been 
introduced, linkstation has been left aside:-(

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-21 15:26                     ` Guennadi Liakhovetski
@ 2008-10-21 15:32                       ` Scott Wood
  0 siblings, 0 replies; 27+ messages in thread
From: Scott Wood @ 2008-10-21 15:32 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Rogério Brito, linuxppc-dev

Guennadi Liakhovetski wrote:
> static __initdata struct of_device_id storcenter_of_bus[] = {
>         { .name = "soc", },
>         {},
> };

Add .compatible = "simple-bus" to the list.

> static int __init storcenter_device_probe(void)
> {
>         of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
>         return 0;
> }
> machine_device_initcall(storcenter, storcenter_device_probe);
> 
> ? No, linkstation doesn't do that. Somehow, as this API has been 
> introduced, linkstation has been left aside:-(

This is almost as much of a FAQ as interrupt mapping...  I'm wondering 
if we should have stuck with a default list, and added a call to 
of_platform_bus_probe by common code that could be overridden by some 
board flag if really necessary, rather than have a bunch of 
duplication-with-mutation in the platform files.

-Scott

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

* Re: [PATCH] powerpc: compile kernel for linkstations optimized for size
  2008-10-13  4:07 [PATCH] powerpc: compile kernel for linkstations optimized for size Rogério Brito
                   ` (2 preceding siblings ...)
  2008-10-17  9:37 ` Rogério Brito
@ 2008-10-28 13:58 ` Kumar Gala
  3 siblings, 0 replies; 27+ messages in thread
From: Kumar Gala @ 2008-10-28 13:58 UTC (permalink / raw)
  To: Rogério Brito; +Cc: linuxppc-dev, akpm, linux-kernel


On Oct 12, 2008, at 11:07 PM, Rog=E9rio Brito wrote:

> From: Rog=E9rio Brito <rbrito@ime.usp.br>
>
> Since Linkstations and Kuroboxes often have *very* little memory (as
> they are embedded systems), it is desirable to get their kernels
> compiled optimized for size.
>
> Signed-off-by: Rog=E9rio Brito <rbrito@ime.usp.br>
>
> ---

applied to merge.

- k=

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

* Re: [PATCH] powerpc: enable heap randomization for linkstations
  2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
  2008-10-13 18:05   ` Guennadi Liakhovetski
  2008-10-17  9:38   ` Rogério Brito
@ 2008-10-28 13:58   ` Kumar Gala
  2 siblings, 0 replies; 27+ messages in thread
From: Kumar Gala @ 2008-10-28 13:58 UTC (permalink / raw)
  To: Rogério Brito; +Cc: linuxppc-dev, akpm, linux-kernel


On Oct 12, 2008, at 11:51 PM, Rog=E9rio Brito wrote:

> The current defconfig for Linkstation/Kuroboxes has the "Disable Heap
> Randomization" option enabled.
>
> Since some of these machines are facing the internet, it helps to have
> heap randomization enabled. This patch enables it.
>
>
> Signed-off-by: Rog=E9rio Brito <rbrito@ime.usp.br>
>
> ---


applied to merge.

- k=

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

end of thread, other threads:[~2008-10-28 13:59 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-13  4:07 [PATCH] powerpc: compile kernel for linkstations optimized for size Rogério Brito
2008-10-13  4:51 ` [PATCH] powerpc: enable heap randomization for linkstations Rogério Brito
2008-10-13 18:05   ` Guennadi Liakhovetski
2008-10-13 18:44     ` Scott Wood
2008-10-13 19:27       ` Guennadi Liakhovetski
2008-10-13 20:56       ` Rogério Brito
2008-10-19  2:53       ` Rogério Brito
2008-10-19  3:16         ` Rogério Brito
2008-10-19 20:59         ` Guennadi Liakhovetski
2008-10-19 21:32           ` Jon Smirl
2008-10-19 21:49             ` Guennadi Liakhovetski
2008-10-19 22:05               ` Jon Smirl
2008-10-19 22:28                 ` Guennadi Liakhovetski
2008-10-19 22:40                   ` Jon Smirl
2008-10-20  5:55                     ` Guennadi Liakhovetski
2008-10-20 12:19                       ` Jon Smirl
2008-10-21  6:42                         ` [REGRESSION 2.6.27] i2c-mpc not probing on linkstation (was Re: [PATCH] powerpc: enable heap randomization for linkstations) Guennadi Liakhovetski
2008-10-21  7:19                           ` [REGRESSION 2.6.27] i2c-mpc not probing on linkstation Rogério Brito
2008-10-21 15:16                   ` [PATCH] powerpc: enable heap randomization for linkstations Scott Wood
2008-10-21 15:26                     ` Guennadi Liakhovetski
2008-10-21 15:32                       ` Scott Wood
2008-10-17  9:38   ` Rogério Brito
2008-10-28 13:58   ` Kumar Gala
2008-10-13 18:03 ` [PATCH] powerpc: compile kernel for linkstations optimized for size Guennadi Liakhovetski
2008-10-13 21:28   ` Rogério Brito
2008-10-17  9:37 ` Rogério Brito
2008-10-28 13:58 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).