All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM
@ 2018-07-04  6:56 He Zhe
  2018-07-04  6:56 ` [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic He Zhe
  2018-07-04 13:29 ` [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM Khem Raj
  0 siblings, 2 replies; 6+ messages in thread
From: He Zhe @ 2018-07-04  6:56 UTC (permalink / raw)
  To: openembedded-core

OE uses qemumips to simulate a Malta board by default.

As upstream qemu introduced:
https://git.qemu.org/?p=qemu.git;a=commit;h=94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b

The Malta board can support up to 2GiB of RAM which should
be able to boot a Linux kernel built with CONFIG_HIGHMEM
enabled and passing "-m 2048" to QEMU and appending the
following kernel parameters:
...
mem=256M@0x0 mem=256M@0x90000000 mem=1536M@0x20000000
...

But the following commit in kernel broke above mem=X@Y setting
which added the memory as reserved memory area.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
...
commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Date:   Wed Nov 23 14:43:49 2016 +0100

    MIPS: fix mem=X@Y commandline processing
...

So remove `mem=*' to disable user-defined physical RAM map
which let kernel itself caculates memory ranges.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 scripts/runqemu | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index de42d0f323..597e7e9a79 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -668,7 +668,10 @@ class BaseConfig(object):
             logger.info('QB_MEM is not set, use 512M by default')
             self.set('QB_MEM', '-m 512')
 
-        self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
+        mach = self.get('MACHINE')
+        if mach != 'qemumips':
+            self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
+
         self.qemu_opt_script += ' %s' % self.get('QB_MEM')
 
     def check_tcpserial(self):
-- 
2.11.0



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

* [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic
  2018-07-04  6:56 [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM He Zhe
@ 2018-07-04  6:56 ` He Zhe
  2018-07-04 13:29 ` [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM Khem Raj
  1 sibling, 0 replies; 6+ messages in thread
From: He Zhe @ 2018-07-04  6:56 UTC (permalink / raw)
  To: openembedded-core

$ runqemu qemumips64 core-image-minimal nographic qemuparams="-m 512"
...
[    0.000000] Call Trace:
[    0.000000] [<ffffffff801268c0>] clear_page+0x0/0x128
[    0.000000] [<ffffffff80238158>] get_page_from_freelist+0xab8/0xc00
[    0.000000] [<ffffffff80238964>] __alloc_pages_nodemask+0xdc/0xf68
[    0.000000] [<ffffffff80239808>] __get_free_pages+0x18/0x70
[    0.000000] [<ffffffff80122a4c>] setup_zero_pages+0x1c/0xb8
[    0.000000] [<ffffffff80c7c998>] mem_init+0x54/0xa0
[    0.000000] [<ffffffff80c74904>] start_kernel+0x204/0x4d8
[    0.000000] [<ffffffff8091dfb0>] kernel_entry+0x0/0x40
[    0.000000] Code: 02002025  1000f8d9  8e634d7c <34860f80> cc9e0000
cc9e0020  cc9e0040  cc9e0060  cc9e0080
[    0.000000]
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
...

Remove `mem=*' to disable user-defined physical RAM map which
let kernel itself caculates memory ranges.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 597e7e9a79..78f5c8b778 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -669,7 +669,7 @@ class BaseConfig(object):
             self.set('QB_MEM', '-m 512')
 
         mach = self.get('MACHINE')
-        if mach != 'qemumips':
+        if mach != 'qemumips' and mach != 'qemumips64':
             self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
 
         self.qemu_opt_script += ' %s' % self.get('QB_MEM')
-- 
2.11.0



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

* Re: [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM
  2018-07-04  6:56 [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM He Zhe
  2018-07-04  6:56 ` [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic He Zhe
@ 2018-07-04 13:29 ` Khem Raj
  2018-07-05  9:37   ` He Zhe
  1 sibling, 1 reply; 6+ messages in thread
From: Khem Raj @ 2018-07-04 13:29 UTC (permalink / raw)
  To: zhe.he; +Cc: Patches and discussions about the oe-core layer

i think you can squash both patches into one. Additionally we should
be able to cover mipsel case as well
On Tue, Jul 3, 2018 at 11:57 PM He Zhe <zhe.he@windriver.com> wrote:
>
> OE uses qemumips to simulate a Malta board by default.
>
> As upstream qemu introduced:
> https://git.qemu.org/?p=qemu.git;a=commit;h=94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b
>
> The Malta board can support up to 2GiB of RAM which should
> be able to boot a Linux kernel built with CONFIG_HIGHMEM
> enabled and passing "-m 2048" to QEMU and appending the
> following kernel parameters:
> ...
> mem=256M@0x0 mem=256M@0x90000000 mem=1536M@0x20000000
> ...
>
> But the following commit in kernel broke above mem=X@Y setting
> which added the memory as reserved memory area.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
> ...
> commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
> Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
> Date:   Wed Nov 23 14:43:49 2016 +0100
>
>     MIPS: fix mem=X@Y commandline processing
> ...
>
> So remove `mem=*' to disable user-defined physical RAM map
> which let kernel itself caculates memory ranges.
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
>  scripts/runqemu | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index de42d0f323..597e7e9a79 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -668,7 +668,10 @@ class BaseConfig(object):
>              logger.info('QB_MEM is not set, use 512M by default')
>              self.set('QB_MEM', '-m 512')
>
> -        self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
> +        mach = self.get('MACHINE')
> +        if mach != 'qemumips':
> +            self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
> +
>          self.qemu_opt_script += ' %s' % self.get('QB_MEM')
>
>      def check_tcpserial(self):
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM
  2018-07-04 13:29 ` [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM Khem Raj
@ 2018-07-05  9:37   ` He Zhe
  2018-07-05 15:39     ` Khem Raj
  0 siblings, 1 reply; 6+ messages in thread
From: He Zhe @ 2018-07-05  9:37 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer



On 2018年07月04日 21:29, Khem Raj wrote:
> i think you can squash both patches into one. Additionally we should
> be able to cover mipsel case as well

I started a build with latest poky and only set DEFAULTTUE=mipsel. Is this the right way to use little endian?

Then I got the following error and found kernel and kernel modules output are all big endian.

ERROR: linux-yocto-4.14.48+gitAUTOINC+94457657b8_6c2433d7c5-r0 do_package_qa: QA Issue: Endiannes did not match (1 to 0) on /work/qemumips-poky-linux/linux-yocto/4.14.48+gitAUTOINC+94457657b8_6c2433d7c5-r0/packages-split/kernel-module-i2c-dev-4.14.48-yocto-standard/lib/modules/4.14.48-yocto-standard/kernel/drivers/i2c/i2c-dev.ko [arch]

Then I tried to build a empty file.
tmp/work/x86_64-linux/gcc-cross-mipsel/8.1.0-r0/recipe-sysroot-native/usr/bin/mipsel-poky-linux/mipsel-poky-linux-gcc -c a.c
as: unrecognized option '-EL'

Does it mean there something wrong with little endian toolchain?

Zhe

> On Tue, Jul 3, 2018 at 11:57 PM He Zhe <zhe.he@windriver.com> wrote:
>> OE uses qemumips to simulate a Malta board by default.
>>
>> As upstream qemu introduced:
>> https://git.qemu.org/?p=qemu.git;a=commit;h=94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b
>>
>> The Malta board can support up to 2GiB of RAM which should
>> be able to boot a Linux kernel built with CONFIG_HIGHMEM
>> enabled and passing "-m 2048" to QEMU and appending the
>> following kernel parameters:
>> ...
>> mem=256M@0x0 mem=256M@0x90000000 mem=1536M@0x20000000
>> ...
>>
>> But the following commit in kernel broke above mem=X@Y setting
>> which added the memory as reserved memory area.
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
>> ...
>> commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
>> Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
>> Date:   Wed Nov 23 14:43:49 2016 +0100
>>
>>     MIPS: fix mem=X@Y commandline processing
>> ...
>>
>> So remove `mem=*' to disable user-defined physical RAM map
>> which let kernel itself caculates memory ranges.
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> Signed-off-by: He Zhe <zhe.he@windriver.com>
>> ---
>>  scripts/runqemu | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index de42d0f323..597e7e9a79 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -668,7 +668,10 @@ class BaseConfig(object):
>>              logger.info('QB_MEM is not set, use 512M by default')
>>              self.set('QB_MEM', '-m 512')
>>
>> -        self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
>> +        mach = self.get('MACHINE')
>> +        if mach != 'qemumips':
>> +            self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
>> +
>>          self.qemu_opt_script += ' %s' % self.get('QB_MEM')
>>
>>      def check_tcpserial(self):
>> --
>> 2.11.0
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core



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

* Re: [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM
  2018-07-05  9:37   ` He Zhe
@ 2018-07-05 15:39     ` Khem Raj
  0 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2018-07-05 15:39 UTC (permalink / raw)
  To: zhe.he; +Cc: Patches and discussions about the oe-core layer

we need to define a new machine config for qemumipsel.conf something like below

#@TYPE: Machine
#@NAME: mti_malta32_le MIPS
#@DESCRIPTION: mti_malta32_le

require conf/machine/include/qemu.inc
require conf/machine/include/tune-mips32r2.inc
require conf/machine/include/qemuboot-mips.inc

DEFAULTTUNE = "mips32r2el"

KERNEL_IMAGETYPE = "vmlinux"
KERNEL_ALT_IMAGETYPE = "vmlinux.bin"

SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"

MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
On Thu, Jul 5, 2018 at 2:37 AM He Zhe <zhe.he@windriver.com> wrote:
>
>
>
> On 2018年07月04日 21:29, Khem Raj wrote:
> > i think you can squash both patches into one. Additionally we should
> > be able to cover mipsel case as well
>
> I started a build with latest poky and only set DEFAULTTUE=mipsel. Is this the right way to use little endian?
>
> Then I got the following error and found kernel and kernel modules output are all big endian.
>
> ERROR: linux-yocto-4.14.48+gitAUTOINC+94457657b8_6c2433d7c5-r0 do_package_qa: QA Issue: Endiannes did not match (1 to 0) on /work/qemumips-poky-linux/linux-yocto/4.14.48+gitAUTOINC+94457657b8_6c2433d7c5-r0/packages-split/kernel-module-i2c-dev-4.14.48-yocto-standard/lib/modules/4.14.48-yocto-standard/kernel/drivers/i2c/i2c-dev.ko [arch]
>
> Then I tried to build a empty file.
> tmp/work/x86_64-linux/gcc-cross-mipsel/8.1.0-r0/recipe-sysroot-native/usr/bin/mipsel-poky-linux/mipsel-poky-linux-gcc -c a.c
> as: unrecognized option '-EL'
>
> Does it mean there something wrong with little endian toolchain?
>
> Zhe
>
> > On Tue, Jul 3, 2018 at 11:57 PM He Zhe <zhe.he@windriver.com> wrote:
> >> OE uses qemumips to simulate a Malta board by default.
> >>
> >> As upstream qemu introduced:
> >> https://git.qemu.org/?p=qemu.git;a=commit;h=94c2b6aff43cdfcfdfb552773a6b6b973a72ef0b
> >>
> >> The Malta board can support up to 2GiB of RAM which should
> >> be able to boot a Linux kernel built with CONFIG_HIGHMEM
> >> enabled and passing "-m 2048" to QEMU and appending the
> >> following kernel parameters:
> >> ...
> >> mem=256M@0x0 mem=256M@0x90000000 mem=1536M@0x20000000
> >> ...
> >>
> >> But the following commit in kernel broke above mem=X@Y setting
> >> which added the memory as reserved memory area.
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
> >> ...
> >> commit 73fbc1eba7ffa3bf0ad12486232a8a1edb4e4411
> >> Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
> >> Date:   Wed Nov 23 14:43:49 2016 +0100
> >>
> >>     MIPS: fix mem=X@Y commandline processing
> >> ...
> >>
> >> So remove `mem=*' to disable user-defined physical RAM map
> >> which let kernel itself caculates memory ranges.
> >>
> >> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> >> Signed-off-by: He Zhe <zhe.he@windriver.com>
> >> ---
> >>  scripts/runqemu | 5 ++++-
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/scripts/runqemu b/scripts/runqemu
> >> index de42d0f323..597e7e9a79 100755
> >> --- a/scripts/runqemu
> >> +++ b/scripts/runqemu
> >> @@ -668,7 +668,10 @@ class BaseConfig(object):
> >>              logger.info('QB_MEM is not set, use 512M by default')
> >>              self.set('QB_MEM', '-m 512')
> >>
> >> -        self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
> >> +        mach = self.get('MACHINE')
> >> +        if mach != 'qemumips':
> >> +            self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
> >> +
> >>          self.qemu_opt_script += ' %s' % self.get('QB_MEM')
> >>
> >>      def check_tcpserial(self):
> >> --
> >> 2.11.0
> >>
> >> --
> >> _______________________________________________
> >> Openembedded-core mailing list
> >> Openembedded-core@lists.openembedded.org
> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


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

* [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic
  2017-12-06  2:46 Hongxu Jia
@ 2017-12-06  2:46 ` Hongxu Jia
  0 siblings, 0 replies; 6+ messages in thread
From: Hongxu Jia @ 2017-12-06  2:46 UTC (permalink / raw)
  To: openembedded-core, ross.burton; +Cc: bruce.ashfield

$ runqemu qemumips64 core-image-minimal nographic qemuparams="-m 512"
...
[    0.000000] Call Trace:
[    0.000000] [<ffffffff801268c0>] clear_page+0x0/0x128
[    0.000000] [<ffffffff80238158>] get_page_from_freelist+0xab8/0xc00
[    0.000000] [<ffffffff80238964>] __alloc_pages_nodemask+0xdc/0xf68
[    0.000000] [<ffffffff80239808>] __get_free_pages+0x18/0x70
[    0.000000] [<ffffffff80122a4c>] setup_zero_pages+0x1c/0xb8
[    0.000000] [<ffffffff80c7c998>] mem_init+0x54/0xa0
[    0.000000] [<ffffffff80c74904>] start_kernel+0x204/0x4d8
[    0.000000] [<ffffffff8091dfb0>] kernel_entry+0x0/0x40
[    0.000000] Code: 02002025  1000f8d9  8e634d7c <34860f80> cc9e0000
cc9e0020  cc9e0040  cc9e0060  cc9e0080
[    0.000000]
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
...

Remove `mem=*' to disable user-defined physical RAM map which
let kernel itself caculates memory ranges.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 scripts/runqemu | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 0ae2f85..0c90ca7 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -659,7 +659,7 @@ class BaseConfig(object):
             self.set('QB_MEM', '-m 512')
 
         mach = self.get('MACHINE')
-        if mach != 'qemumips':
+        if mach != 'qemumips' and mach != 'qemumips64':
             self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
 
         self.qemu_opt_script += ' %s' % self.get('QB_MEM')
-- 
2.8.1



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

end of thread, other threads:[~2018-07-05 15:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04  6:56 [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM He Zhe
2018-07-04  6:56 ` [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic He Zhe
2018-07-04 13:29 ` [PATCH 1/2] scripts/runqemu: qemumips support up to 2GiB RAM Khem Raj
2018-07-05  9:37   ` He Zhe
2018-07-05 15:39     ` Khem Raj
  -- strict thread matches above, loose matches on Subject: below --
2017-12-06  2:46 Hongxu Jia
2017-12-06  2:46 ` [PATCH 2/2] scripts/runqemu: fix qemumips64 with 512M RAM caused kernel panic Hongxu Jia

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.