RE: CPU seen by guest in VM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Mian M. Hamayun [mailto:m.hamayun@xxxxxxxxxxxxxxxxxxxxxx]
> Sent: Thursday, July 25, 2013 5:08 AM
> To: Peter Maydell
> Cc: Yoder Stuart-B08248; kvmarm@xxxxxxxxxxxxxxxxxxxxx
> Subject: Re: CPU seen by guest in VM
> 
> On 07/24/2013 10:21 PM, Peter Maydell wrote:
> > For ARMv8, the basic set of ioctls is the same so in some sense
> > the approach is the same as above. However, there's a complication:
> >   * there are actually multiple host CPUs out in the field that
> >     people want to support, so an initial "only A57-on-A57"
> >     or similar isn't going to cut it
> >   * QEMU doesn't yet know about any of these CPUs, and there
> >     isn't currently public documentation for things like
> >     ID and feature register values
> >   * most v8 CPUs are probably going to be GICv3, but KVM
> >     at the moment is going to expose a GICv2 to the guest.
> >     This is the kind of "doesn't exist in real life" setup
> >     that makes me a little nervous.
> >
> > If we always expose the host CPU to the guest then this
> > has a couple of issues:
> >   * we need UI for it in the target-arm bits of QEMU
> >   * we need a way to ask the kernel for "whatever you
> >     like" rather than a specific CPU
> One possible solution to this issue can be the introduction of a
> new ioctl in KVM to report the host CPU type to the user space.
> 
> Although this would change the KVM API version and raise
> backward compatibility issues. Moreover it seems like an overkill.
> 
> Whats your take on this ?

If KVM is going to support emulating different types of virtual
CPUs, there does need to be some kind of mechanism for KVM
to advertise capabilities of what can be emulated and for QEMU
to request a particular CPU.

Not sure if an ioctl is needed for KVM to advertise the 'host'
CPU or not.  On Power arch it's pretty easy for user space to
determine the host CPU type as the registers are not privileged
and you can see it in /proc/cpuinfo.

One other thing we had to deal with on Power arch KVM for
embedded-- it wasn't realistic (or possible in some cases)
for us to emulate the host CPU 100%, and so we did a couple
of things:  1) created an e500 vcpu 'spec' that documented
every deviation from actual physical CPUs, and 2) defined
device tree mechanisms to advertise processor features
that could otherwise not be discovered.

see:
http://www.linux-kvm.org/page/E500_virtual_CPU_specification

So, for example in the Power architecture there are 
categories like 'performance monitor', abbreviated 'PM'.
If a vcpu includes support for the performance monitor
then a property called 'power-isa-pm' is included
on the CPU node in the device tree.   If that property is not
present, an OS should not assume performance monitoring is
available.

You should not assume that Linux is the OS that will run
in an ARM virtual machine.

Regards,
Stuart





_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm




[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux