summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2018-07-08 20:14:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-10 17:33:00 +0100
commitc68e4c6e3eb612bb7afd9d7f1e9a6dc295d44346 (patch)
treefe09ce9482cdc31da8a24cb7adc9ea7927025f56
parent78fae8676d5c4d522a14cd31df274a33a6a53445 (diff)
downloadpoky-c68e4c6e3eb612bb7afd9d7f1e9a6dc295d44346.tar.gz
scripts/runqemu: fix qemumips qemumips64 memory detection kernel panic
$ 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! ... 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. Author: Hongxu Jia <hongxu.jia@windriver.com> [ Merge the two fixes for qemumips32 and qemumips64 into one patch, and make it support all mips cases ] (From OE-Core rev: 0220cb34a91658ecc3782ec1a4700dcb5ece37d8) Signed-off-by: He Zhe <zhe.he@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/runqemu5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index de42d0f323..73d7d5818b 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -668,7 +668,10 @@ class BaseConfig(object):
668 logger.info('QB_MEM is not set, use 512M by default') 668 logger.info('QB_MEM is not set, use 512M by default')
669 self.set('QB_MEM', '-m 512') 669 self.set('QB_MEM', '-m 512')
670 670
671 self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M' 671 mach = self.get('MACHINE')
672 if not mach.startswith('qemumips'):
673 self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
674
672 self.qemu_opt_script += ' %s' % self.get('QB_MEM') 675 self.qemu_opt_script += ' %s' % self.get('QB_MEM')
673 676
674 def check_tcpserial(self): 677 def check_tcpserial(self):