* page size change on MIPS
@ 2011-01-24 15:02 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-24 15:02 UTC (permalink / raw)
To: linux-mips, kernelnewbies
Hi All,
we are using mips32r2 so I want to know which all pages size it can support?
When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
size. but hang/not boot crash when change page size to 8KB,32KB and 64
KB.
We are using 2.6.30 kernel.
At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
init/initramfs.c
64KB it hangs when execute init Kernel panic - not syncing: Attempted
to kill init!
config PAGE_SIZE_4KB
bool "4kB"
help
This option select the standard 4kB Linux page size. On some
R3000-family processors this is the only available page size. Using
4kB page size will minimize memory consumption and is therefore
recommended for low memory systems.
config PAGE_SIZE_8KB
bool "8kB"
depends on (EXPERIMENTAL && CPU_R8000) || CPU_CAVIUM_OCTEON
help
Using 8kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available
only on R8000 and cnMIPS processors. Note that you will need a
suitable Linux distribution to support this.
config PAGE_SIZE_16KB
bool "16kB"
depends on !CPU_R3000 && !CPU_TX39XX
help
Using 16kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available on
all non-R3000 family processors. Note that you will need a suitable
Linux distribution to support this.
config PAGE_SIZE_32KB
bool "32kB"
help
Using 32kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available
only on cnMIPS cores. Note that you will need a suitable Linux
distribution to support this.
config PAGE_SIZE_64KB
bool "64kB"
depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
help
Using 64kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available on
all non-R3000 family processor. Not that at the time of this
writing this option is still high experimental.
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-24 15:02 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-24 15:02 UTC (permalink / raw)
To: kernelnewbies
Hi All,
we are using mips32r2 so I want to know which all pages size it can support?
When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
size. but hang/not boot crash when change page size to 8KB,32KB and 64
KB.
We are using 2.6.30 kernel.
At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
init/initramfs.c
64KB it hangs when execute init Kernel panic - not syncing: Attempted
to kill init!
config PAGE_SIZE_4KB
bool "4kB"
help
This option select the standard 4kB Linux page size. On some
R3000-family processors this is the only available page size. Using
4kB page size will minimize memory consumption and is therefore
recommended for low memory systems.
config PAGE_SIZE_8KB
bool "8kB"
depends on (EXPERIMENTAL && CPU_R8000) || CPU_CAVIUM_OCTEON
help
Using 8kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available
only on R8000 and cnMIPS processors. Note that you will need a
suitable Linux distribution to support this.
config PAGE_SIZE_16KB
bool "16kB"
depends on !CPU_R3000 && !CPU_TX39XX
help
Using 16kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available on
all non-R3000 family processors. Note that you will need a suitable
Linux distribution to support this.
config PAGE_SIZE_32KB
bool "32kB"
help
Using 32kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available
only on cnMIPS cores. Note that you will need a suitable Linux
distribution to support this.
config PAGE_SIZE_64KB
bool "64kB"
depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
help
Using 64kB page size will result in higher performance kernel at
the price of higher memory consumption. This option is available on
all non-R3000 family processor. Not that at the time of this
writing this option is still high experimental.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-24 15:02 ` naveen yadav
@ 2011-01-24 18:56 ` David Daney
-1 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-24 18:56 UTC (permalink / raw)
To: naveen yadav; +Cc: linux-mips, kernelnewbies
On 01/24/2011 07:02 AM, naveen yadav wrote:
> Hi All,
>
>
> we are using mips32r2 so I want to know which all pages size it can support?
> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
> size. but hang/not boot crash when change page size to 8KB,32KB and 64
> KB.
I don't think 8KB and 32KB work on most mips32r2 processors. You would
have to check the processor manual to be sure.
>
> We are using 2.6.30 kernel.
>
> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
> init/initramfs.c
>
> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
> to kill init!
I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
you run with a broken uClibc toolchain that doesn't support larger
pages, it will of course fail. In this case the problem is with your
toolchain, not the kernel.
David Daney
>
> config PAGE_SIZE_4KB
> bool "4kB"
> help
> This option select the standard 4kB Linux page size. On some
> R3000-family processors this is the only available page size. Using
> 4kB page size will minimize memory consumption and is therefore
> recommended for low memory systems.
>
> config PAGE_SIZE_8KB
> bool "8kB"
> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
> help
> Using 8kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available
> only on R8000 and cnMIPS processors. Note that you will need a
> suitable Linux distribution to support this.
>
> config PAGE_SIZE_16KB
> bool "16kB"
> depends on !CPU_R3000&& !CPU_TX39XX
> help
> Using 16kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available on
> all non-R3000 family processors. Note that you will need a suitable
> Linux distribution to support this.
>
> config PAGE_SIZE_32KB
> bool "32kB"
> help
> Using 32kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available
> only on cnMIPS cores. Note that you will need a suitable Linux
> distribution to support this.
>
> config PAGE_SIZE_64KB
> bool "64kB"
> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
> help
> Using 64kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available on
> all non-R3000 family processor. Not that at the time of this
> writing this option is still high experimental.
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-24 18:56 ` David Daney
0 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-24 18:56 UTC (permalink / raw)
To: kernelnewbies
On 01/24/2011 07:02 AM, naveen yadav wrote:
> Hi All,
>
>
> we are using mips32r2 so I want to know which all pages size it can support?
> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
> size. but hang/not boot crash when change page size to 8KB,32KB and 64
> KB.
I don't think 8KB and 32KB work on most mips32r2 processors. You would
have to check the processor manual to be sure.
>
> We are using 2.6.30 kernel.
>
> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
> init/initramfs.c
>
> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
> to kill init!
I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
you run with a broken uClibc toolchain that doesn't support larger
pages, it will of course fail. In this case the problem is with your
toolchain, not the kernel.
David Daney
>
> config PAGE_SIZE_4KB
> bool "4kB"
> help
> This option select the standard 4kB Linux page size. On some
> R3000-family processors this is the only available page size. Using
> 4kB page size will minimize memory consumption and is therefore
> recommended for low memory systems.
>
> config PAGE_SIZE_8KB
> bool "8kB"
> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
> help
> Using 8kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available
> only on R8000 and cnMIPS processors. Note that you will need a
> suitable Linux distribution to support this.
>
> config PAGE_SIZE_16KB
> bool "16kB"
> depends on !CPU_R3000&& !CPU_TX39XX
> help
> Using 16kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available on
> all non-R3000 family processors. Note that you will need a suitable
> Linux distribution to support this.
>
> config PAGE_SIZE_32KB
> bool "32kB"
> help
> Using 32kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available
> only on cnMIPS cores. Note that you will need a suitable Linux
> distribution to support this.
>
> config PAGE_SIZE_64KB
> bool "64kB"
> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
> help
> Using 64kB page size will result in higher performance kernel at
> the price of higher memory consumption. This option is available on
> all non-R3000 family processor. Not that at the time of this
> writing this option is still high experimental.
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-24 18:56 ` David Daney
@ 2011-01-24 19:13 ` Kevin D. Kissell
-1 siblings, 0 replies; 26+ messages in thread
From: Kevin D. Kissell @ 2011-01-24 19:13 UTC (permalink / raw)
To: David Daney; +Cc: naveen yadav, linux-mips, kernelnewbies
On 01/24/11 10:56, David Daney wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>> Hi All,
>>
>>
>> we are using mips32r2 so I want to know which all pages size it can
>> support?
>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. You
> would have to check the processor manual to be sure.
In principle, one should be able to detect this at run-time, by writing
a sequence of values into the PageMask register and seeing which masks
'stick'.
/K.
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-24 19:13 ` Kevin D. Kissell
0 siblings, 0 replies; 26+ messages in thread
From: Kevin D. Kissell @ 2011-01-24 19:13 UTC (permalink / raw)
To: kernelnewbies
On 01/24/11 10:56, David Daney wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>> Hi All,
>>
>>
>> we are using mips32r2 so I want to know which all pages size it can
>> support?
>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. You
> would have to check the processor manual to be sure.
In principle, one should be able to detect this at run-time, by writing
a sequence of values into the PageMask register and seeing which masks
'stick'.
/K.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-24 18:56 ` David Daney
@ 2011-01-27 14:55 ` naveen yadav
-1 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-27 14:55 UTC (permalink / raw)
To: David Daney; +Cc: linux-mips, kernelnewbies
Hi David,
thanks for your response.
I check and found that kernel is booting with 16KB page size with
ramdisk booting. But when I change to 64KB it give me
: applet not found
Kernel panic - not syncing: Attempted to kill init!
so I check and found that it is not able to execute well the system
call in kernel_execve function.
I am using codesourcercy toolchain(4.3.1). So is there a way to debug
this problem or how to debug below function.
int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
register unsigned long __a0 asm("$4") = (unsigned long) filename;
register unsigned long __a1 asm("$5") = (unsigned long) argv;
register unsigned long __a2 asm("$6") = (unsigned long) envp;
register unsigned long __a3 asm("$7");
unsigned long __v0;
__asm__ volatile (" \n"
" .set noreorder \n"
" li $2, %5 # __NR_execve \n"
" syscall \n"
" move %0, $2 \n"
" .set reorder \n"
: "=&r" (__v0), "=r" (__a3)
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
"memory");
if (__a3 == 0)
return __v0;
return -__v0;
}
On Tue, Jan 25, 2011 at 12:26 AM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>
>> Hi All,
>>
>>
>> we are using mips32r2 so I want to know which all pages size it can
>> support?
>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. You would have
> to check the processor manual to be sure.
>
>
>>
>> We are using 2.6.30 kernel.
>>
>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>> init/initramfs.c
>>
>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>> to kill init!
>
> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If you
> run with a broken uClibc toolchain that doesn't support larger pages, it
> will of course fail. In this case the problem is with your toolchain, not
> the kernel.
>
> David Daney
>
>
>>
>> config PAGE_SIZE_4KB
>> bool "4kB"
>> help
>> This option select the standard 4kB Linux page size. On some
>> R3000-family processors this is the only available page size.
>> Using
>> 4kB page size will minimize memory consumption and is therefore
>> recommended for low memory systems.
>>
>> config PAGE_SIZE_8KB
>> bool "8kB"
>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>> help
>> Using 8kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is
>> available
>> only on R8000 and cnMIPS processors. Note that you will need a
>> suitable Linux distribution to support this.
>>
>> config PAGE_SIZE_16KB
>> bool "16kB"
>> depends on !CPU_R3000&& !CPU_TX39XX
>> help
>> Using 16kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is
>> available on
>> all non-R3000 family processors. Note that you will need a
>> suitable
>> Linux distribution to support this.
>>
>> config PAGE_SIZE_32KB
>> bool "32kB"
>> help
>> Using 32kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is
>> available
>> only on cnMIPS cores. Note that you will need a suitable Linux
>> distribution to support this.
>>
>> config PAGE_SIZE_64KB
>> bool "64kB"
>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>> help
>> Using 64kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is
>> available on
>> all non-R3000 family processor. Not that at the time of this
>> writing this option is still high experimental.
>>
>>
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-27 14:55 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-27 14:55 UTC (permalink / raw)
To: kernelnewbies
Hi David,
thanks for your response.
I check and found that kernel is booting with 16KB page size with
ramdisk booting. But when I change to 64KB it give me
: applet not found
Kernel panic - not syncing: Attempted to kill init!
so I check and found that it is not able to execute well the system
call in kernel_execve function.
I am using codesourcercy toolchain(4.3.1). So is there a way to debug
this problem or how to debug below function.
int kernel_execve(const char *filename, char *const argv[], char *const envp[])
{
register unsigned long __a0 asm("$4") = (unsigned long) filename;
register unsigned long __a1 asm("$5") = (unsigned long) argv;
register unsigned long __a2 asm("$6") = (unsigned long) envp;
register unsigned long __a3 asm("$7");
unsigned long __v0;
__asm__ volatile (" \n"
" .set noreorder \n"
" li $2, %5 # __NR_execve \n"
" syscall \n"
" move %0, $2 \n"
" .set reorder \n"
: "=&r" (__v0), "=r" (__a3)
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
"memory");
if (__a3 == 0)
return __v0;
return -__v0;
}
On Tue, Jan 25, 2011 at 12:26 AM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>
>> Hi All,
>>
>>
>> we are using mips32r2 ?so I want to know which all pages size it can
>> support?
>> When I modify arch/mips/Kconfig. ?it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. ?You would have
> to check the processor manual to be sure.
>
>
>>
>> We are using 2.6.30 kernel.
>>
>> At Page Size 8KB and 32KB ?it hang in unpack_to_rootfs() function of
>> init/initramfs.c
>>
>> 64KB it hangs when execute init ?Kernel panic - not syncing: Attempted
>> to kill init!
>
> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. ?If you
> run with a broken uClibc toolchain that doesn't support larger pages, it
> will of course fail. ?In this case the problem is with your toolchain, not
> the kernel.
>
> David Daney
>
>
>>
>> config PAGE_SIZE_4KB
>> ? ? ? ? bool "4kB"
>> ? ? ? ? help
>> ? ? ? ? ?This option select the standard 4kB Linux page size. ?On some
>> ? ? ? ? ?R3000-family processors this is the only available page size.
>> ?Using
>> ? ? ? ? ?4kB page size will minimize memory consumption and is therefore
>> ? ? ? ? ?recommended for low memory systems.
>>
>> config PAGE_SIZE_8KB
>> ? ? ? ? bool "8kB"
>> ? ? ? ?depends on (EXPERIMENTAL&& ?CPU_R8000) || CPU_CAVIUM_OCTEON
>> ? ? ? ? help
>> ? ? ? ? ? Using 8kB page size will result in higher performance kernel at
>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>> available
>> ? ? ? ? ? only on R8000 and cnMIPS processors. ?Note that you will need a
>> ? ? ? ? ? suitable Linux distribution to support this.
>>
>> config PAGE_SIZE_16KB
>> ? ? ? ? bool "16kB"
>> ? ? ? ?depends on !CPU_R3000&& ?!CPU_TX39XX
>> ? ? ? ? help
>> ? ? ? ? ? Using 16kB page size will result in higher performance kernel at
>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>> available on
>> ? ? ? ? ? all non-R3000 family processors. ?Note that you will need a
>> suitable
>> ? ? ? ? ? Linux distribution to support this.
>>
>> config PAGE_SIZE_32KB
>> ? ? ? ? bool "32kB"
>> ? ? ? ? help
>> ? ? ? ? ? Using 32kB page size will result in higher performance kernel at
>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>> available
>> ? ? ? ? ? only on cnMIPS cores. ?Note that you will need a suitable Linux
>> ? ? ? ? ? distribution to support this.
>>
>> config PAGE_SIZE_64KB
>> ? ? ? ? bool "64kB"
>> ? ? ? ?depends on EXPERIMENTAL&& ?!CPU_R3000&& ?!CPU_TX39XX
>> ? ? ? ? help
>> ? ? ? ? ? Using 64kB page size will result in higher performance kernel at
>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>> available on
>> ? ? ? ? ? all non-R3000 family processor. ?Not that at the time of this
>> ? ? ? ? ? writing this option is still high experimental.
>>
>>
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-27 14:55 ` naveen yadav
(?)
@ 2011-01-27 15:18 ` adnan iqbal
2011-01-27 17:44 ` David Daney
-1 siblings, 1 reply; 26+ messages in thread
From: adnan iqbal @ 2011-01-27 15:18 UTC (permalink / raw)
To: naveen yadav; +Cc: David Daney, linux-mips, kernelnewbies
[-- Attachment #1: Type: text/plain, Size: 5968 bytes --]
Please try this. One line of code is added ( move %1, $7).
int kernel_execve(const char *filename, char *const argv[], char *const
envp[])
{
register unsigned long __a0 asm("$4") = (unsigned long) filename;
register unsigned long __a1 asm("$5") = (unsigned long) argv;
register unsigned long __a2 asm("$6") = (unsigned long) envp;
register unsigned long __a3 asm("$7");
unsigned long __v0;
__asm__ volatile (" \n"
" .set noreorder \n"
" li $2, %5 # __NR_execve \n"
" syscall \n"
" move %0, $2 \n"
" move %1, $7 \n"
" .set reorder \n"
: "=&r" (__v0), "=r" (__a3)
: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
"memory");
if (__a3 == 0)
return __v0;
return -__v0;
}
On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav <yad.naveen@gmail.com> wrote:
> Hi David,
>
> thanks for your response.
>
> I check and found that kernel is booting with 16KB page size with
> ramdisk booting. But when I change to 64KB it give me
>
> : applet not found
> Kernel panic - not syncing: Attempted to kill init!
> so I check and found that it is not able to execute well the system
> call in kernel_execve function.
> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
> this problem or how to debug below function.
>
> int kernel_execve(const char *filename, char *const argv[], char *const
> envp[])
> {
> register unsigned long __a0 asm("$4") = (unsigned long) filename;
> register unsigned long __a1 asm("$5") = (unsigned long) argv;
> register unsigned long __a2 asm("$6") = (unsigned long) envp;
> register unsigned long __a3 asm("$7");
> unsigned long __v0;
> __asm__ volatile (" \n"
> " .set noreorder \n"
> " li $2, %5 # __NR_execve \n"
> " syscall \n"
> " move %0, $2 \n"
> " .set reorder \n"
> : "=&r" (__v0), "=r" (__a3)
> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
> "memory");
>
>
> if (__a3 == 0)
> return __v0;
> return -__v0;
> }
>
>
> On Tue, Jan 25, 2011 at 12:26 AM, David Daney <ddaney@caviumnetworks.com>
> wrote:
> > On 01/24/2011 07:02 AM, naveen yadav wrote:
> >>
> >> Hi All,
> >>
> >>
> >> we are using mips32r2 so I want to know which all pages size it can
> >> support?
> >> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
> >> size. but hang/not boot crash when change page size to 8KB,32KB and 64
> >> KB.
> >
> > I don't think 8KB and 32KB work on most mips32r2 processors. You would
> have
> > to check the processor manual to be sure.
> >
> >
> >>
> >> We are using 2.6.30 kernel.
> >>
> >> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
> >> init/initramfs.c
> >>
> >> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
> >> to kill init!
> >
> > I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If you
> > run with a broken uClibc toolchain that doesn't support larger pages, it
> > will of course fail. In this case the problem is with your toolchain,
> not
> > the kernel.
> >
> > David Daney
> >
> >
> >>
> >> config PAGE_SIZE_4KB
> >> bool "4kB"
> >> help
> >> This option select the standard 4kB Linux page size. On some
> >> R3000-family processors this is the only available page size.
> >> Using
> >> 4kB page size will minimize memory consumption and is therefore
> >> recommended for low memory systems.
> >>
> >> config PAGE_SIZE_8KB
> >> bool "8kB"
> >> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
> >> help
> >> Using 8kB page size will result in higher performance kernel
> at
> >> the price of higher memory consumption. This option is
> >> available
> >> only on R8000 and cnMIPS processors. Note that you will need
> a
> >> suitable Linux distribution to support this.
> >>
> >> config PAGE_SIZE_16KB
> >> bool "16kB"
> >> depends on !CPU_R3000&& !CPU_TX39XX
> >> help
> >> Using 16kB page size will result in higher performance kernel
> at
> >> the price of higher memory consumption. This option is
> >> available on
> >> all non-R3000 family processors. Note that you will need a
> >> suitable
> >> Linux distribution to support this.
> >>
> >> config PAGE_SIZE_32KB
> >> bool "32kB"
> >> help
> >> Using 32kB page size will result in higher performance kernel
> at
> >> the price of higher memory consumption. This option is
> >> available
> >> only on cnMIPS cores. Note that you will need a suitable
> Linux
> >> distribution to support this.
> >>
> >> config PAGE_SIZE_64KB
> >> bool "64kB"
> >> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
> >> help
> >> Using 64kB page size will result in higher performance kernel
> at
> >> the price of higher memory consumption. This option is
> >> available on
> >> all non-R3000 family processor. Not that at the time of this
> >> writing this option is still high experimental.
> >>
> >>
> >
> >
>
>
[-- Attachment #2: Type: text/html, Size: 7865 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-27 15:18 ` adnan iqbal
@ 2011-01-27 17:44 ` David Daney
0 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-27 17:44 UTC (permalink / raw)
To: adnan iqbal; +Cc: naveen yadav, linux-mips, kernelnewbies
On 01/27/2011 07:18 AM, adnan iqbal wrote:
> Please try this. One line of code is added ( move %1, $7).
>
>
> int kernel_execve(const char *filename, char *const argv[], char *const
> envp[])
> {
> register unsigned long __a0 asm("$4") = (unsigned long) filename;
> register unsigned long __a1 asm("$5") = (unsigned long) argv;
> register unsigned long __a2 asm("$6") = (unsigned long) envp;
> register unsigned long __a3 asm("$7");
> unsigned long __v0;
> __asm__ volatile (" \n"
> " .set noreorder \n"
> " li $2, %5 # __NR_execve \n"
> " syscall \n"
> " move %0, $2 \n"
> " move %1, $7 \n"
> " .set reorder \n"
> : "=&r" (__v0), "=r" (__a3)
> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
> "memory");
>
>
> if (__a3 == 0)
> return __v0;
> return -__v0;
> }
>
I don't know where you got that code. But really you should do what
glibc does. glibc gets it correct.
At a minimum you are missing "hi" and "lo" clobbers.
If the code works with 16K pages, and not 64K pages, then this snippet
is not the problem. Likely your problem is the layout of the PHDRs in
the executable is not compatible with the page size.
David Daney
>
> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com> wrote:
>
>> Hi David,
>>
>> thanks for your response.
>>
>> I check and found that kernel is booting with 16KB page size with
>> ramdisk booting. But when I change to 64KB it give me
>>
>> : applet not found
>> Kernel panic - not syncing: Attempted to kill init!
>> so I check and found that it is not able to execute well the system
>> call in kernel_execve function.
>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>> this problem or how to debug below function.
>>
>> int kernel_execve(const char *filename, char *const argv[], char *const
>> envp[])
>> {
>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>> register unsigned long __a3 asm("$7");
>> unsigned long __v0;
>> __asm__ volatile (" \n"
>> " .set noreorder \n"
>> " li $2, %5 # __NR_execve \n"
>> " syscall \n"
>> " move %0, $2 \n"
>> " .set reorder \n"
>> : "=&r" (__v0), "=r" (__a3)
>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
>> "memory");
>>
>>
>> if (__a3 == 0)
>> return __v0;
>> return -__v0;
>> }
>>
>>
>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>> wrote:
>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>
>>>> Hi All,
>>>>
>>>>
>>>> we are using mips32r2 so I want to know which all pages size it can
>>>> support?
>>>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>> KB.
>>>
>>> I don't think 8KB and 32KB work on most mips32r2 processors. You would
>> have
>>> to check the processor manual to be sure.
>>>
>>>
>>>>
>>>> We are using 2.6.30 kernel.
>>>>
>>>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>>>> init/initramfs.c
>>>>
>>>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>>>> to kill init!
>>>
>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If you
>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>> will of course fail. In this case the problem is with your toolchain,
>> not
>>> the kernel.
>>>
>>> David Daney
>>>
>>>
>>>>
>>>> config PAGE_SIZE_4KB
>>>> bool "4kB"
>>>> help
>>>> This option select the standard 4kB Linux page size. On some
>>>> R3000-family processors this is the only available page size.
>>>> Using
>>>> 4kB page size will minimize memory consumption and is therefore
>>>> recommended for low memory systems.
>>>>
>>>> config PAGE_SIZE_8KB
>>>> bool "8kB"
>>>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>>>> help
>>>> Using 8kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available
>>>> only on R8000 and cnMIPS processors. Note that you will need
>> a
>>>> suitable Linux distribution to support this.
>>>>
>>>> config PAGE_SIZE_16KB
>>>> bool "16kB"
>>>> depends on !CPU_R3000&& !CPU_TX39XX
>>>> help
>>>> Using 16kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available on
>>>> all non-R3000 family processors. Note that you will need a
>>>> suitable
>>>> Linux distribution to support this.
>>>>
>>>> config PAGE_SIZE_32KB
>>>> bool "32kB"
>>>> help
>>>> Using 32kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available
>>>> only on cnMIPS cores. Note that you will need a suitable
>> Linux
>>>> distribution to support this.
>>>>
>>>> config PAGE_SIZE_64KB
>>>> bool "64kB"
>>>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>>>> help
>>>> Using 64kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available on
>>>> all non-R3000 family processor. Not that at the time of this
>>>> writing this option is still high experimental.
>>>>
>>>>
>>>
>>>
>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-27 17:44 ` David Daney
0 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-27 17:44 UTC (permalink / raw)
To: kernelnewbies
On 01/27/2011 07:18 AM, adnan iqbal wrote:
> Please try this. One line of code is added ( move %1, $7).
>
>
> int kernel_execve(const char *filename, char *const argv[], char *const
> envp[])
> {
> register unsigned long __a0 asm("$4") = (unsigned long) filename;
> register unsigned long __a1 asm("$5") = (unsigned long) argv;
> register unsigned long __a2 asm("$6") = (unsigned long) envp;
> register unsigned long __a3 asm("$7");
> unsigned long __v0;
> __asm__ volatile (" \n"
> " .set noreorder \n"
> " li $2, %5 # __NR_execve \n"
> " syscall \n"
> " move %0, $2 \n"
> " move %1, $7 \n"
> " .set reorder \n"
> : "=&r" (__v0), "=r" (__a3)
> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
> "memory");
>
>
> if (__a3 == 0)
> return __v0;
> return -__v0;
> }
>
I don't know where you got that code. But really you should do what
glibc does. glibc gets it correct.
At a minimum you are missing "hi" and "lo" clobbers.
If the code works with 16K pages, and not 64K pages, then this snippet
is not the problem. Likely your problem is the layout of the PHDRs in
the executable is not compatible with the page size.
David Daney
>
> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com> wrote:
>
>> Hi David,
>>
>> thanks for your response.
>>
>> I check and found that kernel is booting with 16KB page size with
>> ramdisk booting. But when I change to 64KB it give me
>>
>> : applet not found
>> Kernel panic - not syncing: Attempted to kill init!
>> so I check and found that it is not able to execute well the system
>> call in kernel_execve function.
>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>> this problem or how to debug below function.
>>
>> int kernel_execve(const char *filename, char *const argv[], char *const
>> envp[])
>> {
>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>> register unsigned long __a3 asm("$7");
>> unsigned long __v0;
>> __asm__ volatile (" \n"
>> " .set noreorder \n"
>> " li $2, %5 # __NR_execve \n"
>> " syscall \n"
>> " move %0, $2 \n"
>> " .set reorder \n"
>> : "=&r" (__v0), "=r" (__a3)
>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24",
>> "memory");
>>
>>
>> if (__a3 == 0)
>> return __v0;
>> return -__v0;
>> }
>>
>>
>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>> wrote:
>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>
>>>> Hi All,
>>>>
>>>>
>>>> we are using mips32r2 so I want to know which all pages size it can
>>>> support?
>>>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>> KB.
>>>
>>> I don't think 8KB and 32KB work on most mips32r2 processors. You would
>> have
>>> to check the processor manual to be sure.
>>>
>>>
>>>>
>>>> We are using 2.6.30 kernel.
>>>>
>>>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>>>> init/initramfs.c
>>>>
>>>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>>>> to kill init!
>>>
>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If you
>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>> will of course fail. In this case the problem is with your toolchain,
>> not
>>> the kernel.
>>>
>>> David Daney
>>>
>>>
>>>>
>>>> config PAGE_SIZE_4KB
>>>> bool "4kB"
>>>> help
>>>> This option select the standard 4kB Linux page size. On some
>>>> R3000-family processors this is the only available page size.
>>>> Using
>>>> 4kB page size will minimize memory consumption and is therefore
>>>> recommended for low memory systems.
>>>>
>>>> config PAGE_SIZE_8KB
>>>> bool "8kB"
>>>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>>>> help
>>>> Using 8kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available
>>>> only on R8000 and cnMIPS processors. Note that you will need
>> a
>>>> suitable Linux distribution to support this.
>>>>
>>>> config PAGE_SIZE_16KB
>>>> bool "16kB"
>>>> depends on !CPU_R3000&& !CPU_TX39XX
>>>> help
>>>> Using 16kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available on
>>>> all non-R3000 family processors. Note that you will need a
>>>> suitable
>>>> Linux distribution to support this.
>>>>
>>>> config PAGE_SIZE_32KB
>>>> bool "32kB"
>>>> help
>>>> Using 32kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available
>>>> only on cnMIPS cores. Note that you will need a suitable
>> Linux
>>>> distribution to support this.
>>>>
>>>> config PAGE_SIZE_64KB
>>>> bool "64kB"
>>>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>>>> help
>>>> Using 64kB page size will result in higher performance kernel
>> at
>>>> the price of higher memory consumption. This option is
>>>> available on
>>>> all non-R3000 family processor. Not that at the time of this
>>>> writing this option is still high experimental.
>>>>
>>>>
>>>
>>>
>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-27 17:44 ` David Daney
@ 2011-01-28 9:18 ` naveen yadav
-1 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-28 9:18 UTC (permalink / raw)
To: David Daney; +Cc: adnan iqbal, linux-mips, kernelnewbies
Hi all
I try changing the kernel_execve() function as suggested, but it fails,
I am using code sourcery toolchain 4.4.1 but it still fails. I am
using 2.6.30.9 kernel and this function is part of it.
Kind regards
On Thu, Jan 27, 2011 at 11:14 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/27/2011 07:18 AM, adnan iqbal wrote:
>>
>> Please try this. One line of code is added ( move %1, $7).
>>
>>
>> int kernel_execve(const char *filename, char *const argv[], char *const
>> envp[])
>> {
>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>> register unsigned long __a3 asm("$7");
>> unsigned long __v0;
>> __asm__ volatile (" \n"
>> " .set noreorder \n"
>> " li $2, %5 # __NR_execve \n"
>> " syscall \n"
>> " move %0, $2 \n"
>> " move %1, $7 \n"
>> " .set reorder \n"
>> : "=&r" (__v0), "=r" (__a3)
>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>> "$24",
>> "memory");
>>
>>
>> if (__a3 == 0)
>> return __v0;
>> return -__v0;
>> }
>>
>
> I don't know where you got that code. But really you should do what glibc
> does. glibc gets it correct.
>
> At a minimum you are missing "hi" and "lo" clobbers.
>
> If the code works with 16K pages, and not 64K pages, then this snippet is
> not the problem. Likely your problem is the layout of the PHDRs in the
> executable is not compatible with the page size.
>
> David Daney
>
>
>>
>> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com>
>> wrote:
>>
>>> Hi David,
>>>
>>> thanks for your response.
>>>
>>> I check and found that kernel is booting with 16KB page size with
>>> ramdisk booting. But when I change to 64KB it give me
>>>
>>> : applet not found
>>> Kernel panic - not syncing: Attempted to kill init!
>>> so I check and found that it is not able to execute well the system
>>> call in kernel_execve function.
>>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>>> this problem or how to debug below function.
>>>
>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>> envp[])
>>> {
>>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>> register unsigned long __a3 asm("$7");
>>> unsigned long __v0;
>>> __asm__ volatile (" \n"
>>> " .set noreorder \n"
>>> " li $2, %5 # __NR_execve \n"
>>> " syscall \n"
>>> " move %0, $2 \n"
>>> " .set reorder \n"
>>> : "=&r" (__v0), "=r" (__a3)
>>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>> "$24",
>>> "memory");
>>>
>>>
>>> if (__a3 == 0)
>>> return __v0;
>>> return -__v0;
>>> }
>>>
>>>
>>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>>> wrote:
>>>>
>>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>>
>>>>> we are using mips32r2 so I want to know which all pages size it can
>>>>> support?
>>>>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>>> KB.
>>>>
>>>> I don't think 8KB and 32KB work on most mips32r2 processors. You would
>>>
>>> have
>>>>
>>>> to check the processor manual to be sure.
>>>>
>>>>
>>>>>
>>>>> We are using 2.6.30 kernel.
>>>>>
>>>>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>>>>> init/initramfs.c
>>>>>
>>>>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>>>>> to kill init!
>>>>
>>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
>>>> you
>>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>>> will of course fail. In this case the problem is with your toolchain,
>>>
>>> not
>>>>
>>>> the kernel.
>>>>
>>>> David Daney
>>>>
>>>>
>>>>>
>>>>> config PAGE_SIZE_4KB
>>>>> bool "4kB"
>>>>> help
>>>>> This option select the standard 4kB Linux page size. On some
>>>>> R3000-family processors this is the only available page size.
>>>>> Using
>>>>> 4kB page size will minimize memory consumption and is
>>>>> therefore
>>>>> recommended for low memory systems.
>>>>>
>>>>> config PAGE_SIZE_8KB
>>>>> bool "8kB"
>>>>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>>>>> help
>>>>> Using 8kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> the price of higher memory consumption. This option is
>>>>> available
>>>>> only on R8000 and cnMIPS processors. Note that you will need
>>>
>>> a
>>>>>
>>>>> suitable Linux distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_16KB
>>>>> bool "16kB"
>>>>> depends on !CPU_R3000&& !CPU_TX39XX
>>>>> help
>>>>> Using 16kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> the price of higher memory consumption. This option is
>>>>> available on
>>>>> all non-R3000 family processors. Note that you will need a
>>>>> suitable
>>>>> Linux distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_32KB
>>>>> bool "32kB"
>>>>> help
>>>>> Using 32kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> the price of higher memory consumption. This option is
>>>>> available
>>>>> only on cnMIPS cores. Note that you will need a suitable
>>>
>>> Linux
>>>>>
>>>>> distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_64KB
>>>>> bool "64kB"
>>>>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>>>>> help
>>>>> Using 64kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> the price of higher memory consumption. This option is
>>>>> available on
>>>>> all non-R3000 family processor. Not that at the time of this
>>>>> writing this option is still high experimental.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-28 9:18 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-01-28 9:18 UTC (permalink / raw)
To: kernelnewbies
Hi all
I try changing the kernel_execve() function as suggested, but it fails,
I am using code sourcery toolchain 4.4.1 but it still fails. I am
using 2.6.30.9 kernel and this function is part of it.
Kind regards
On Thu, Jan 27, 2011 at 11:14 PM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/27/2011 07:18 AM, adnan iqbal wrote:
>>
>> Please try this. One line of code is added ( move ? ?%1, $7).
>>
>>
>> int kernel_execve(const char *filename, char *const argv[], char *const
>> envp[])
>> {
>> ? ? ? ?register unsigned long __a0 asm("$4") = (unsigned long) filename;
>> ? ? ? ?register unsigned long __a1 asm("$5") = (unsigned long) argv;
>> ? ? ? ?register unsigned long __a2 asm("$6") = (unsigned long) envp;
>> ? ? ? ?register unsigned long __a3 asm("$7");
>> ? ? ? ?unsigned long __v0;
>> ? ? ? ?__asm__ volatile (" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>> ? ? ? ?" ? ? ? .set ? ?noreorder ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>> ? ? ? ?" ? ? ? li ? ? ?$2, %5 ? ? ? ? ?# __NR_execve ? ? ? ? ? \n"
>> ? ? ? ?" ? ? ? syscall ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>> ? ? ? ?" ? ? ? move ? ?%0, $2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\n"
>> ? ? " ? ? ?move ? ?%1, $7 ? ? ? ? ? ? ? ? ? ?\n"
>> ? ? ? ?" ? ? ? .set ? ?reorder ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>> ? ? ? ?: "=&r" (__v0), "=r" (__a3)
>> ? ? ? ?: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>> ? ? ? ?: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>> "$24",
>> ? ? ? ? ?"memory");
>>
>>
>> ? ? ? ?if (__a3 == 0)
>> ? ? ? ? ? ? ? ?return __v0;
>> ? ? ? ?return -__v0;
>> }
>>
>
> I don't know where you got that code. ?But really you should do what glibc
> does. ?glibc gets it correct.
>
> At a minimum you are missing "hi" and "lo" clobbers.
>
> If the code works with 16K pages, and not 64K pages, then this snippet is
> not the problem. ?Likely your problem is the layout of the PHDRs in the
> executable is not compatible with the page size.
>
> David Daney
>
>
>>
>> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com>
>> ?wrote:
>>
>>> Hi David,
>>>
>>> thanks for your response.
>>>
>>> I check and found that kernel is booting with 16KB page size with
>>> ramdisk booting. But when I change to 64KB it give me
>>>
>>> : applet not found
>>> ? ? ? ? ? ? ? ? ?Kernel panic - not syncing: Attempted to kill init!
>>> so I check and found that it is not able to execute well the system
>>> call in kernel_execve function.
>>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>>> this problem or how to debug below function.
>>>
>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>> envp[])
>>> {
>>> ? ? ? ?register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>> ? ? ? ?register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>> ? ? ? ?register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>> ? ? ? ?register unsigned long __a3 asm("$7");
>>> ? ? ? ?unsigned long __v0;
>>> ? ? ? ?__asm__ volatile (" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>>> ? ? ? ?" ? ? ? .set ? ?noreorder ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>>> ? ? ? ?" ? ? ? li ? ? ?$2, %5 ? ? ? ? ?# __NR_execve ? ? ? ? ? \n"
>>> ? ? ? ?" ? ? ? syscall ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>>> ? ? ? ?" ? ? ? move ? ?%0, $2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\n"
>>> ? ? ? ?" ? ? ? .set ? ?reorder ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n"
>>> ? ? ? ?: "=&r" (__v0), "=r" (__a3)
>>> ? ? ? ?: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>> ? ? ? ?: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>> "$24",
>>> ? ? ? ? ?"memory");
>>>
>>>
>>> ? ? ? ?if (__a3 == 0)
>>> ? ? ? ? ? ? ? ?return __v0;
>>> ? ? ? ?return -__v0;
>>> }
>>>
>>>
>>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>>> wrote:
>>>>
>>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>>
>>>>> we are using mips32r2 ?so I want to know which all pages size it can
>>>>> support?
>>>>> When I modify arch/mips/Kconfig. ?it boot sucessfully on 16KB page
>>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>>> KB.
>>>>
>>>> I don't think 8KB and 32KB work on most mips32r2 processors. ?You would
>>>
>>> have
>>>>
>>>> to check the processor manual to be sure.
>>>>
>>>>
>>>>>
>>>>> We are using 2.6.30 kernel.
>>>>>
>>>>> At Page Size 8KB and 32KB ?it hang in unpack_to_rootfs() function of
>>>>> init/initramfs.c
>>>>>
>>>>> 64KB it hangs when execute init ?Kernel panic - not syncing: Attempted
>>>>> to kill init!
>>>>
>>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. ?If
>>>> you
>>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>>> will of course fail. ?In this case the problem is with your toolchain,
>>>
>>> not
>>>>
>>>> the kernel.
>>>>
>>>> David Daney
>>>>
>>>>
>>>>>
>>>>> config PAGE_SIZE_4KB
>>>>> ? ? ? ? bool "4kB"
>>>>> ? ? ? ? help
>>>>> ? ? ? ? ?This option select the standard 4kB Linux page size. ?On some
>>>>> ? ? ? ? ?R3000-family processors this is the only available page size.
>>>>> ?Using
>>>>> ? ? ? ? ?4kB page size will minimize memory consumption and is
>>>>> therefore
>>>>> ? ? ? ? ?recommended for low memory systems.
>>>>>
>>>>> config PAGE_SIZE_8KB
>>>>> ? ? ? ? bool "8kB"
>>>>> ? ? ? ?depends on (EXPERIMENTAL&& ? CPU_R8000) || CPU_CAVIUM_OCTEON
>>>>> ? ? ? ? help
>>>>> ? ? ? ? ? Using 8kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>>>>> available
>>>>> ? ? ? ? ? only on R8000 and cnMIPS processors. ?Note that you will need
>>>
>>> a
>>>>>
>>>>> ? ? ? ? ? suitable Linux distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_16KB
>>>>> ? ? ? ? bool "16kB"
>>>>> ? ? ? ?depends on !CPU_R3000&& ? !CPU_TX39XX
>>>>> ? ? ? ? help
>>>>> ? ? ? ? ? Using 16kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>>>>> available on
>>>>> ? ? ? ? ? all non-R3000 family processors. ?Note that you will need a
>>>>> suitable
>>>>> ? ? ? ? ? Linux distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_32KB
>>>>> ? ? ? ? bool "32kB"
>>>>> ? ? ? ? help
>>>>> ? ? ? ? ? Using 32kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>>>>> available
>>>>> ? ? ? ? ? only on cnMIPS cores. ?Note that you will need a suitable
>>>
>>> Linux
>>>>>
>>>>> ? ? ? ? ? distribution to support this.
>>>>>
>>>>> config PAGE_SIZE_64KB
>>>>> ? ? ? ? bool "64kB"
>>>>> ? ? ? ?depends on EXPERIMENTAL&& ? !CPU_R3000&& ? !CPU_TX39XX
>>>>> ? ? ? ? help
>>>>> ? ? ? ? ? Using 64kB page size will result in higher performance kernel
>>>
>>> at
>>>>>
>>>>> ? ? ? ? ? the price of higher memory consumption. ?This option is
>>>>> available on
>>>>> ? ? ? ? ? all non-R3000 family processor. ?Not that at the time of this
>>>>> ? ? ? ? ? writing this option is still high experimental.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-28 9:18 ` naveen yadav
@ 2011-01-28 18:48 ` David Daney
-1 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-28 18:48 UTC (permalink / raw)
To: naveen yadav; +Cc: adnan iqbal, linux-mips, kernelnewbies
On 01/28/2011 01:18 AM, naveen yadav wrote:
> Hi all
>
> I try changing the kernel_execve() function as suggested, but it fails,
> I am using code sourcery toolchain 4.4.1 but it still fails. I am
> using 2.6.30.9 kernel and this function is part of it.
>
>
Quit trying to change kernel_execve(). It is perfect as it is.
The problem is elsewhere.
>
> Kind regards
>
Thank you.
>
> On Thu, Jan 27, 2011 at 11:14 PM, David Daney<ddaney@caviumnetworks.com> wrote:
>> On 01/27/2011 07:18 AM, adnan iqbal wrote:
>>>
>>> Please try this. One line of code is added ( move %1, $7).
>>>
>>>
>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>> envp[])
>>> {
>>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>> register unsigned long __a3 asm("$7");
>>> unsigned long __v0;
>>> __asm__ volatile (" \n"
>>> " .set noreorder \n"
>>> " li $2, %5 # __NR_execve \n"
>>> " syscall \n"
>>> " move %0, $2 \n"
>>> " move %1, $7 \n"
>>> " .set reorder \n"
>>> : "=&r" (__v0), "=r" (__a3)
>>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>> "$24",
>>> "memory");
>>>
>>>
>>> if (__a3 == 0)
>>> return __v0;
>>> return -__v0;
>>> }
>>>
>>
>> I don't know where you got that code. But really you should do what glibc
>> does. glibc gets it correct.
>>
>> At a minimum you are missing "hi" and "lo" clobbers.
Ignore that ^^^^^ advice.
>>
>> If the code works with 16K pages, and not 64K pages, then this snippet is
>> not the problem. Likely your problem is the layout of the PHDRs in the
>> executable is not compatible with the page size.
>>
Instead look at this issue.
>> David Daney
>>
>>
>>>
>>> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com>
>>> wrote:
>>>
>>>> Hi David,
>>>>
>>>> thanks for your response.
>>>>
>>>> I check and found that kernel is booting with 16KB page size with
>>>> ramdisk booting. But when I change to 64KB it give me
>>>>
>>>> : applet not found
>>>> Kernel panic - not syncing: Attempted to kill init!
>>>> so I check and found that it is not able to execute well the system
>>>> call in kernel_execve function.
>>>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>>>> this problem or how to debug below function.
>>>>
>>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>>> envp[])
>>>> {
>>>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>>> register unsigned long __a3 asm("$7");
>>>> unsigned long __v0;
>>>> __asm__ volatile (" \n"
>>>> " .set noreorder \n"
>>>> " li $2, %5 # __NR_execve \n"
>>>> " syscall \n"
>>>> " move %0, $2 \n"
>>>> " .set reorder \n"
>>>> : "=&r" (__v0), "=r" (__a3)
>>>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>>> "$24",
>>>> "memory");
>>>>
>>>>
>>>> if (__a3 == 0)
>>>> return __v0;
>>>> return -__v0;
>>>> }
>>>>
>>>>
>>>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>>>> wrote:
>>>>>
>>>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>>
>>>>>> we are using mips32r2 so I want to know which all pages size it can
>>>>>> support?
>>>>>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>>>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>>>> KB.
>>>>>
>>>>> I don't think 8KB and 32KB work on most mips32r2 processors. You would
>>>>
>>>> have
>>>>>
>>>>> to check the processor manual to be sure.
>>>>>
>>>>>
>>>>>>
>>>>>> We are using 2.6.30 kernel.
>>>>>>
>>>>>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>>>>>> init/initramfs.c
>>>>>>
>>>>>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>>>>>> to kill init!
>>>>>
>>>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
>>>>> you
>>>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>>>> will of course fail. In this case the problem is with your toolchain,
>>>>
>>>> not
>>>>>
>>>>> the kernel.
>>>>>
>>>>> David Daney
>>>>>
>>>>>
>>>>>>
>>>>>> config PAGE_SIZE_4KB
>>>>>> bool "4kB"
>>>>>> help
>>>>>> This option select the standard 4kB Linux page size. On some
>>>>>> R3000-family processors this is the only available page size.
>>>>>> Using
>>>>>> 4kB page size will minimize memory consumption and is
>>>>>> therefore
>>>>>> recommended for low memory systems.
>>>>>>
>>>>>> config PAGE_SIZE_8KB
>>>>>> bool "8kB"
>>>>>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>>>>>> help
>>>>>> Using 8kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available
>>>>>> only on R8000 and cnMIPS processors. Note that you will need
>>>>
>>>> a
>>>>>>
>>>>>> suitable Linux distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_16KB
>>>>>> bool "16kB"
>>>>>> depends on !CPU_R3000&& !CPU_TX39XX
>>>>>> help
>>>>>> Using 16kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available on
>>>>>> all non-R3000 family processors. Note that you will need a
>>>>>> suitable
>>>>>> Linux distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_32KB
>>>>>> bool "32kB"
>>>>>> help
>>>>>> Using 32kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available
>>>>>> only on cnMIPS cores. Note that you will need a suitable
>>>>
>>>> Linux
>>>>>>
>>>>>> distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_64KB
>>>>>> bool "64kB"
>>>>>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>>>>>> help
>>>>>> Using 64kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available on
>>>>>> all non-R3000 family processor. Not that at the time of this
>>>>>> writing this option is still high experimental.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-28 18:48 ` David Daney
0 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-01-28 18:48 UTC (permalink / raw)
To: kernelnewbies
On 01/28/2011 01:18 AM, naveen yadav wrote:
> Hi all
>
> I try changing the kernel_execve() function as suggested, but it fails,
> I am using code sourcery toolchain 4.4.1 but it still fails. I am
> using 2.6.30.9 kernel and this function is part of it.
>
>
Quit trying to change kernel_execve(). It is perfect as it is.
The problem is elsewhere.
>
> Kind regards
>
Thank you.
>
> On Thu, Jan 27, 2011 at 11:14 PM, David Daney<ddaney@caviumnetworks.com> wrote:
>> On 01/27/2011 07:18 AM, adnan iqbal wrote:
>>>
>>> Please try this. One line of code is added ( move %1, $7).
>>>
>>>
>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>> envp[])
>>> {
>>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>> register unsigned long __a3 asm("$7");
>>> unsigned long __v0;
>>> __asm__ volatile (" \n"
>>> " .set noreorder \n"
>>> " li $2, %5 # __NR_execve \n"
>>> " syscall \n"
>>> " move %0, $2 \n"
>>> " move %1, $7 \n"
>>> " .set reorder \n"
>>> : "=&r" (__v0), "=r" (__a3)
>>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>> "$24",
>>> "memory");
>>>
>>>
>>> if (__a3 == 0)
>>> return __v0;
>>> return -__v0;
>>> }
>>>
>>
>> I don't know where you got that code. But really you should do what glibc
>> does. glibc gets it correct.
>>
>> At a minimum you are missing "hi" and "lo" clobbers.
Ignore that ^^^^^ advice.
>>
>> If the code works with 16K pages, and not 64K pages, then this snippet is
>> not the problem. Likely your problem is the layout of the PHDRs in the
>> executable is not compatible with the page size.
>>
Instead look at this issue.
>> David Daney
>>
>>
>>>
>>> On Thu, Jan 27, 2011 at 7:55 PM, naveen yadav<yad.naveen@gmail.com>
>>> wrote:
>>>
>>>> Hi David,
>>>>
>>>> thanks for your response.
>>>>
>>>> I check and found that kernel is booting with 16KB page size with
>>>> ramdisk booting. But when I change to 64KB it give me
>>>>
>>>> : applet not found
>>>> Kernel panic - not syncing: Attempted to kill init!
>>>> so I check and found that it is not able to execute well the system
>>>> call in kernel_execve function.
>>>> I am using codesourcercy toolchain(4.3.1). So is there a way to debug
>>>> this problem or how to debug below function.
>>>>
>>>> int kernel_execve(const char *filename, char *const argv[], char *const
>>>> envp[])
>>>> {
>>>> register unsigned long __a0 asm("$4") = (unsigned long) filename;
>>>> register unsigned long __a1 asm("$5") = (unsigned long) argv;
>>>> register unsigned long __a2 asm("$6") = (unsigned long) envp;
>>>> register unsigned long __a3 asm("$7");
>>>> unsigned long __v0;
>>>> __asm__ volatile (" \n"
>>>> " .set noreorder \n"
>>>> " li $2, %5 # __NR_execve \n"
>>>> " syscall \n"
>>>> " move %0, $2 \n"
>>>> " .set reorder \n"
>>>> : "=&r" (__v0), "=r" (__a3)
>>>> : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_execve)
>>>> : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15",
>>>> "$24",
>>>> "memory");
>>>>
>>>>
>>>> if (__a3 == 0)
>>>> return __v0;
>>>> return -__v0;
>>>> }
>>>>
>>>>
>>>> On Tue, Jan 25, 2011 at 12:26 AM, David Daney<ddaney@caviumnetworks.com>
>>>> wrote:
>>>>>
>>>>> On 01/24/2011 07:02 AM, naveen yadav wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>>
>>>>>> we are using mips32r2 so I want to know which all pages size it can
>>>>>> support?
>>>>>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>>>>>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>>>>>> KB.
>>>>>
>>>>> I don't think 8KB and 32KB work on most mips32r2 processors. You would
>>>>
>>>> have
>>>>>
>>>>> to check the processor manual to be sure.
>>>>>
>>>>>
>>>>>>
>>>>>> We are using 2.6.30 kernel.
>>>>>>
>>>>>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>>>>>> init/initramfs.c
>>>>>>
>>>>>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>>>>>> to kill init!
>>>>>
>>>>> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
>>>>> you
>>>>> run with a broken uClibc toolchain that doesn't support larger pages, it
>>>>> will of course fail. In this case the problem is with your toolchain,
>>>>
>>>> not
>>>>>
>>>>> the kernel.
>>>>>
>>>>> David Daney
>>>>>
>>>>>
>>>>>>
>>>>>> config PAGE_SIZE_4KB
>>>>>> bool "4kB"
>>>>>> help
>>>>>> This option select the standard 4kB Linux page size. On some
>>>>>> R3000-family processors this is the only available page size.
>>>>>> Using
>>>>>> 4kB page size will minimize memory consumption and is
>>>>>> therefore
>>>>>> recommended for low memory systems.
>>>>>>
>>>>>> config PAGE_SIZE_8KB
>>>>>> bool "8kB"
>>>>>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>>>>>> help
>>>>>> Using 8kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available
>>>>>> only on R8000 and cnMIPS processors. Note that you will need
>>>>
>>>> a
>>>>>>
>>>>>> suitable Linux distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_16KB
>>>>>> bool "16kB"
>>>>>> depends on !CPU_R3000&& !CPU_TX39XX
>>>>>> help
>>>>>> Using 16kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available on
>>>>>> all non-R3000 family processors. Note that you will need a
>>>>>> suitable
>>>>>> Linux distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_32KB
>>>>>> bool "32kB"
>>>>>> help
>>>>>> Using 32kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available
>>>>>> only on cnMIPS cores. Note that you will need a suitable
>>>>
>>>> Linux
>>>>>>
>>>>>> distribution to support this.
>>>>>>
>>>>>> config PAGE_SIZE_64KB
>>>>>> bool "64kB"
>>>>>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>>>>>> help
>>>>>> Using 64kB page size will result in higher performance kernel
>>>>
>>>> at
>>>>>>
>>>>>> the price of higher memory consumption. This option is
>>>>>> available on
>>>>>> all non-R3000 family processor. Not that at the time of this
>>>>>> writing this option is still high experimental.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-24 18:56 ` David Daney
@ 2011-01-30 15:02 ` Himanshu Aggarwal
-1 siblings, 0 replies; 26+ messages in thread
From: Himanshu Aggarwal @ 2011-01-30 15:02 UTC (permalink / raw)
To: David Daney; +Cc: naveen yadav, kernelnewbies, linux-mips
On Tue, Jan 25, 2011 at 12:26 AM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>> Hi All,
>>
>>
>> we are using mips32r2 so I want to know which all pages size it can support?
>> When I modify arch/mips/Kconfig. it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. You would
> have to check the processor manual to be sure.
>
>
>>
>> We are using 2.6.30 kernel.
>>
>> At Page Size 8KB and 32KB it hang in unpack_to_rootfs() function of
>> init/initramfs.c
>>
>> 64KB it hangs when execute init Kernel panic - not syncing: Attempted
>> to kill init!
>
> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. If
> you run with a broken uClibc toolchain that doesn't support larger
> pages, it will of course fail. In this case the problem is with your
> toolchain, not the kernel.
>
> David Daney
>
>
>>
>> config PAGE_SIZE_4KB
>> bool "4kB"
>> help
>> This option select the standard 4kB Linux page size. On some
>> R3000-family processors this is the only available page size. Using
>> 4kB page size will minimize memory consumption and is therefore
>> recommended for low memory systems.
>>
>> config PAGE_SIZE_8KB
>> bool "8kB"
>> depends on (EXPERIMENTAL&& CPU_R8000) || CPU_CAVIUM_OCTEON
>> help
>> Using 8kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is available
>> only on R8000 and cnMIPS processors. Note that you will need a
>> suitable Linux distribution to support this.
>>
>> config PAGE_SIZE_16KB
>> bool "16kB"
>> depends on !CPU_R3000&& !CPU_TX39XX
>> help
>> Using 16kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is available on
>> all non-R3000 family processors. Note that you will need a suitable
>> Linux distribution to support this.
>>
>> config PAGE_SIZE_32KB
>> bool "32kB"
>> help
>> Using 32kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is available
>> only on cnMIPS cores. Note that you will need a suitable Linux
>> distribution to support this.
>>
>> config PAGE_SIZE_64KB
>> bool "64kB"
>> depends on EXPERIMENTAL&& !CPU_R3000&& !CPU_TX39XX
>> help
>> Using 64kB page size will result in higher performance kernel at
>> the price of higher memory consumption. This option is available on
>> all non-R3000 family processor. Not that at the time of this
>> writing this option is still high experimental.
>>
>>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
Why should the application or the toolchains depend on pagesize? I am
not very clear on this. Can someone explain it?
Regards,
Himanshu
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-01-30 15:02 ` Himanshu Aggarwal
0 siblings, 0 replies; 26+ messages in thread
From: Himanshu Aggarwal @ 2011-01-30 15:02 UTC (permalink / raw)
To: kernelnewbies
On Tue, Jan 25, 2011 at 12:26 AM, David Daney <ddaney@caviumnetworks.com> wrote:
> On 01/24/2011 07:02 AM, naveen yadav wrote:
>> Hi All,
>>
>>
>> we are using mips32r2 ?so I want to know which all pages size it can support?
>> When I modify arch/mips/Kconfig. ?it boot sucessfully on 16KB page
>> size. but hang/not boot crash when change page size to 8KB,32KB and 64
>> KB.
>
> I don't think 8KB and 32KB work on most mips32r2 processors. ?You would
> have to check the processor manual to be sure.
>
>
>>
>> We are using 2.6.30 kernel.
>>
>> At Page Size 8KB and 32KB ?it hang in unpack_to_rootfs() function of
>> init/initramfs.c
>>
>> 64KB it hangs when execute init ?Kernel panic - not syncing: Attempted
>> to kill init!
>
> I regularly run 4K, 16K, and 64K page sizes with a Debian rootfs. ?If
> you run with a broken uClibc toolchain that doesn't support larger
> pages, it will of course fail. ?In this case the problem is with your
> toolchain, not the kernel.
>
> David Daney
>
>
>>
>> config PAGE_SIZE_4KB
>> ? ? ? ? ?bool "4kB"
>> ? ? ? ? ?help
>> ? ? ? ? ? This option select the standard 4kB Linux page size. ?On some
>> ? ? ? ? ? R3000-family processors this is the only available page size. ?Using
>> ? ? ? ? ? 4kB page size will minimize memory consumption and is therefore
>> ? ? ? ? ? recommended for low memory systems.
>>
>> config PAGE_SIZE_8KB
>> ? ? ? ? ?bool "8kB"
>> ? ? ? ? depends on (EXPERIMENTAL&& ?CPU_R8000) || CPU_CAVIUM_OCTEON
>> ? ? ? ? ?help
>> ? ? ? ? ? ?Using 8kB page size will result in higher performance kernel at
>> ? ? ? ? ? ?the price of higher memory consumption. ?This option is available
>> ? ? ? ? ? ?only on R8000 and cnMIPS processors. ?Note that you will need a
>> ? ? ? ? ? ?suitable Linux distribution to support this.
>>
>> config PAGE_SIZE_16KB
>> ? ? ? ? ?bool "16kB"
>> ? ? ? ? depends on !CPU_R3000&& ?!CPU_TX39XX
>> ? ? ? ? ?help
>> ? ? ? ? ? ?Using 16kB page size will result in higher performance kernel at
>> ? ? ? ? ? ?the price of higher memory consumption. ?This option is available on
>> ? ? ? ? ? ?all non-R3000 family processors. ?Note that you will need a suitable
>> ? ? ? ? ? ?Linux distribution to support this.
>>
>> config PAGE_SIZE_32KB
>> ? ? ? ? ?bool "32kB"
>> ? ? ? ? ?help
>> ? ? ? ? ? ?Using 32kB page size will result in higher performance kernel at
>> ? ? ? ? ? ?the price of higher memory consumption. ?This option is available
>> ? ? ? ? ? ?only on cnMIPS cores. ?Note that you will need a suitable Linux
>> ? ? ? ? ? ?distribution to support this.
>>
>> config PAGE_SIZE_64KB
>> ? ? ? ? ?bool "64kB"
>> ? ? ? ? depends on EXPERIMENTAL&& ?!CPU_R3000&& ?!CPU_TX39XX
>> ? ? ? ? ?help
>> ? ? ? ? ? ?Using 64kB page size will result in higher performance kernel at
>> ? ? ? ? ? ?the price of higher memory consumption. ?This option is available on
>> ? ? ? ? ? ?all non-R3000 family processor. ?Not that at the time of this
>> ? ? ? ? ? ?writing this option is still high experimental.
>>
>>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
Why should the application or the toolchains depend on pagesize? I am
not very clear on this. Can someone explain it?
Regards,
Himanshu
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-30 15:02 ` Himanshu Aggarwal
(?)
@ 2011-01-31 13:08 ` Ralf Baechle
2011-02-04 3:24 ` naveen yadav
-1 siblings, 1 reply; 26+ messages in thread
From: Ralf Baechle @ 2011-01-31 13:08 UTC (permalink / raw)
To: Himanshu Aggarwal; +Cc: David Daney, naveen yadav, kernelnewbies, linux-mips
On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
> Why should the application or the toolchains depend on pagesize? I am
> not very clear on this. Can someone explain it?
To allow loading directly with mmap the executable file's layout must
be such that it's it's segments are on offsets that are a multiple of
the page size so in turn the linker must know that alignment.
Ralf
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-01-31 13:08 ` Ralf Baechle
@ 2011-02-04 3:24 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-02-04 3:24 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Himanshu Aggarwal, David Daney, kernelnewbies, linux-mips
thanaks a lot for your suggestion ..
I debug this issue further, and here is my observations:
1. If I replace init with simple static link executable binary, this
can be executed.
2. In case of busy-box, I debug the reason why init fails to excute.
When I execute init command from busybox the control goes in main()
function of busybox(appletlib.c) with argv value
as the command you are suppose to execute, which in our case is init.
But when i check argv is coming null when page size is 64KB and it
comes init when page size is 16KB.
This behaviour is very strange and i am still debugging this issue.
I have check in Glibc, the max_page size it support is 64 KB in
codesourcercy toolchain 4.4.1
How can I check alignment issue as mention by Mr. Ralf Baechle.
Kind regards
On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>
>> Why should the application or the toolchains depend on pagesize? I am
>> not very clear on this. Can someone explain it?
>
> To allow loading directly with mmap the executable file's layout must
> be such that it's it's segments are on offsets that are a multiple of
> the page size so in turn the linker must know that alignment.
>
> Ralf
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-02-04 3:24 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-02-04 3:24 UTC (permalink / raw)
To: kernelnewbies
thanaks a lot for your suggestion ..
I debug this issue further, and here is my observations:
1. If I replace init with simple static link executable binary, this
can be executed.
2. In case of busy-box, I debug the reason why init fails to excute.
When I execute init command from busybox the control goes in main()
function of busybox(appletlib.c) with argv value
as the command you are suppose to execute, which in our case is init.
But when i check argv is coming null when page size is 64KB and it
comes init when page size is 16KB.
This behaviour is very strange and i am still debugging this issue.
I have check in Glibc, the max_page size it support is 64 KB in
codesourcercy toolchain 4.4.1
How can I check alignment issue as mention by Mr. Ralf Baechle.
Kind regards
On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>
>> Why should the application or the toolchains depend on pagesize? I am
>> not very clear on this. Can someone explain it?
>
> To allow loading directly with mmap the executable file's layout must
> be such that it's it's segments are on offsets that are a multiple of
> the page size so in turn the linker must know that alignment.
>
> ?Ralf
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-02-04 3:24 ` naveen yadav
@ 2011-02-04 4:16 ` naveen yadav
-1 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-02-04 4:16 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Himanshu Aggarwal, David Daney, kernelnewbies, linux-mips
Hi, I am adding readelf info also .
mips-linux-gnu-readelf -S squashfs-root/bin/busybox
There are 35 section headers, starting at offset 0x174290:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .note.ABI-tag NOTE 004000d4 0000d4 000020 00 A 0 0 4
[ 2] .reginfo MIPS_REGINFO 004000f4 0000f4 000018 18 A 0 0 4
[ 3] .rel.dyn REL 0040010c 00010c 000010 08 A 0 0 4
[ 4] .init PROGBITS 0040011c 00011c 00005c 00 AX 0 0 4
[ 5] .text PROGBITS 00400180 000180 11d2b0 00 AX 0 0 16
[ 6] __libc_freeres_fn PROGBITS 0051d430 11d430 001368 00 AX 0 0 4
[ 7] __libc_thread_fre PROGBITS 0051e798 11e798 000148 00 AX 0 0 4
[ 8] .fini PROGBITS 0051e8e0 11e8e0 000034 00 AX 0 0 4
[ 9] .rodata PROGBITS 0051e920 11e920 02d560 00 A 0 0 16
[10] __libc_subfreeres PROGBITS 0054be80 14be80 000058 00 A 0 0 4
[11] __libc_atexit PROGBITS 0054bed8 14bed8 000004 00 A 0 0 4
[12] __libc_thread_sub PROGBITS 0054bedc 14bedc 000008 00 A 0 0 4
[13] .gcc_except_table PROGBITS 0054bee4 14bee4 0001fb 00 A 0 0 1
[14] .eh_frame PROGBITS 0055c0e0 14c0e0 002464 00 WA 0 0 4
[15] .tdata PROGBITS 0055e544 14e544 000018 00 WAT 0 0 4
[16] .tbss NOBITS 0055e55c 14e55c 000034 00 WAT 0 0 4
[17] .ctors PROGBITS 0055e55c 14e55c 000008 00 WA 0 0 4
[18] .dtors PROGBITS 0055e564 14e564 00000c 00 WA 0 0 4
[19] .jcr PROGBITS 0055e570 14e570 000004 00 WA 0 0 4
[20] .data.rel.ro PROGBITS 0055e574 14e574 000030 00 WA 0 0 4
[21] .data PROGBITS 0055e5b0 14e5b0 000b30 00 WA 0 0 16
[22] .got PROGBITS 0055f0e0 14f0e0 000148 04 WAp 0 0 16
[23] .sdata PROGBITS 0055f228 14f228 000004 00 WAp 0 0 4
[24] .sbss NOBITS 0055f230 14f22c 000184 00 WAp 0 0 8
[25] .bss NOBITS 0055f3c0 14f22c 00516c 00 WA 0 0 16
[26] __libc_freeres_pt NOBITS 0056452c 14f22c 000040 00 WA 0 0 4
[27] .pdr PROGBITS 00000000 14f22c 016880 00 0 0 4
[28] .comment PROGBITS 00000000 165aac 0027e0 00 0 0 1
[29] .debug_frame MIPS_DWARF 00000000 16828c 00be88 00 0 0 4
[30] .gnu.attributes LOOS+ffffff5 00000000 174114 000010 00 0 0 1
[31] .mdebug.abi32 PROGBITS 000030c0 174124 000000 00 0 0 1
[32] .shstrtab STRTAB 00000000 174124 00016c 00 0 0 1
[33] .symtab SYMTAB 00000000 174808 015320 10
34 2843 4
[34] .strtab STRTAB 00000000 189b28 012f65 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
On Fri, Feb 4, 2011 at 8:54 AM, naveen yadav <yad.naveen@gmail.com> wrote:
> thanaks a lot for your suggestion ..
>
>
> I debug this issue further, and here is my observations:
>
> 1. If I replace init with simple static link executable binary, this
> can be executed.
> 2. In case of busy-box, I debug the reason why init fails to excute.
>
> When I execute init command from busybox the control goes in main()
> function of busybox(appletlib.c) with argv value
> as the command you are suppose to execute, which in our case is init.
>
> But when i check argv is coming null when page size is 64KB and it
> comes init when page size is 16KB.
>
> This behaviour is very strange and i am still debugging this issue.
>
>
> I have check in Glibc, the max_page size it support is 64 KB in
> codesourcercy toolchain 4.4.1
>
> How can I check alignment issue as mention by Mr. Ralf Baechle.
>
>
>
> Kind regards
>
>
>
>
> On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
>> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>>
>>> Why should the application or the toolchains depend on pagesize? I am
>>> not very clear on this. Can someone explain it?
>>
>> To allow loading directly with mmap the executable file's layout must
>> be such that it's it's segments are on offsets that are a multiple of
>> the page size so in turn the linker must know that alignment.
>>
>> Ralf
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-02-04 4:16 ` naveen yadav
0 siblings, 0 replies; 26+ messages in thread
From: naveen yadav @ 2011-02-04 4:16 UTC (permalink / raw)
To: kernelnewbies
Hi, I am adding readelf info also .
mips-linux-gnu-readelf -S squashfs-root/bin/busybox
There are 35 section headers, starting at offset 0x174290:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .note.ABI-tag NOTE 004000d4 0000d4 000020 00 A 0 0 4
[ 2] .reginfo MIPS_REGINFO 004000f4 0000f4 000018 18 A 0 0 4
[ 3] .rel.dyn REL 0040010c 00010c 000010 08 A 0 0 4
[ 4] .init PROGBITS 0040011c 00011c 00005c 00 AX 0 0 4
[ 5] .text PROGBITS 00400180 000180 11d2b0 00 AX 0 0 16
[ 6] __libc_freeres_fn PROGBITS 0051d430 11d430 001368 00 AX 0 0 4
[ 7] __libc_thread_fre PROGBITS 0051e798 11e798 000148 00 AX 0 0 4
[ 8] .fini PROGBITS 0051e8e0 11e8e0 000034 00 AX 0 0 4
[ 9] .rodata PROGBITS 0051e920 11e920 02d560 00 A 0 0 16
[10] __libc_subfreeres PROGBITS 0054be80 14be80 000058 00 A 0 0 4
[11] __libc_atexit PROGBITS 0054bed8 14bed8 000004 00 A 0 0 4
[12] __libc_thread_sub PROGBITS 0054bedc 14bedc 000008 00 A 0 0 4
[13] .gcc_except_table PROGBITS 0054bee4 14bee4 0001fb 00 A 0 0 1
[14] .eh_frame PROGBITS 0055c0e0 14c0e0 002464 00 WA 0 0 4
[15] .tdata PROGBITS 0055e544 14e544 000018 00 WAT 0 0 4
[16] .tbss NOBITS 0055e55c 14e55c 000034 00 WAT 0 0 4
[17] .ctors PROGBITS 0055e55c 14e55c 000008 00 WA 0 0 4
[18] .dtors PROGBITS 0055e564 14e564 00000c 00 WA 0 0 4
[19] .jcr PROGBITS 0055e570 14e570 000004 00 WA 0 0 4
[20] .data.rel.ro PROGBITS 0055e574 14e574 000030 00 WA 0 0 4
[21] .data PROGBITS 0055e5b0 14e5b0 000b30 00 WA 0 0 16
[22] .got PROGBITS 0055f0e0 14f0e0 000148 04 WAp 0 0 16
[23] .sdata PROGBITS 0055f228 14f228 000004 00 WAp 0 0 4
[24] .sbss NOBITS 0055f230 14f22c 000184 00 WAp 0 0 8
[25] .bss NOBITS 0055f3c0 14f22c 00516c 00 WA 0 0 16
[26] __libc_freeres_pt NOBITS 0056452c 14f22c 000040 00 WA 0 0 4
[27] .pdr PROGBITS 00000000 14f22c 016880 00 0 0 4
[28] .comment PROGBITS 00000000 165aac 0027e0 00 0 0 1
[29] .debug_frame MIPS_DWARF 00000000 16828c 00be88 00 0 0 4
[30] .gnu.attributes LOOS+ffffff5 00000000 174114 000010 00 0 0 1
[31] .mdebug.abi32 PROGBITS 000030c0 174124 000000 00 0 0 1
[32] .shstrtab STRTAB 00000000 174124 00016c 00 0 0 1
[33] .symtab SYMTAB 00000000 174808 015320 10
34 2843 4
[34] .strtab STRTAB 00000000 189b28 012f65 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
On Fri, Feb 4, 2011 at 8:54 AM, naveen yadav <yad.naveen@gmail.com> wrote:
> thanaks a lot for your suggestion ..
>
>
> I debug this issue further, and here is my observations:
>
> 1. If I replace init with simple static link executable binary, this
> can be executed.
> 2. In case of busy-box, I debug the reason why init fails to excute.
>
> When I execute init command from busybox the control goes in main()
> function of busybox(appletlib.c) with argv value
> as the command you are suppose to execute, which in our case is init.
>
> But when i check argv is coming null when page size is 64KB and it
> comes init when page size is 16KB.
>
> This behaviour is very strange and i am still debugging this issue.
>
>
> I have check in Glibc, the max_page size it support is 64 KB in
> codesourcercy toolchain 4.4.1
>
> How can I check alignment issue as mention by Mr. Ralf Baechle.
>
>
>
> Kind regards
>
>
>
>
> On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
>> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>>
>>> Why should the application or the toolchains depend on pagesize? I am
>>> not very clear on this. Can someone explain it?
>>
>> To allow loading directly with mmap the executable file's layout must
>> be such that it's it's segments are on offsets that are a multiple of
>> the page size so in turn the linker must know that alignment.
>>
>> ?Ralf
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: page size change on MIPS
2011-02-04 4:16 ` naveen yadav
@ 2011-02-04 17:25 ` David Daney
-1 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-02-04 17:25 UTC (permalink / raw)
To: naveen yadav; +Cc: Ralf Baechle, Himanshu Aggarwal, kernelnewbies, linux-mips
On 02/03/2011 08:16 PM, naveen yadav wrote:
> Hi, I am adding readelf info also .
>
> mips-linux-gnu-readelf -S squashfs-root/bin/busybox
> There are 35 section headers, starting at offset 0x174290:
>
Section headers are not relevant to any of this. You need to look at
the program headers. Try 'readelf -l'
David Daney
[...]
>>
>>
>> On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle<ralf@linux-mips.org> wrote:
>>> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>>>
>>>> Why should the application or the toolchains depend on pagesize? I am
>>>> not very clear on this. Can someone explain it?
>>>
>>> To allow loading directly with mmap the executable file's layout must
>>> be such that it's it's segments are on offsets that are a multiple of
>>> the page size so in turn the linker must know that alignment.
>>>
>>> Ralf
>>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
@ 2011-02-04 17:25 ` David Daney
0 siblings, 0 replies; 26+ messages in thread
From: David Daney @ 2011-02-04 17:25 UTC (permalink / raw)
To: kernelnewbies
On 02/03/2011 08:16 PM, naveen yadav wrote:
> Hi, I am adding readelf info also .
>
> mips-linux-gnu-readelf -S squashfs-root/bin/busybox
> There are 35 section headers, starting at offset 0x174290:
>
Section headers are not relevant to any of this. You need to look at
the program headers. Try 'readelf -l'
David Daney
[...]
>>
>>
>> On Mon, Jan 31, 2011 at 6:38 PM, Ralf Baechle<ralf@linux-mips.org> wrote:
>>> On Sun, Jan 30, 2011 at 08:32:43PM +0530, Himanshu Aggarwal wrote:
>>>
>>>> Why should the application or the toolchains depend on pagesize? I am
>>>> not very clear on this. Can someone explain it?
>>>
>>> To allow loading directly with mmap the executable file's layout must
>>> be such that it's it's segments are on offsets that are a multiple of
>>> the page size so in turn the linker must know that alignment.
>>>
>>> Ralf
>>>
>>
>
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
2011-02-04 17:25 ` David Daney
(?)
@ 2011-02-05 13:53 ` Mulyadi Santosa
-1 siblings, 0 replies; 26+ messages in thread
From: Mulyadi Santosa @ 2011-02-05 13:53 UTC (permalink / raw)
To: kernelnewbies
On Sat, Feb 5, 2011 at 00:25, David Daney <ddaney@caviumnetworks.com> wrote:
> Section headers are not relevant to any of this. ?You need to look at
> the program headers. ?Try 'readelf -l'
Sorry for jumping in. I think this is the data we needed in this case:
readelf --program-headers /bin/ls | grep -A 10 PHDR
PHDR 0x000034 0x08048034 0x08048034 0x00120 0x00120 R E 0x4
INTERP 0x000154 0x08048154 0x08048154 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.2]
LOAD 0x000000 0x08048000 0x08048000 0x17fd8 0x17fd8 R E 0x1000
<...etc....>
If alignment isn't "compatible" with the expected address or
realocation work done by the loader, there comes the crash I guess....
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 26+ messages in thread
* page size change on MIPS
[not found] ` <AANLkTiko4fUdKNvAP-PvxaJiT6MMJnVw+ZTCMLT1FkK9@mail.gmail.com>
@ 2011-02-08 8:34 ` Mulyadi Santosa
0 siblings, 0 replies; 26+ messages in thread
From: Mulyadi Santosa @ 2011-02-08 8:34 UTC (permalink / raw)
To: kernelnewbies
Hi...
On Tue, Feb 8, 2011 at 14:35, naveen yadav <yad.naveen@gmail.com> wrote:
> Hi All,
>
> I debug this issue further, I check in kernel ?File name is
> binfmt_elf.c and function name is ?create_elf_tables()
>
> I put a debug print here to check what kernel is reading from user space.
>
> ? ? ? ? ? ? ? ?if (__put_user((elf_addr_t)p, argv++))
> ? ? ? ? ? ? ? ? ? ? ? ?return -EFAULT;
> ? ? ? ? ? ? ? ?len = strnlen_user((void __user *)p, MAX_ARG_STRLEN);
> ? ? ? ? ? ? ? ?printk("\n Lenght of arg=%ld,%s \n",len,(void __user *)p);
> ? ? ? ? ? ? ? ?if (!len || len > MAX_ARG_STRLEN)
> ? ? ? ? ? ? ? ? ? ? ? ?return -EINVAL;
> ? ? ? ? ? ? ? ?p += len;
> ? ? ? ?}
>
>
> when Page size is 16KB ?o/p is
>
> Lenght of arg=6,/init
>
> when Page size is 64KB ?o/p is
>
> Lenght of arg=1,
>
> so I got null when it read from ELF
hum? very strange.... so essentially it can't read...or to be precise,
properly read command arguments (including the executable name
itself)?
maybe the problem lies somewhere in the initrd/initramfs?
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2011-02-08 8:34 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 15:02 page size change on MIPS naveen yadav
2011-01-24 15:02 ` naveen yadav
2011-01-24 18:56 ` David Daney
2011-01-24 18:56 ` David Daney
2011-01-24 19:13 ` Kevin D. Kissell
2011-01-24 19:13 ` Kevin D. Kissell
2011-01-27 14:55 ` naveen yadav
2011-01-27 14:55 ` naveen yadav
2011-01-27 15:18 ` adnan iqbal
2011-01-27 17:44 ` David Daney
2011-01-27 17:44 ` David Daney
2011-01-28 9:18 ` naveen yadav
2011-01-28 9:18 ` naveen yadav
2011-01-28 18:48 ` David Daney
2011-01-28 18:48 ` David Daney
2011-01-30 15:02 ` Himanshu Aggarwal
2011-01-30 15:02 ` Himanshu Aggarwal
2011-01-31 13:08 ` Ralf Baechle
2011-02-04 3:24 ` naveen yadav
2011-02-04 3:24 ` naveen yadav
2011-02-04 4:16 ` naveen yadav
2011-02-04 4:16 ` naveen yadav
2011-02-04 17:25 ` David Daney
2011-02-04 17:25 ` David Daney
2011-02-05 13:53 ` Mulyadi Santosa
[not found] ` <AANLkTinsRxKhw-r0LBzwSMpiYs8eK1G26Z=gWwPuRu=i@mail.gmail.com>
[not found] ` <mcr4o8j3gwf.fsf@google.com>
[not found] ` <4D4C39E5.6030403@caviumnetworks.com>
[not found] ` <AANLkTinHaWCuyyeb_NA9PLpoH0aZC39-b1Z7FYmAUXp=@mail.gmail.com>
[not found] ` <4D508397.6000809@caviumnetworks.com>
[not found] ` <AANLkTiko4fUdKNvAP-PvxaJiT6MMJnVw+ZTCMLT1FkK9@mail.gmail.com>
2011-02-08 8:34 ` Mulyadi Santosa
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.