QEMU with U-Boot uses 100% of CPU
up vote
0
down vote
favorite
Inside a Lubuntu VirtualBox VM (macOS host) I'm running QEMU with a U-Boot kernel (?) to load my compiled ARM assembly code (using tftp addr *.bin
and go addr
).
My problem is that QEMU uses 100% of the CPU. I'm following an Assembly programming course and was told that it wasn't normal (that's also why I'm using a VM)…
I'm not sure where does the problem come from, is it a config issue with VirtualBox (Guest additions are installed) or with QEMU?
QEMU is launched with the following arguments:
export QEMU_AUDIO_DRV=none
qemu-arm/arm-softmmu/qemu-system-arm -s -localtime -m 256 -M reptar -kernel u-boot-arm/u-boot -tftp . -serial mon:stdio -nographic
Version is:
$ qemu-arm/arm-softmmu/qemu-system-arm --version
QEMU emulator version 2.4.1 (qemu-linaro from git), Copyright (c) 2003-2008 Fabrice Bellard
Boot output:
reptar-sp6-emul: sp6_emul_init
sp6_emul_init: failed to connect to SP6 server
sp6_emul_init: terminate thread
U-Boot 2016.09 (Sep 26 2018 - 17:19:23 +0200)
OMAP35XX-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
REDS Reptar board + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: OMAP SD/MMC: 0
Using default environment
Net: smc911x-0
Reptar #
virtualization qemu u-boot
add a comment |
up vote
0
down vote
favorite
Inside a Lubuntu VirtualBox VM (macOS host) I'm running QEMU with a U-Boot kernel (?) to load my compiled ARM assembly code (using tftp addr *.bin
and go addr
).
My problem is that QEMU uses 100% of the CPU. I'm following an Assembly programming course and was told that it wasn't normal (that's also why I'm using a VM)…
I'm not sure where does the problem come from, is it a config issue with VirtualBox (Guest additions are installed) or with QEMU?
QEMU is launched with the following arguments:
export QEMU_AUDIO_DRV=none
qemu-arm/arm-softmmu/qemu-system-arm -s -localtime -m 256 -M reptar -kernel u-boot-arm/u-boot -tftp . -serial mon:stdio -nographic
Version is:
$ qemu-arm/arm-softmmu/qemu-system-arm --version
QEMU emulator version 2.4.1 (qemu-linaro from git), Copyright (c) 2003-2008 Fabrice Bellard
Boot output:
reptar-sp6-emul: sp6_emul_init
sp6_emul_init: failed to connect to SP6 server
sp6_emul_init: terminate thread
U-Boot 2016.09 (Sep 26 2018 - 17:19:23 +0200)
OMAP35XX-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
REDS Reptar board + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: OMAP SD/MMC: 0
Using default environment
Net: smc911x-0
Reptar #
virtualization qemu u-boot
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Inside a Lubuntu VirtualBox VM (macOS host) I'm running QEMU with a U-Boot kernel (?) to load my compiled ARM assembly code (using tftp addr *.bin
and go addr
).
My problem is that QEMU uses 100% of the CPU. I'm following an Assembly programming course and was told that it wasn't normal (that's also why I'm using a VM)…
I'm not sure where does the problem come from, is it a config issue with VirtualBox (Guest additions are installed) or with QEMU?
QEMU is launched with the following arguments:
export QEMU_AUDIO_DRV=none
qemu-arm/arm-softmmu/qemu-system-arm -s -localtime -m 256 -M reptar -kernel u-boot-arm/u-boot -tftp . -serial mon:stdio -nographic
Version is:
$ qemu-arm/arm-softmmu/qemu-system-arm --version
QEMU emulator version 2.4.1 (qemu-linaro from git), Copyright (c) 2003-2008 Fabrice Bellard
Boot output:
reptar-sp6-emul: sp6_emul_init
sp6_emul_init: failed to connect to SP6 server
sp6_emul_init: terminate thread
U-Boot 2016.09 (Sep 26 2018 - 17:19:23 +0200)
OMAP35XX-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
REDS Reptar board + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: OMAP SD/MMC: 0
Using default environment
Net: smc911x-0
Reptar #
virtualization qemu u-boot
Inside a Lubuntu VirtualBox VM (macOS host) I'm running QEMU with a U-Boot kernel (?) to load my compiled ARM assembly code (using tftp addr *.bin
and go addr
).
My problem is that QEMU uses 100% of the CPU. I'm following an Assembly programming course and was told that it wasn't normal (that's also why I'm using a VM)…
I'm not sure where does the problem come from, is it a config issue with VirtualBox (Guest additions are installed) or with QEMU?
QEMU is launched with the following arguments:
export QEMU_AUDIO_DRV=none
qemu-arm/arm-softmmu/qemu-system-arm -s -localtime -m 256 -M reptar -kernel u-boot-arm/u-boot -tftp . -serial mon:stdio -nographic
Version is:
$ qemu-arm/arm-softmmu/qemu-system-arm --version
QEMU emulator version 2.4.1 (qemu-linaro from git), Copyright (c) 2003-2008 Fabrice Bellard
Boot output:
reptar-sp6-emul: sp6_emul_init
sp6_emul_init: failed to connect to SP6 server
sp6_emul_init: terminate thread
U-Boot 2016.09 (Sep 26 2018 - 17:19:23 +0200)
OMAP35XX-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 MHz
REDS Reptar board + LPDDR/NAND
I2C: ready
DRAM: 256 MiB
NAND: 256 MiB
MMC: OMAP SD/MMC: 0
Using default environment
Net: smc911x-0
Reptar #
virtualization qemu u-boot
virtualization qemu u-boot
asked Nov 9 at 20:43
nyg
1,18711329
1,18711329
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
QEMU will use host CPU when the guest CPU is doing something, even if that "something" is "spin around in a tight loop". If the guest code uses the CPU instruction WFI ("wait for interrupt") in its idle loop, QEMU will handle that by stopping until a guest interrupt occurs. (WFI is an Arm instruction; for other guest architectures there is generally an equivalent instruction, like x86's HLT.)
So whether QEMU uses 100% CPU when the guest is "idle" depends on what exactly the guest's idle loop does. The idle loop in a "real OS" like Linux will use WFI (which on real hardware is useful for reducing power consumption) and so will idle at very low host CPU usage. CPU usage sitting at a u-boot prompt will depend on how u-boot is coded; CPU usage in your assembly code will depend on what it does.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
QEMU will use host CPU when the guest CPU is doing something, even if that "something" is "spin around in a tight loop". If the guest code uses the CPU instruction WFI ("wait for interrupt") in its idle loop, QEMU will handle that by stopping until a guest interrupt occurs. (WFI is an Arm instruction; for other guest architectures there is generally an equivalent instruction, like x86's HLT.)
So whether QEMU uses 100% CPU when the guest is "idle" depends on what exactly the guest's idle loop does. The idle loop in a "real OS" like Linux will use WFI (which on real hardware is useful for reducing power consumption) and so will idle at very low host CPU usage. CPU usage sitting at a u-boot prompt will depend on how u-boot is coded; CPU usage in your assembly code will depend on what it does.
add a comment |
up vote
0
down vote
QEMU will use host CPU when the guest CPU is doing something, even if that "something" is "spin around in a tight loop". If the guest code uses the CPU instruction WFI ("wait for interrupt") in its idle loop, QEMU will handle that by stopping until a guest interrupt occurs. (WFI is an Arm instruction; for other guest architectures there is generally an equivalent instruction, like x86's HLT.)
So whether QEMU uses 100% CPU when the guest is "idle" depends on what exactly the guest's idle loop does. The idle loop in a "real OS" like Linux will use WFI (which on real hardware is useful for reducing power consumption) and so will idle at very low host CPU usage. CPU usage sitting at a u-boot prompt will depend on how u-boot is coded; CPU usage in your assembly code will depend on what it does.
add a comment |
up vote
0
down vote
up vote
0
down vote
QEMU will use host CPU when the guest CPU is doing something, even if that "something" is "spin around in a tight loop". If the guest code uses the CPU instruction WFI ("wait for interrupt") in its idle loop, QEMU will handle that by stopping until a guest interrupt occurs. (WFI is an Arm instruction; for other guest architectures there is generally an equivalent instruction, like x86's HLT.)
So whether QEMU uses 100% CPU when the guest is "idle" depends on what exactly the guest's idle loop does. The idle loop in a "real OS" like Linux will use WFI (which on real hardware is useful for reducing power consumption) and so will idle at very low host CPU usage. CPU usage sitting at a u-boot prompt will depend on how u-boot is coded; CPU usage in your assembly code will depend on what it does.
QEMU will use host CPU when the guest CPU is doing something, even if that "something" is "spin around in a tight loop". If the guest code uses the CPU instruction WFI ("wait for interrupt") in its idle loop, QEMU will handle that by stopping until a guest interrupt occurs. (WFI is an Arm instruction; for other guest architectures there is generally an equivalent instruction, like x86's HLT.)
So whether QEMU uses 100% CPU when the guest is "idle" depends on what exactly the guest's idle loop does. The idle loop in a "real OS" like Linux will use WFI (which on real hardware is useful for reducing power consumption) and so will idle at very low host CPU usage. CPU usage sitting at a u-boot prompt will depend on how u-boot is coded; CPU usage in your assembly code will depend on what it does.
edited Nov 12 at 14:51
answered Nov 12 at 13:12
Peter Maydell
2,066159
2,066159
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53233009%2fqemu-with-u-boot-uses-100-of-cpu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown