Skip to contentSkip to conversation

runqemu: two fixes

PATCH In review Robert Yang 2 participants 4 messages Sep 11, 2017

lore
Share & tools
lore
#0 lore raw

cover runqemu: two fixes

The following changes since commit cc319b6dcc5b4a5019fb91c9771b12ce17f3c953:

mesa-gl: Fix build after recent mesa PACKAGECONFIG changes (2017-09-05 14:58:37 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/qemu
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/qemu

Robert Yang (2):
runqemu: default qemumips memory to 256M
runqemu: let qemuparams override previous settings

 scripts/runqemu | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/2 runqemu: default qemumips memory to 256M

The qemumips or qemumips64 can't be boot with 512M.

*Fixed when no QB_MEM is set:
- runqemu qemumips nographic core-image-minimal

[    0.000000] Call Trace:
[    0.000000] [<8011c010>] clear_page+0x0/0x128
[    0.000000] [<8022b818>] get_page_from_freelist+0xa1c/0xb48
[    0.000000] [<8022c00c>] __alloc_pages_nodemask+0xd8/0xf0c
[    0.000000] [<8022ce58>] __get_free_pages+0x18/0x60
[    0.000000] [<80118674>] setup_zero_pages+0x1c/0x98
[    0.000000] [<80bd23e4>] mem_init+0x44/0x54
[    0.000000] [<80bca964>] start_kernel+0x20c/0x4bc
[    0.000000] [<80920090>] kernel_entry+0x0/0x40
[    0.000000] Code: 00000000  00000000  00000000 <34860f80> cc9e0000  cc9e0010  cc9e0020  cc9e0030  cc9e0040
[    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!

[YOCTO #11521]

---
 scripts/runqemu | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
scripts/runqemu +7 -2
index df76270..ce8cccc 100755
@@ -639,8 +639,13 @@ class BaseConfig(object):
         if s:
             self.set('QB_MEM', '-m %s' % s.group(1))
         elif not self.get('QB_MEM'):
-            logger.info('QB_MEM is not set, use 512M by default')
-            self.set('QB_MEM', '-m 512')
+            mach = self.get('MACHINE')
+            if mach.startswith('qemumips'):
+                logger.info('QB_MEM is not set, use 256M by default')
+                self.set('QB_MEM', '-m 256')
+            else:
+                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'
         self.qemu_opt_script += ' %s' % self.get('QB_MEM')
Signature · 1 line
2.10.2
#2 lore raw

Re: [PATCH 1/2] runqemu: default qemumips memory to 256M

Quoted 19 lines · Robert Yang

The qemumips or qemumips64 can't be boot with 512M.

*Fixed when no QB_MEM is set:
- runqemu qemumips nographic core-image-minimal

[    0.000000] Call Trace:
[    0.000000] [<8011c010>] clear_page+0x0/0x128
[    0.000000] [<8022b818>] get_page_from_freelist+0xa1c/0xb48
[    0.000000] [<8022c00c>] __alloc_pages_nodemask+0xd8/0xf0c
[    0.000000] [<8022ce58>] __get_free_pages+0x18/0x60
[    0.000000] [<80118674>] setup_zero_pages+0x1c/0x98
[    0.000000] [<80bd23e4>] mem_init+0x44/0x54
[    0.000000] [<80bca964>] start_kernel+0x20c/0x4bc
[    0.000000] [<80920090>] kernel_entry+0x0/0x40
[    0.000000] Code: 00000000  00000000  00000000 <34860f80> cc9e0000
cc9e0010  cc9e0020  cc9e0030  cc9e0040
[    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
Quoted 2 lines

idle task!

This only happens after removing the QB_MEM assignment from qemuboot-mips.inc right? It seems to be that handling machine-specific quirks like this should be done in the machine configuration instead of starting to have a maze of special cases in runqemu again...

Ross

#3 lore raw

PATCH 2/2 runqemu: let qemuparams override previous settings

In reply to Robert Yang

Fixed:

$ runqemu qemux86-64 qemuparams="-cpu coreduo"
The default cpu is core2duo, but coreduo should be used here.

Append qemuparams to the last can fix the problem.

[YOCTO #11773]

---
 scripts/runqemu | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
scripts/runqemu +12 -5
index ce8cccc..b58c965 100755
@@ -185,6 +185,7 @@ class BaseConfig(object):
 
         self.qemu_opt = ''
         self.qemu_opt_script = ''
+        self.qemuparams = ''
         self.clean_nfs_dir = False
         self.nfs_server = ''
         self.rootfs = ''
@@ -444,7 +445,7 @@ class BaseConfig(object):
             elif arg.startswith('biosfilename='):
                 self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):]
             elif arg.startswith('qemuparams='):
-                self.qemu_opt_script += ' %s' % arg[len('qemuparams='):]
+                self.qemuparams = ' %s' % arg[len('qemuparams='):]
             elif arg.startswith('bootparams='):
                 self.bootparams = arg[len('bootparams='):]
             elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
@@ -635,10 +636,12 @@ class BaseConfig(object):
             raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir)
 
     def check_mem(self):
-        s = re.search('-m +([0-9]+)', self.qemu_opt_script)
-        if s:
-            self.set('QB_MEM', '-m %s' % s.group(1))
-        elif not self.get('QB_MEM'):
+        for opt in (self.qemu_opt_script, self.qemuparams):
+            s = re.search('-m +([0-9]+)', opt)
+            if s:
+                self.set('QB_MEM', '-m %s' % s.group(1))
+
+        if not self.get('QB_MEM'):
             mach = self.get('MACHINE')
             if mach.startswith('qemumips'):
                 logger.info('QB_MEM is not set, use 256M by default')
@@ -1125,6 +1128,10 @@ class BaseConfig(object):
 
         self.qemu_opt += ' ' + self.qemu_opt_script
 
+        # Append qemuparams to override previous settings
+        if self.qemuparams:
+            self.qemu_opt += ' ' + self.qemuparams
+
         if self.snapshot:
             self.qemu_opt += " -snapshot"
 
Signature · 1 line
2.10.2