On Tue, Jun 21, 2016 at 10:56:28PM +0200, Jiri Denemark wrote:
[...]
Let me sum up what libvirt is doing (or will be doing) with guest
CPUs... Libvirt supports three guest CPU configuration modes:
- host-passthrough -- this is easy, it's just asking for "-cpu host" and
no fancy commands are required.
- host-model -- for this we need to know what CPU configuration we need
to ask for to get as close to the host CPU as possible while being
able to ask for the exact same CPU on a different host (after
migration). And we need to be able to ask for this at probing time
(when libvirtd starts rather than when starting a new domain) using
"-machine none,accel=kvm:tcg", that is without actually creating any
guest CPU. This is what Eduardo's query-host-cpu QMP command is useful
for. In x86 world we could just query the guest CPU after running QEMU
with "-cpu host", but that's unusable with "-machine none",
which is
why another way of getting this info is needed.
Question: KVM supports x2apic (and enables it by default) on any
host CPU, because it is all emulated by KVM. Should "host-model"
include x2apic on all hosts, or only when the host CPU has it?
("-cpu host" does include it).
Including x2apic sounds more useful, but it doesn't match the
"get as close to the host CPU as possible" part of your
description.
--
Eduardo