Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Operating Systems Software Technology

QEMU Accelerator Achieves Near-Native Performance 366

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."
This discussion has been archived. No new comments can be posted.

QEMU Accelerator Achieves Near-Native Performance

Comments Filter:
  • cool stuff (Score:3, Interesting)

    by Prophetic_Truth ( 822032 ) on Saturday February 19, 2005 @12:38PM (#11723087)
    but how fast is "near native"? Some would consider WINE near native in certain aspects, in short, WHERES THE BEEF?
    • Re:cool stuff (Score:2, Informative)

      by Anonymous Coward
      WINE *does* run at native speed becuase WINE Is Not an Emulator (see where the name comes from now?).

      Instead of emulating, WINE runs the programs using Windows libraries, either the original DLLs or rewritten versions of them.
      • I suspect the reason qemu accelerator runs at native speed is that it's not an emulator either. It probably just runs user-mode code directly as a Linux process and then catches a signal when a privileged instruction is attempted and emulates OS code.
        • > It probably just runs user-mode code directly as a Linux process and then catches a signal when a privileged instruction is attempted and emulates OS code.

          That's how all supervisor-mode virtualizers work, by only trapping certain instructions. The only emulator out of the whole bunch is bochs.

          CoLinux is my favorite solution for Linux on Windows. It's basically a port of User Mode Linux to Windows. Fast as native, just no native devices (network is done through tunnelling or a pcap hack). KDE stil
    • Re:cool stuff (Score:3, Informative)

      by tepples ( 727027 )

      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.

    • Re:cool stuff (Score:5, Informative)

      by bcmm ( 768152 ) on Saturday February 19, 2005 @01:16PM (#11723315)
      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.
      • Re:cool stuff (Score:3, Interesting)

        by Guspaz ( 556486 )
        The QEMU accelerator can also only run x86 binaries on x86 processors. It only works on x86.

        This is because it's not emulating, it's virtualizing, and tries to get as much code as possible to run native on the host CPU.

      • 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.

        Faster than on Windows? That has not been my experience at all.

        Maybe 80-90% as fast (just a seat-of-the-pants guesstimate)...
  • by Saeed al-Sahaf ( 665390 ) on Saturday February 19, 2005 @12:40PM (#11723110) Homepage
    open source processor emulator?

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

    • It's even better than that. You can emulate my P4 on your P4.
    • The ignorant laugh (Score:5, Insightful)

      by fm6 ( 162816 ) on Saturday February 19, 2005 @02:06PM (#11723625) Homepage Journal
      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 [wikipedia.org] 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 [wikipedia.org], 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 [sourceforge.net], which emulates not only a 286-class processor, but other legacy hardware such as sound cards and Hercules Graphics [wikipedia.org].
      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.
  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Saturday February 19, 2005 @12:43PM (#11723134)
    Comment removed based on user account deletion
  • by Husgaard ( 858362 ) on Saturday February 19, 2005 @12:44PM (#11723143)
    I am really looking forward to emulating an Opteron at near native speed on my good old 386sx processor...
  • Money? (Score:4, Insightful)

    by cronius ( 813431 ) on Saturday February 19, 2005 @12:44PM (#11723145)
    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.
    • If it actually achieves near-native performance right now, how much better can it get?
      It is at 1:4 to 1:5 speeds without the accelerator. With the accelerator the ratio is claimed to be between 1:1 and 1:2.
      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.
      Depends. If he sells the accelerator to a company and releases the source a few month later under the GPL it might be interesting. A bit like the wine/winex stuff started. If the comp
      • I think what he's saying is `I want to work on this full time, but I can't afford to. If someone wants to pay me to, then that would be good. Oh, and I want to keep it open source'. I would not be surprised if IBM decided to offer him a job (or a stipend), since a good quality x86 emulator for PowerPC would be of huge benefit to them if they are intending to push PowerPC into the mainstream, since it would enable people to run legacy apps at a reasonable speed.
    • And since it's already gratis, would anyone want to pay for one that achives actual native performance?

      The same reason anyone pays for open-source stuff. Support and ongoing development for specialized needs.
  • Only Reasonable (Score:2, Insightful)

    by kiljoy001 ( 809756 )
    It's only reasonable, considering the time and effort that this guy put into the program... wasn't ibm pushing out money to linux ? Stuff like this should be funded.
  • Oh yeah! (Score:5, Interesting)

    by Saint Aardvark ( 159009 ) * on Saturday February 19, 2005 @12:46PM (#11723163) Homepage Journal
    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 [bellard.free.fr] 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?

    • Ive found that once it does finally get installed, its not bad at all.

      But yes, *installation* is a pain.. I gave up on my first attempt to install W2K, thought it had died...

    • Re:Oh yeah! (Score:4, Informative)

      by stevey ( 64018 ) on Saturday February 19, 2005 @01:52PM (#11723526) Homepage

      I installed Win2k on a Debian installation without the accelerator - and wrote about it here Running Microsoft Windows inside Debian : Qemu [debian-adm...ration.org].

      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.

    • Re:Oh yeah! (Score:3, Interesting)

      by Spy Hunter ( 317220 )
      It has always been Fabrice's intention to have the accelerator GPL'd; he uses the word "when" to describe the event rather than "if". He is just looking for a sponsorship first; hopefully some company will soon provide him with one (Lindows^H^H^H^Hspire perhaps?) If nobody does sponsor him within a year or so, I imagine that somebody else will write a different accelerator unless he releases his own; there is quite a bit of demand.
  • qemu DOES work (Score:5, Informative)

    by supersuckers ( 841107 ) on Saturday February 19, 2005 @12:49PM (#11723184) Homepage
    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 [gentoo.org]
    • nice one Cyril... excellent link... now my old ms-windows 98SE license is no longer fit for just using as a beermat... and it means the company I work for will have fewer excuses for not changing over to Linux... the power users will still be able to run their windows only apps

      Mind you, the thing I've now got to attempt is to get w2k pro and OSX running simultaneously on a Linux box...
    • Having a free, open-source virtual machine means you can easily copy songs from napster or any other source regardless of DRM. It should be trivial to patch the sound blaster emulation to start dumping to disk when the sound starts and stop once the device is closed or the sound pauses for 1 sec or so. This would make it trivial to copy napster songs regardless of what they do to lock down Windows itself, and it requires almost no work on the part of the user (they just play the song in a qemu-xp and it's
  • Dual licence ? (Score:5, Insightful)

    by Alain Williams ( 2972 ) <addw@phcomp.co.uk> on Saturday February 19, 2005 @12:51PM (#11723199) Homepage
    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.
  • Qemu - information (Score:5, Informative)

    by Richard_J_N ( 631241 ) on Saturday February 19, 2005 @12:58PM (#11723233)
    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)

  • Theoretically (Score:3, Insightful)

    by no_choice ( 558243 ) on Saturday February 19, 2005 @12:59PM (#11723239)

    This means you could theoretically run Windows on a Linux machine at near native speeds

    Theoretically, does it work or not?

  • iPC? (Score:5, Interesting)

    by Doc Ruby ( 173196 ) on Saturday February 19, 2005 @01:02PM (#11723255) Homepage Journal
    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.
  • by Just Some Guy ( 3352 ) <kirk+slashdot@strauser.com> on Saturday February 19, 2005 @01:14PM (#11723306) Homepage Journal
    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."

  • I understand that qemu is also an entire system emulator, but this post calls it a processor emulator. Does the accelerator also help with the general system emulation? Why would you need a processor emulator accelerator that only runs on x86 to emulate an x86 to run Windows? You're already ON an x86... Or is that all this accelerator really is? Some kind of native passthrough? Assuming I had the source and could compile it myself, would it benefit me in emulating a x86 on my PPC?
  • Near native to what ? To the clock rate of which processor? the physical one or the virtual one? I mean - Im sure you can emulate a Z80 at "Near Native" speeds without batting an eyelid but what if the Z80 in question was running at 20ghz ?
    For example - having used VMWare in the past I have found that the performance of the virtual machine to be roughly half the speed of the host machine (performance might be better these days). Say my machine had a 2ghz cpu - I could say that I was getting "Near Native"
    • It's fast enough that booting Knoppix off the CD-ROM with the QEmu acceleator module loaded, much of the boot process is IO-bound rather than CPU-bound.

      You can play Frozen-Bubble in QEmu and still have idle CPU on the host... It's fast enough! :-)

      Now this also means that all of a sudden, the cost of migrating large organisations to GNU/Linux, while running that last application in a Windows install in an emulator got a _lot_ cheaper. No more VMWare needed. München, are you listening?

  • by harlemjoe ( 304815 ) on Saturday February 19, 2005 @01:29PM (#11723381)
    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/ [opendarwin.org] click on windows apps and run them seamlessly in OS X

    fabrice bellard is a processor emulating god imho
    • He's also been behind the ffmpeg [sf.net] project for a long time. Most Linux users probably use a fair bit of his code when watching videos.
    • by Spy Hunter ( 317220 ) on Saturday February 19, 2005 @03:25PM (#11724067) Journal
      He is not merely a processor emulating god; he is a coding god in general. Look at his project page [bellard.free.fr]. 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 [ioccc.org] 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.

  • is it legal (Score:2, Interesting)

    by yupa ( 751893 )
    If you read http://people.redhat.com/arjanv/COPYING.modules [redhat.com], you will see that if you write a binary module from scratch it is considered as a derived work from linux kernel, so it should respect the GPL license and be open source.

    I am a bit disapointed to see a guy like fabrice bellard which have contributed to lot's of famous open source projects (ffmpeg for exemple) to choose a such decission.
    • How can be something you wrote from scratch be a derived work of something else? This kind of like SCO wanting control of the code written by IBM. Even if that's allowed by law, it's morally wrong to demand compliance. Yes, I know Linus is the author of this document, but I think he is doing his own "GNU/Linux" thing here and should change his mind.
  • This is Fabrice Bellard of ffmpeg fame. Now I know why he hasn't touched that ffmpeg in a while :)
  • Derived work? (Score:3, Interesting)

    by David McBride ( 183571 ) <david+slashdot AT dwm DOT me DOT uk> on Saturday February 19, 2005 @01:55PM (#11723542) Homepage
    From the description, I'd be concerned that releasing the Accelerator code under a non-free (as in speech) license would be incompatible with the linux kernel's GPL license as it could be argued that it is a derived work.

    See also http://kerneltrap.org/node/1735 [kerneltrap.org].

    In practice, it may be enough of a gray area that it won't be a problem -- although it may scare off any company wishing to invest in it.

    Personally, I'm just getting sick and tired with the maintainability and reliability issues that binary modules usually incur..
  • by sanermind ( 512885 ) on Saturday February 19, 2005 @02:06PM (#11723622)
    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.
  • by zapp ( 201236 ) on Saturday February 19, 2005 @02:10PM (#11723644)
    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 )
  • by Jah-Wren Ryel ( 80510 ) on Saturday February 19, 2005 @02:12PM (#11723655)
    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?
    • You betcha! I'm sure that the hammer will come down as soon as "the powers that be" realize that no matter what DRM or other nasty stuff they come up with - it'll run in emulated machines.

      For example, you could run QEmu and some sort of nasty DRM audio app like Napster. While it's running in the VM, drop back to windows and cat /dev/dsp into a file.

    • If you can get the drivers that allows you to do that signed, sure. Don't hold your breath.

      To avoid confusion: sure you could get that open source driver signed (for a hefty fee of course), but that driver wouldn't allow you to do any of the things you're thinking about. Changing the source to the driver after the signing won't help either, of course, as it then doesn't pass the signature test and thus isn't accepted into the so called trusted part the system.

    • by Anonym0us Cow Herd ( 231084 ) on Saturday February 19, 2005 @03:43PM (#11724202)
      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.
  • from the headline I got really excited but then I read that it only speeds things up on Linux. Well this is great for people running Windows on Linux it does nothing for those running Linux on Windows. I use a TabletPC that won't even accept regular Windows XP install discs... just the Acer supplied ones. I've tried running DSL Linux under QEMU but the performance isn't there at all (laptop is a 800Mhz, consider what XP uses and then divide the remainder by 5-10 and you get the idea).

    Hopefully there is en

  • by jbwiv ( 266761 ) on Saturday February 19, 2005 @03:10PM (#11723989)
    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!
  • by idlake ( 850372 ) on Saturday February 19, 2005 @03:12PM (#11723998)
    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.
  • The catch is that although QEMU is released under various open source licenses, the Accelerator uses a free (as in beer) license

    "Free as in beer" is good enough for all but the most demanding zealot.

  • Pile of torrents at torrents [btconnect.com] for linux-under-windows isos. Look like SuSE for Windows [btconnect.com] . 2.4 kernels perform better than 2.6 ones, but all work !

"The great question... which I have not been able to answer... is, `What does woman want?'" -- Sigmund Freud

Working...