Live data from Hacker News

Virtual Machine as a core Android Primitive

android-developers.googleblog.com

81–90 of 177 posts

Re: Virtual Machine as a core Android Primitive

#81

Although this is very exciting. Surely performance is not the benefit here? It won’t perform better than android app built not on top of the virtualisation tdchnology?

Android apps performs better if built natively, Google might take some steps to enhance its performance.

Re: Virtual Machine as a core Android Primitive

#82

Although this is very exciting. Surely performance is not the benefit here? It won’t perform better than android app built not on top of the virtualisation tdchnology?

Android apps are already running on top of a Virtualisation Technology", both current ART (Android Runtime) and the previous one, Delvik, runtimes are virtual machines, process level virtual machines, but they do bytecode translation/JIT nonetheless.

If AVF allows running native code, it might actually be cheaper than the current arrangement.

Re: Virtual Machine as a core Android Primitive

#83
post #79

So what is something running in this virtual machine allowed to do? Talk to the Internet? Talk to the screen? Talk only to whatever started it? How much of this is closed source?

I think the design is intended so that you mostly only get to do the last one.

Re: Virtual Machine as a core Android Primitive

#85

Earlier quoted context omitted.

I agree that being able to isolate things that have different security domains is a useful tool. That said, I am not really seeing how pKVM provides useful primitives for much other than DRM, which has historically been the primary usecase for trusted execution that isolated VMs seem to provide.

Consider that, I want to be able to use a regular android OS, but I don't completely trust it, either its purposely malicious or just accidently going to leak info. So isolation is good in this case, its much easier to audit the mechanism of isolation rather than the whole OS. The problem with DRM and "trusted computing" part is that it's under someone else's control, some central authority etc. From my reading of th…

It is control in the sense that you can run your own applets I guess, but it is not control in the sense that you can necessarily inspect what the programs are doing, because once you reflash the device I'm sure the DRM programs will refuse to run.

Re: Virtual Machine as a core Android Primitive

#86

Earlier quoted context omitted.

I agree that being able to isolate things that have different security domains is a useful tool. That said, I am not really seeing how pKVM provides useful primitives for much other than DRM, which has historically been the primary usecase for trusted execution that isolated VMs seem to provide.

I'd love for my banking app to be completely isolated from the rest of my phone OS, in case I get malware. I'm sure journalists at risk of targeting by NSO and its ilk would appreciate isolation or their messaging apps

This is an interesting usecase (basically Qubes) but it has high overhead and I don't really see the framework as being designed to support this, at least yet. You'd need to move all sorts of services into the VM to support the app (like, for example, someone needs to pass touch input and network traffic into the VM) and at this begins to look like an entire OS running in there.

Re: Virtual Machine as a core Android Primitive

#87
post #54

Earlier quoted context omitted.

I agree that being able to isolate things that have different security domains is a useful tool. That said, I am not really seeing how pKVM provides useful primitives for much other than DRM, which has historically been the primary usecase for trusted execution that isolated VMs seem to provide.

As I said in my other response, I make heavy use of trusted (confidential) VMs for machine learning in cloud environments. There are also vendors that are doing smart contract execution in trusted computing devices so you can get the benefits of trusted execution without the overhead of everyone executing the same code.

There are a handful of potential uses for confidential VMs, but not many of them really seem to make sense on phones?

Re: Virtual Machine as a core Android Primitive

#88
post #78
post #71

Earlier quoted context omitted.

No, KVM is also a type 1 hypervisor but it doesn't attempt (with the exception of pKVM and of hardware protection features like SEV, neither of which is routinely used by cloud workloads) to protect the guest from a malicious host.

Where in my comment did I refer explicitly to KVM feature set, or that it is used by cloud vendors?

KVM is pretty much the only hypervisor that cloud vendors use these days.

So it's true that "most cloud workloads run on type 1 hypervisors" (KVM is one) but not that most cloud vendors/workloads run on microkernel-like hypervisors, with the exception of Azure.

Re: Virtual Machine as a core Android Primitive

#89
post #53

Earlier quoted context omitted.

The threat model you have in your head seems to imply that you don't trust your OS to not peek into what Whisper is doing? There are very few workloads that need or can operate under that model.

So I'm most familiar with using this in cases like machine learning on private data in cloud environments where you want to make it impossible for the cloud operator to see the data you are using. I think there are usecases like this outside the mobile _phone_ that are interesting. For example on-device learning for edge devices where the device is not under your control.

See the thing here is that if the device is not under "your" control ("you" being a company or something, and the device being owned by a user) I don't think they will really appreciate you using their hardware to train your model in a way they don't get to see. Why would I want to support this on my own phone?

Re: Virtual Machine as a core Android Primitive

#90
post #71

Earlier quoted context omitted.

No, KVM is also a type 1 hypervisor but it doesn't attempt (with the exception of pKVM and of hardware protection features like SEV, neither of which is routinely used by cloud workloads) to protect the guest from a malicious host.

KVM is a type 2 hypervisor as the "Dom 0" kernel has full HW access. Other guests are obviously isolated as configured and are like special processes to userspace. It gets a bit blurry on AArch64 without and with VHE (Virtual Host Extensions) as without VHE ( https://lwn.net/Articles/650524/ )

No, "type 2" is defined by Goldberg's thesis as "The VMM runs on an extended host [53,75], under the host operating system", where:

* VMM is treated as synonymous with hypervisor

* "Extended host" is defined as "A pseudo-machine [99], also called an extended machine [53] or a user machine [75], is a composite machine produced through a combination of hardware and software, in which the machine's apparent architecture has been changed slightly to make the machine more convenient to use. Typically these architectural changes have taken the form of removing I/O channels and devices, and adding system calls to perform I/O and and other operations"

In other words, type 1 ("bare machine hypervisor") runs in supervisor mode and type 2 runs in user mode. QEMU running in dynamic binary translation mode is a type 2 VMM.

KVM runs on a bare machine, but it delegates some services to a less privileged component such as QEMU or crosvm or Firecracker. This is not a type 2 hypervisor, it is a type 1 hypervisor that follows security principles such as privilege separation.

Post reply on HN