Skip to contentSkip to conversation

qemumips: Use 34Kf CPU emulation

PATCH In review Khem Raj 2 participants 4 messages Jul 29, 2020 1 message not in the archive

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 qemumips: Use 34Kf CPU emulation

Few years ago we switched to using mips32r2 tunings for qemumips however the default CPU emulation still remained 24Kf which is not optimal for mips32r2 ISA for qemu [1], therefore switch to recommended 32Kf for CPU emulation when running qemu in system mode

Boot time to console is ~1s faster with this setting, hopefully this should speed up qemumips in general

[1] https://www.qemu.org/docs/master/system/target-mips.html#preferred-cpu-models-for-mips-hosts

---
 meta/conf/machine/qemumips.conf | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/machine/qemumips.conf +2 -0
index 31ad754483..4617c3c7b6 100644
@@ -12,3 +12,5 @@ KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
 QB_SYSTEM_NAME = "qemu-system-mips"
+
+QB_CPU = "-cpu 34Kf"
Signature · 1 line
2.27.0
#1 lore raw
Quoted 20 lines · Khem Raj

Few years ago we switched to using mips32r2 tunings for qemumips however the default CPU emulation still remained 24Kf which is not optimal for mips32r2 ISA for qemu [1], therefore switch to recommended 32Kf for CPU emulation when running qemu in system mode

Boot time to console is ~1s faster with this setting, hopefully this should speed up qemumips in general

[1] https://www.qemu.org/docs/master/system/target-mips.html#preferred-cpu-models-for-mips-hosts

---
 meta/conf/machine/qemumips.conf | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/machine/qemumips.conf +0 -0
index 31ad754483..4617c3c7b6 100644

meta/conf/machine/qemumips.conf KERNEL_ALT_IMAGETYPE = "vmlinux.bin" · line 16

Quoted 5 lines
meta/conf/machine/qemumips.conf +2 -0
@@ -12,3 +12,5 @@ KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
 QB_SYSTEM_NAME = "qemu-system-mips"
+
+QB_CPU = "-cpu 34Kf"

Thanks!

I did run some tests locally, timing core-image-sato -c testimage before and after this change. It took 999s before, 1018s after but the difference looks like noise rather than any speedup or slowdown.

Its certainly worth a try to see if it helps the intermittent failures though.

Cheers,

Richard

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 35 lines · Richard Purdie via lists.openembedded.org
Quoted 26 lines · Khem Raj

Few years ago we switched to using mips32r2 tunings for qemumips however
the default CPU emulation still remained 24Kf which is not optimal for
mips32r2 ISA for qemu [1], therefore switch to recommended 32Kf for CPU
emulation when running qemu in system mode

Boot time to console is ~1s faster with this setting, hopefully this
should speed up qemumips in general

[1]
https://www.qemu.org/docs/master/system/target-mips.html#preferred-cpu-models-for-mips-hosts

---
 meta/conf/machine/qemumips.conf | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/machine/qemumips.conf +0 -0
index 31ad754483..4617c3c7b6 100644

meta/conf/machine/qemumips.conf KERNEL_ALT_IMAGETYPE = "vmlinux.bin" · line 16

Quoted 5 lines
meta/conf/machine/qemumips.conf +2 -0
@@ -12,3 +12,5 @@ KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
 QB_SYSTEM_NAME = "qemu-system-mips"
+
+QB_CPU = "-cpu 34Kf"

Thanks!

Quoted 3 lines

I did run some tests locally, timing core-image-sato -c testimage before and after this change. It took 999s before, 1018s after but the difference looks like noise rather than any speedup or slowdown.

Another try at "after" got 986s so who knows :)

Cheers,

Richard

author
#4 lore raw
Quoted 38 lines · Richard Purdie
Quoted 35 lines · Richard Purdie via lists.openembedded.org
Quoted 26 lines · Khem Raj

Few years ago we switched to using mips32r2 tunings for qemumips however
the default CPU emulation still remained 24Kf which is not optimal for
mips32r2 ISA for qemu [1], therefore switch to recommended 32Kf for CPU
emulation when running qemu in system mode

Boot time to console is ~1s faster with this setting, hopefully this
should speed up qemumips in general

[1]
https://www.qemu.org/docs/master/system/target-mips.html#preferred-cpu-models-for-mips-hosts

---
 meta/conf/machine/qemumips.conf | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/machine/qemumips.conf +0 -0
index 31ad754483..4617c3c7b6 100644

meta/conf/machine/qemumips.conf KERNEL_ALT_IMAGETYPE = "vmlinux.bin" · line 16

Quoted 5 lines
meta/conf/machine/qemumips.conf +2 -0
@@ -12,3 +12,5 @@ KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
 
 QB_SYSTEM_NAME = "qemu-system-mips"
+
+QB_CPU = "-cpu 34Kf"

Thanks!

Quoted 6 lines
Quoted 3 lines

I did run some tests locally, timing core-image-sato -c testimage before and after this change. It took 999s before, 1018s after but the difference looks like noise rather than any speedup or slowdown.

Another try at "after" got 986s so who knows :)

Yeah I saw that first boot was slower but reboots were always 1s faster, but hopefully it
will help with irregular timeouts on tests which is what we are looking for.

Quoted 4 lines

Cheers,

Richard