Showing posts with label arm. Show all posts
Showing posts with label arm. Show all posts

07 October 2009

ARM virtualization issue

I will be the first to admit I don't know a lot about the ARM instruction set. However, I do know that instructions which behave differently at different privilege levels (and don't cause an interrupt) are a huge problem for virtualization.

The well-known "Formal Requirements for Virtualizable Third Generation Architectures" paper identified 17 problematic instructions on x86, the best example being POPF. The Intel Architecture Developer's Manual makes this understated observation:
The effect of the POPF/POPFD instructions on the EFLAGS register changes slightly, depending on the mode of operation of the processor.
In other words, you won't get a trap when trying to modify supervisor state with the POPF instruction in user mode.

In the PowerPC KVM implementation, we relied on the fact that a privileged instruction would trap. This enabled us to execute the vast majority of guest kernel instructions natively in user mode, since we would get a trap and could emulate any supervisor-only instructions. Ultimately, even without hardware support, we didn't need a complicated dynamic instruction translation engine (see VMware). Hardware support became a question of acceleration, rather than a requirement.

A colleague recently mentioned that ARM has a similar problem with the CPS instruction. Sure enough, from the ARM Architecture Reference Manual:
Exceptions: None.

Notes
User mode: CPS has no effect in User mode.
That's disappointing, because I had assumed that ARM, following similar RISCish principles to PowerPC, would have ended up with the same behavior. It took Intel years to add the necessary architecture changes for virtualization (VMX), and there is still no solution other than VMware's for the non-VMX processors.

From what I can tell, ARM TrustZone doesn't solve this problem... can anybody confirm?

29 May 2009

VMs on netbooks

OK, this post is about virtual machines in the JVM sense, not in the hypervisor sense. (The lines are getting a little blurry these days though.)

Back in the day, I once installed Windows NT on an RS/6000 (PowerPC) just to play with it. (It's funny how obsolete/impractical technology seemed so interesting back then, and these days it boggles my mind how anybody could care about Haiku, Amiga, etc.) So Windows NT: it installed OK, I started it up, and ran IE 2.0. That sucked (even at the time), but there were no updates for it. I ran the bundled Pinball game. That was the end of the story, because there was no ISV support. Just porting the kernel wasn't enough: an x86 WinNT application still couldn't run on PowerPC WinNT. The same fate could befall ARM netbooks (ahem "smartbooks").

This post suggests that .NET could be the answer. It starts by assuming that ARM netbooks will be common (a question on which the jury is still out), and then assumes Microsoft will somehow want to participate in that ecosystem (probably a safe bet: look at Windows ME on phones). Port some Windows kernel to ARM netbooks, provide a .NET runtime, and then just run .NET applications -- never worry about needing native ARM Windows binaries.

That has an existing parallel of course: J2ME on mobile phones. As a consumer, I'd call that a success. I love that I can download a random Java application and not worry about if the creator has built it for N phone vendors x M models. I'm sure J2ME has its limits, but it has made my life better.

And of course Google is walking down the same path with Dalvik. The cool thing about Java/Dalvik/.NET that it might just allow another processor architecture to compete with Intel without the legacy software issue. It will be interesting to see if Intel eventually enables Java on Moblin.

With Intel investing so many resources not just into the Linux kernel, but now into a full mobile Linux distribution (complete with UI), maybe Microsoft will annoy them right back by enabling ARM netbooks. You know both of them have to be looking to embedded systems for growth.

Anyways, I'd only buy a netbook that runs Linux. ;) I've heard good things about the ARM instruction set...

27 February 2009

embedded VMware on the Nokia n800

Last year VMware acquired a French company called Trango, who had a tiny hypervisor written for ARM and MIPS. It's completely paravirtualization, i.e. modifications to the guest kernels that run on top of it (including Linux, though no patches are publicly available that I've found). (Mind you, it's only a thin hypervisor, but that probably makes sense for these low-end processors.)

So that's where this WinCE+Android demo comes from. It's cool, but is it just a demo? Who actually wants virtualization in consumer electronics? Well, another embedded virtualization vendor, OK Labs, claims they're installed in 250 million cell phones.

The funny thing is that I expect virtualization to be adopted more quickly in networking (Cisco, Juniper, et al) than consumer electronics. Of course, you probably won't see flashy demos from there, just more robustness, more features, and maybe even a better profit margin from the vendors (because they don't have to rewrite as much software).

Anyways, if there is still doubt about virtualization in embedded systems, I think demos like this should help evaporate it.

Update: Reacting to the same story, Ars Technica opines that embedded virtualization is "inevitable."