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 #









share|improve this question

























    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 #









    share|improve this question























      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 #









      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 20:43









      nyg

      1,18711329




      1,18711329






















          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.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            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

























            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.






            share|improve this answer


























              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.






              share|improve this answer
























                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.






                share|improve this answer














                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.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 12 at 14:51

























                answered Nov 12 at 13:12









                Peter Maydell

                2,066159




                2,066159



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo