Slashdot Mirror


QEMU Accelerator Achieves Near-Native Performance

An anonymous reader writes "QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. Its sporting a new module called the 'Accelerator' which can achieve near native speeds, and currently runs on Linux 2.4.x and 2.6.x kernels. This means you could theoretically run Windows (or another OS) on a Linux machine at near native speeds without buying a commercial emulator. The catch is that although QEMU is released under various open source licenses, the Accelerator uses a free (as in beer) license because the module is a 'closed source proprietary product.' Fabrice Bellard does mention that he would consider open sourcing the Accelerator under certain conditions."

32 of 366 comments (clear)

  1. cool stuff by Prophetic_Truth · · Score: 3, Interesting

    but how fast is "near native"? Some would consider WINE near native in certain aspects, in short, WHERES THE BEEF?

    --
    time is a perception of a being's consciousness
    time is your 6th sense, the wierd ones are 7+
    1. Re:cool stuff by tepples · · Score: 3, Informative

      RTFA. "Near native" in this case means about half as fast as native execution on the bare hardware. This should be enough to run the vertical market apps that a lot of business IT departments female-dog about when clinging to their Windows environment.

    2. Re:cool stuff by bcmm · · Score: 4, Informative

      Wine Is Not an Emulator.

      Wine is a re-implementation of some of the Win32 API for Linux. Unless combined with an actual hardware emulator, it only works on x86. It just runs x86 binaries on an x86 processor like Windows does, but providing some commonly used Windows API calls.

      In short, running programs using Wine is "native", and, programs that work at all are often actually faster with Wine than with Windows for the same reasons that anything runs faster on Linux.

      --
      # cat /dev/mem | strings | grep -i llama
      Damn, my RAM is full of llamas.
    3. Re:cool stuff by reub2000 · · Score: 4, Informative

      Qemu is usually an emulator, unless you use the kqemu module which makes it a virutualizer like VMware.

  2. Processor emulator by Saeed+al-Sahaf · · Score: 3, Funny
    open source processor emulator?

    So I can emulate my P4 on my P4? Swift!

    --
    "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    1. Re:Processor emulator by Lisandro · · Score: 4, Funny

      You can. Just put the heatsink in the oven for 15 minutes at 400C before use.

  3. Doesn't work on PPC or SPARC by mrbrown1602 · · Score: 4, Informative

    It should be noted that the Accelerator only works with x86 computers. It will not work on SPARC or PPC.

    1. Re:Doesn't work on PPC or SPARC by timeOday · · Score: 3, Interesting
      That tells us how it works, doesn't it? It must set up traps so that things that need to be emulated are caught, and then directly execute the code that would otherwise be emulated.
      If so, it isn't an emulator and "near native on some code" performance isn't a big deal - about the same as VMWare.

      Hopefully it really is an emulator, and the accelerator simply hasn't been written for other platforms yet.

      If the claim were true, and could run even graphical apps decently fast, Intel should throw a couple million bucks at this guy for the fastest possible X86 on IA64 emulation - they need it.

  4. This is great! by Husgaard · · Score: 5, Funny

    I am really looking forward to emulating an Opteron at near native speed on my good old 386sx processor...

  5. Money? by cronius · · Score: 4, Insightful

    Open Sourcing the QEMU Accelerator Technology ?
    As a supporter of open source, the author accepts to open source the QEMU Accelerator Technology provided a company invests enough money to support the project and to recompense the author from the potential loss of revenue. Interested companies can look at the roadmap and make suggestions to the author.


    If it actually achieves near-native performance right now, how much better can it get? And since it's already gratis, would anyone want to pay for one that achives actual native performance?

    I don't think there's much money up for grabs here, to be honest. But that depends on how good it really is right now.

    --
    Life is Reality
  6. Oh yeah! by Saint+Aardvark · · Score: 5, Interesting
    I've been trying out VMware's latest beta at work (journal entry on that in an hour or so) to run W2K on Linux, in order to try some patch automation software. It's great, but I'd love it if there was a Free program that'd do this.

    I dearly hope the accelerator gets GPL'd. Between sysadmin work (reverting to a snapshot ROX) and, just maybe, being able to move W2K people to Linux (there's only a handful of applications we need [damn you, Texas Instruments! Where's your Linux version of Code Composer?], and remote admin is just soooooooo much better with a Unix), I'd be very happy if a) this thing works as well as it's supposed to, and b) if there was some sort of tip jar I could kick in a few bucks to (like with Blender, I believe), and get it released when there was enough money.

    Incidentally, I tried installing W2K on qemu w/o the accelerator. When I left work on Friday, it was finishing up the second stage of installation; it was slow as molasses, but seemed to be working. This seems to contradict the note re: disk full during install problem noted on the support page. It's always possible I just haven't hit it yet, but does anyone else have any experience with W2K and qemu?

    1. Re:Oh yeah! by stevey · · Score: 3, Informative

      I installed Win2k on a Debian installation without the accelerator - and wrote about it here Running Microsoft Windows inside Debian : Qemu.

      I found the process of installation took a couple of hours, which didn't feel really excessive. Once installed it's pretty good to use, for small things.

      Right now I'm using qemu to practise the upgrade of a busy server from Woody to Sarge (whenever its ready!). All I can say is that the program rocks, and many thanks to its authors.

  7. qemu DOES work by supersuckers · · Score: 5, Informative

    A lot of people seem skeptical so far. I've been using qemu to run windows98 under linux for close to a year now. This was before this "accelerator" It was definitely usable. I needed windows for an application from my job, and this let me use it without rebooting. I installed it using the following instructions: http://forums.gentoo.org/viewtopic-t-186001-highli ght-qemu+howto.html

  8. Dual licence ? by Alain+Williams · · Score: 4, Insightful

    Why not release under a dual licence as mysql have done ... they seem to rake in money while giving the product away. Yes: most people will have it for free, but some will want to pay (to include in a proprietary bundle/...) - the extra market/awareness that open sourcing it will bring will mean that he will get a slice of a larger cake.

    1. Re:Dual licence ? by fabu10u$ · · Score: 3, Insightful

      Especially because with enough performance this is a good candidate for embedding in a commercial product, i.e. if your code is really tied to a specific architecture you could "port" by wrapping QEMU around it.

      --
      They say the mind is the first thing to ... uh, what's that saying again?
  9. Re:if only they could get this to run faster by fabu10u$ · · Score: 5, Funny
    From your link:

    Hear God Anywhere! - Get BiblePlayer Deluxe for $29 +s/h
    If you need an iPod to hear God, maybe you should start looking for a different faith...
    --
    They say the mind is the first thing to ... uh, what's that saying again?
  10. Qemu - information by Richard_J_N · · Score: 5, Informative

    Here's a bit more about Qemu. I've now used it quite a bit, and am impressed by it!

    Qemu can essentially run any guest OS (Linux,Windows,MacOS,BSD,menuetOS...) under any other. This normally incurs approximately a 4x slowdown, which is pretty good. I've personally installed XP on Linux this way. It's also a great way to test out the latest knoppix.

    The KQEmu (accelerator) is a kernel module which allows near-native speeds, if both the guest and host architecture are x86.

    Qemu is Free (speech and beer); the accelerator is free (beer), but not, at least for now, open source.

    In the specific case of needing to run windows apps on Linux, we have now several options:

    API emulation: Wine
    PC emulation: Qemu (free)/VMWare (expensive)
    VNC: (and just move the display)

  11. iPC? by Doc+Ruby · · Score: 4, Interesting

    Can you cut & paste between the Windows::apps and Linux::apps? Can each OS instance get its own IP# for IPC?

    This app could offer a nice technique for "embedded" Windows: Run Linux, and QEMU::Windows with the Windows "screen" hidden or suppressed. Run vncserver on the Windows instance, and a vncviewer on the Linux desktop. Run a watchdog app that pings Windows and its apps, restarting them when they freeze. Put the host in the closet, and never hear surf music again.

    --

    --
    make install -not war

  12. Re:I'm getting pretty skeptical of these things by caseih · · Score: 5, Informative

    The qemu claims are accurate. I am currently using this module with qemu and find that I do get 60-70% native speed (just as he advertises) and it is only going to get better. mind you this is x86 on x86. I/O performance (just like on vmware) is still a pig.

    Look. Just go download it and try it. Don't post stupid pointless comments about how skeptical you. Don't know how that rated insightful.

  13. Boy, it's a screamer! by Just+Some+Guy · · Score: 4, Funny
    I like the speedup table:
    • Emulator
    • Typical application slow down ratio compared to native
    • QEMU
    • 5 to 10
    • QEMU + QEMU accelerator
    • 1 to 2

    I read those "ratios" as, well, ratios: "Wow, QEMU has a 5:10 slowdown, while the accelerator only has a 1:2 slowdown! I should write one with a .1:.2 slowdown! Oops, done."

    --
    Dewey, what part of this looks like authorities should be involved?
  14. fabrice's other projects by harlemjoe · · Score: 5, Interesting

    afaik the only way to run wine on linux-ppc (WINE is not an emulator, and so is x86 dependent) is by using qemu...

    also check out darwine... integrated qemu + wine under OS X so you can http://darwine.opendarwin.org/ click on windows apps and run them seamlessly in OS X

    fabrice bellard is a processor emulating god imho

    --
    shooting is not too good for my enemies
    1. Re:fabrice's other projects by Spy+Hunter · · Score: 5, Informative
      He is not merely a processor emulating god; he is a coding god in general. Look at his project page. QEmu is not even his most significant project! He the main force behind the FFMpeg project, which is the premier open-source library for all things video-related (including open-source encoders and/or decoders for nearly every video/audio codec known to man). You can thank him for much of the progress that MPlayer/Xine have made, especially on non-x86 systems.

      In addition, he has implemented a complete C99 compiler, and a software modem (unfortunately incomplete), which is the hard part of making open-source WinModem drivers. Also, an emacs clone which also happens to have full Unicode support (including bidirectional editing), *and* a built-in HTML/CSS2 renderer with WYSIWYG editing.

      And if that wasn't enough, he has won awards in the IOCCC twice. If that doesn't prove he's a true coding god, I don't know what would. He has done all of this in his free time, for no pay. I think it is safe to say that he *really* deserves a sponsorship.

      --
      main(c,r){for(r=32;r;) printf(++c>31?c=!r--,"\n":c<r?" ":~c&r?" `":" #");}
  15. Re:EMULATOR?? by sanermind · · Score: 5, Informative

    The main bulk of QEMU (which is all open source BTW) is entirely an emulator. It uses just-in-time dynamic binary translation to convert from the guest architecture to the host architecture, using an internal intermediate representation. At this level it is altogether an emulator... you can run x86 on powerPC or sparc on x86, or x86 on x86, etc. But because this the overhead is not insignificant. There seems to be a 5 - 10 times slowdown when I run winXP under linux in an emulated environment.

    What the new KQemu accelerator does, is replace some of the emulation [specifically, of user-space code not in ring 0] with direct VMware-style virtualization, where the code is being run natively and trapped by the monitor. Important to note with KQemu is that kernel code is still being wholly emulated. Virtualizing only user-space is so much easier... I believe that Plex86 gave up on trying to virtualize ring0 code on x86 a while back, because the x86 isn't well designed for this. Running winXP with the accelerator causes it to run pretty close to native, though. Where before under just emulation, trying to play a video with windows media player took over a minute for a frame to show up and otherwise froze, with KQemu I can actually play video relatively smoothly. This is a wonderous thing! Basically, you can get almost all of the functionality of VMware, but FOR FREE.

    --

    ---
    the pen is mightier than the sword, the sword is mightier than the court, the court is mightier than the pen.
  16. Other goodies in QEMU by sanermind · · Score: 4, Informative

    Not otherwise mentioned here: full sound support via SB16 emulation, built in NAT network support [the guest OS can use DHCP to get an address], and easy access to your linux filesystem on hosted windows environments via automatically configured SMB shares! It runs smbd as a slave process and comunicates with it over pipes, so it dosen't even require any root permisions.

    qemu -hda /ahuge/unt/qemuXP.img -boot c -m 384 -user-net -enable-audio -smb /home/michael -pci &

    Simple as that, and you're running XP with audio, network, and local filesystem access.

    Of course, having to insmod a closed-source kernel module is unnerving, admitedly. But all of the above still applies and is usable without it, it's just not nearly as fast.

    --

    ---
    the pen is mightier than the sword, the sword is mightier than the court, the court is mightier than the pen.
  17. The ignorant laugh by fm6 · · Score: 4, Insightful
    Ha ha. The point is not just that you emulate the processor, but that you emulate the complete environment. In theory, you can do this without processor emulation using the Virtual Machine Monitor feature in IA-32 chips. Unfortunately, nobody except VMWare has figured out how to do this well enough to support guest OSs reliably.

    I sometimes want to play old DOS games on my P3 machine. A lot of these games work in Real Mode, period. And they often can't do sound except on specific sound cards. I can:

    • Get a second machine for game playing. I don't spend that much time playing games. At least I hope not...
    • Reboot to DOS every time I want to run a game. Inconvenient, and the sound doesn't always work.
    • Fire up VMWare. Except I can't afford a copy right now...
    • Run DOSBox, which emulates not only a 286-class processor, but other legacy hardware such as sound cards and Hercules Graphics.
    DOSBox is a really impressive bit of software, but it demands a lot of cycles to get the job done. (Typically, 75% of the CPU time on my P3 when I do VGA games full screen. Playing in a window is impossible unless I step down the color depth of my display.) So it's not good for much except real- and protected-mode games. An open-source emulator that doesn't have that kind of overhead would be very useful.
  18. Status update on Linux/PPC test by zapp · · Score: 4, Informative

    I decided to test this on my 1.25GHz G4 Powerbook running Yellow Dog Linux 4.0.

    -It compiled in about 2 minutes flat
    -The sample Freedos and Linux-Test images booted fine
    - In the linux-test, /proc/cpuinfo reported an 18MHz Pentium Pro (ouch)
    - I used qemu-img to create a 3gb disk image for testing Windows XP
    - I booted off a Windows XP CD, and am in progress of installing on said disk image
    ( qemu -cdrom /dev/cdrom -boot d winxp.img )

    --
    no comment
  19. Escaping the Palladium Jail? by Jah-Wren+Ryel · · Score: 5, Interesting

    Could this be used to sufficiently virtualize a 'palladiumized' system such that we could run a hypothetical DRM-up-the-ass version of Windows in it and then from the host OS side peek at all the secret data that the copyright cartel thinks is locked down?

    --
    When information is power, privacy is freedom.
    1. Re:Escaping the Palladium Jail? by Anonym0us+Cow+Herd · · Score: 4, Interesting

      NO. Not if the hardware has "trusted computing".

      The trust begins at the hardware.

      The motherboard must first examine the bootloader to see that it trusts it. If so, then trust is passed to the (un-compromised) boot loader.

      The boot loader can look at the OS it is loading to see if it is trusted. If so, then trust can be given to the OS. An untrusted OS could be loaded, but it would have no trust. The untrusted OS can't ask the TPM chip "Hey, sign this for me using your secret private key."

      If the OS is trusted, it can then determine if certian applications are trusted. QEMU would not be trusted. It could run, but would not be trusted.

      When you run RIAA-Approved software, it is able to prove, via. a chain of trust (certificates) that it is trusted and running on a non-compromised system.

      So why can't QEMU emulate the TPM chip? Because it does not know any secret keys. Each TPM has a secret key. And that key is a secret. Forever sealed in the chip. Even the manufacturer does not know the key. The key is a true secret. Nothing outside of the TPM chip itself has ever seen that private key. The TPM's public key was signed at the factory. You and everyone can know the public key of any TPM. And those public keys can be proven authentic because of their certificates (i.e. they are signed). You could generate an emulated TPM public/private key, but the public key is not signed by Dell. You know the public key of your box, but not the secret private key, which you can probably never know.

      --
      The price of freedom is eternal litigation.
  20. Re:I'm getting pretty skeptical of these things by TheRaven64 · · Score: 5, Informative
    First of all, this is by the guy who already wrote FFMPEG (MPEG transcoder), the Tiny C Compiler, and QEMU - an emulator that is capable of emulating several different CPUs running on several other host CPUs at impressive speeds (compare it to Bochs sometime). Quite an impressive resumé, and someone whose claims I would be inclined to take seriously.

    Secondly, QEMU Accelerator is not an emulator, it is a virtualisation layer. It executes most instructions on the host CPU, using the emulator as a sand-box and system emulator, rather than a CPU emulator. Emulating x86 on x86 at a reasonable speed is really not that hard (non-trivial, but certainly not unbelievable).

    --
    I am TheRaven on Soylent News
  21. Re:to wine or not to wine by Weaselmancer · · Score: 3, Informative

    But what, exactly, is best?

    Well, in a lot of ways that's like asking what's the best tool in your toolbox? It depends on what you're trying to do. Hammer a nail, use a hammer. Tighten a bolt, use a wrench. A wrench makes a lousy hammer and a hammer makes a lousy wrench.

    Wine is great for running x86 Windows apps natively on Linux. It has no Microsoft code in it whatsoever - that's it's advantage. No MS tax to run MS apps. Downside is that it isn't 100% accurate - some apps don't work. By its very nature it'll always be a work in progress.

    Qemu (and VMware and their like) emulate a complete computer. They're slower because they have to emulate hardware. And to run Windows apps, you'll need a copy of a Microsoft OS, so you've got a licensing issue there. As a plus, you can do development on a virtual machine and cause any kind of damage, and (if you've backed up before you tried it), fixing things is as simple as tar -xvzf yourbackup.tgz.

    Explore both options a bit and you'll find that each one solves a particular class of problems. More tools in the toolbox is always good.

    --
    Weaselmancer
    rediculous.
  22. Damned impressive...(how to test with Knoppix) by jbwiv · · Score: 3, Informative
    Wow...I'm simply staggered by this. I've been waiting around for Netraverse to release a version that supported Windows XP...now I no longer have to wait!

    All you haters need to quit your bitchin'....Mr. Fabrice Bellard, THANK YOU FOR THIS PROJECT!

    If you'd like to give it a try with Knoppix and you have an ISO lying around, type:

    qemu -cdrom /path/to/knoppix.iso

    Boots up perfectly. WOW!
  23. he's probably best off just releasing it by idlake · · Score: 3, Insightful

    The author writes:

    As a supporter of open source, the author accepts to open source the QEMU Accelerator Technology provided a company invests enough money to support the project and to recompense the author from the potential loss of revenue. Interested companies can look at the roadmap and make suggestions to the author.

    What matters isn't really the potential loss of revenue, but the expected loss of revenue, i.e., large amount of money multiplied by the low probability of actually succeeding.

    I'm sure the accelerator is skillfully written, but I think chances of turning QEMU+Accelerator into something commercially successful are next to nil. Why? Foremost because the market already has VirtualPC and VMware in it, created and maintained by big companies with deep pockets, lots of lawyers, and large patent portfolios. Oh, and then there are coLinux, Xen, and UML that he would be competing with as well.

    To compete, he'd have to get startup funding, a management team, developers, support, and, worst of all, sales people: a lot of work, a lot of money, and next to impossible if you don't either get a lot of buzz or know the right people. Then he'd have to develop a product; a product isn't just a working piece of code, it's documentation, training, tutorials, travel, presentations. People don't expect that from FOSS, but they do expect it as soon as they pay a couple of bucks for something. Even if he does all that, the most likely outcome is still that the startup fails. But even if it succeeded, he would probably only end up with a small slice of a moderately successful company (competition and all that), and only after spending several years of his life doing things he probably doesn't enjoy.

    I think people underestimate how hard it is to commercialize something, even something that is really good and novel (his software may be really good, but it isn't novel).

    I think his best bet would be release it under a dual license (GPL/commercial) right away, while people are paying attention, and build a consulting business and commercial licensing around it. He won't become an instant billionaire that way, but if he has a worthwhile product, it can be a steady source of good money doing mostly what he enjoys. If he sits on the software too long waiting for a sugar daddy, it will be less and less likely that he will be able to get anything out of it.

    Oh, and in case you are wondering whether my argument is disingenuous and I just want to get a free virtual machine, it isn't: I already have VirtualPC and VMware, and I actually prefer the various user mode Linux solutions at this point.