diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2021-05-07 22:16:07 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-13 18:09:10 +0100 |
commit | 1584108bdcd4083d7ee753048b68248da13782f6 (patch) | |
tree | f6c4e93684be53efc5294faeb95182becee275df | |
parent | 64ba8fc55b1f992af34b1f0a8f1e732f24bef784 (diff) | |
download | poky-1584108bdcd4083d7ee753048b68248da13782f6.tar.gz |
qemu: use 4 cores in qemu guests
Each of the cores is mapped to a thread on the host, this
should speed up things inside qemu which can take advantage of that.
(From OE-Core rev: 56f98d12a79585a4d4c459160f39403e05b620a5)
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/qemuboot.bbclass | 4 | ||||
-rwxr-xr-x | scripts/runqemu | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass index 1f8012edc1..0fdd10099c 100644 --- a/meta/classes/qemuboot.bbclass +++ b/meta/classes/qemuboot.bbclass | |||
@@ -19,6 +19,9 @@ | |||
19 | # QB_CPU_KVM: the similar to QB_CPU, but used when kvm, e.g., '-cpu kvm64', | 19 | # QB_CPU_KVM: the similar to QB_CPU, but used when kvm, e.g., '-cpu kvm64', |
20 | # set it when support kvm. | 20 | # set it when support kvm. |
21 | # | 21 | # |
22 | # QB_SMP: amount of CPU cores inside qemu guest, each mapped to a thread on the host, | ||
23 | # e.g. "-smp 8". | ||
24 | # | ||
22 | # QB_KERNEL_CMDLINE_APPEND: options to append to kernel's -append | 25 | # QB_KERNEL_CMDLINE_APPEND: options to append to kernel's -append |
23 | # option, e.g., "console=ttyS0 console=tty" | 26 | # option, e.g., "console=ttyS0 console=tty" |
24 | # | 27 | # |
@@ -80,6 +83,7 @@ | |||
80 | # See "runqemu help" for more info | 83 | # See "runqemu help" for more info |
81 | 84 | ||
82 | QB_MEM ?= "-m 256" | 85 | QB_MEM ?= "-m 256" |
86 | QB_SMP ?= "-smp 4" | ||
83 | QB_SERIAL_OPT ?= "-serial mon:stdio -serial null" | 87 | QB_SERIAL_OPT ?= "-serial mon:stdio -serial null" |
84 | QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" | 88 | QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}" |
85 | QB_DEFAULT_FSTYPE ?= "ext4" | 89 | QB_DEFAULT_FSTYPE ?= "ext4" |
diff --git a/scripts/runqemu b/scripts/runqemu index edd17d09c4..e2dc529baa 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -540,13 +540,13 @@ class BaseConfig(object): | |||
540 | def check_kvm(self): | 540 | def check_kvm(self): |
541 | """Check kvm and kvm-host""" | 541 | """Check kvm and kvm-host""" |
542 | if not (self.kvm_enabled or self.vhost_enabled): | 542 | if not (self.kvm_enabled or self.vhost_enabled): |
543 | self.qemu_opt_script += ' %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU')) | 543 | self.qemu_opt_script += ' %s %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU'), self.get('QB_SMP')) |
544 | return | 544 | return |
545 | 545 | ||
546 | if not self.get('QB_CPU_KVM'): | 546 | if not self.get('QB_CPU_KVM'): |
547 | raise RunQemuError("QB_CPU_KVM is NULL, this board doesn't support kvm") | 547 | raise RunQemuError("QB_CPU_KVM is NULL, this board doesn't support kvm") |
548 | 548 | ||
549 | self.qemu_opt_script += ' %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU_KVM')) | 549 | self.qemu_opt_script += ' %s %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU_KVM'), self.get('QB_SMP')) |
550 | yocto_kvm_wiki = "https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" | 550 | yocto_kvm_wiki = "https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" |
551 | yocto_paravirt_kvm_wiki = "https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM" | 551 | yocto_paravirt_kvm_wiki = "https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM" |
552 | dev_kvm = '/dev/kvm' | 552 | dev_kvm = '/dev/kvm' |