All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: quintela@redhat.com
Cc: KVM devel mailing list <kvm@vger.kernel.org>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	kvmarm@lists.cs.columbia.edu
Subject: -cpu host (was Re: [Qemu-devel] KVM call minutes for 2013-08-06)
Date: Thu, 8 Aug 2013 13:51:58 +0100	[thread overview]
Message-ID: <CAFEAcA-GM-M7EidPw8k0efUYZKoYumRecATiFC9hwOA_SG9zrA@mail.gmail.com> (raw)

[I missed this KVM call but the stuff about -cpu host ties into
an issue we've been grappling with for ARM KVM, so it seems
a reasonable jumping-off-point.]

On 6 August 2013 16:15, Juan Quintela <quintela@redhat.com> wrote:
> 2013-08-06
> ----------
>
> What libvirt needs/miss Today?
> - how to handle machine types? creating them inside qemu?
> - qemu --cpu help
>   only shows cpus,  not what features qemu will use
> - qemu -cpu host
>   what does this exactly means?  kvm removes same flags.
> - Important to know if migration would work.
> - Machine types sometimes disable some feature, so cpu alone is not
>   enough.

> - kernel removes some features because it knows it can't be virtualised
> - qemu adds some others because it knows it don't need host support
> - and then lots of features in the middle

So, coming at this from an ARM perspective:
Should any target arch that supports KVM also support "-cpu host"?
If so, what should it do? Is there a description somewhere of
what the x86 and PPC semantics of -cpu host are?

For ARM you can't get at feature info of the host from userspace
(unless you want to get into parsing /proc/cpuinfo), so my current
idea is to have KVM_ARM_VCPU_INIT support a target-cpu-type
which means "whatever host CPU is". Then when we've created the
vcpu we can populate QEMU's idea of what the CPU features are
by using the existing ioctls for reading the cp15 registers of
the vcpu.

The other unresolved thing is what "-cpu host" ought to mean
for the CPU's on-chip peripherals (of which the major one is
the interrupt controller) -- if the host is an A57 should
this imply that you always get the A57's GICv3, or is it OK
to provide an A57 with a GICv2? At the moment QEMU models the
per-cpu peripherals in a somewhat more semi-detached fashion
than is the case in silicon, treating them as more a part
of the board model than of the cpu itself. Having '-cpu host'
not affect them might be the pragmatic choice, since it fits
with what QEMU currently does and with kernel-side situations
where the host CPU may only be able to show the guest VM a
GICv2 view of the world (or only a GICv3, as the case may be).
For this to work it does require that guests figure out what
their per-cpu peripherals are by looking at the device tree
rather than saying "oh, this is an A57, I know all A57s
have this", of course...

-- PMM

WARNING: multiple messages have this Message-ID (diff)
From: Peter Maydell <peter.maydell@linaro.org>
To: quintela@redhat.com
Cc: qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	KVM devel mailing list <kvm@vger.kernel.org>,
	kvmarm@lists.cs.columbia.edu
Subject: [Qemu-devel] -cpu host (was Re:  KVM call minutes for 2013-08-06)
Date: Thu, 8 Aug 2013 13:51:58 +0100	[thread overview]
Message-ID: <CAFEAcA-GM-M7EidPw8k0efUYZKoYumRecATiFC9hwOA_SG9zrA@mail.gmail.com> (raw)

[I missed this KVM call but the stuff about -cpu host ties into
an issue we've been grappling with for ARM KVM, so it seems
a reasonable jumping-off-point.]

On 6 August 2013 16:15, Juan Quintela <quintela@redhat.com> wrote:
> 2013-08-06
> ----------
>
> What libvirt needs/miss Today?
> - how to handle machine types? creating them inside qemu?
> - qemu --cpu help
>   only shows cpus,  not what features qemu will use
> - qemu -cpu host
>   what does this exactly means?  kvm removes same flags.
> - Important to know if migration would work.
> - Machine types sometimes disable some feature, so cpu alone is not
>   enough.

> - kernel removes some features because it knows it can't be virtualised
> - qemu adds some others because it knows it don't need host support
> - and then lots of features in the middle

So, coming at this from an ARM perspective:
Should any target arch that supports KVM also support "-cpu host"?
If so, what should it do? Is there a description somewhere of
what the x86 and PPC semantics of -cpu host are?

For ARM you can't get at feature info of the host from userspace
(unless you want to get into parsing /proc/cpuinfo), so my current
idea is to have KVM_ARM_VCPU_INIT support a target-cpu-type
which means "whatever host CPU is". Then when we've created the
vcpu we can populate QEMU's idea of what the CPU features are
by using the existing ioctls for reading the cp15 registers of
the vcpu.

The other unresolved thing is what "-cpu host" ought to mean
for the CPU's on-chip peripherals (of which the major one is
the interrupt controller) -- if the host is an A57 should
this imply that you always get the A57's GICv3, or is it OK
to provide an A57 with a GICv2? At the moment QEMU models the
per-cpu peripherals in a somewhat more semi-detached fashion
than is the case in silicon, treating them as more a part
of the board model than of the cpu itself. Having '-cpu host'
not affect them might be the pragmatic choice, since it fits
with what QEMU currently does and with kernel-side situations
where the host CPU may only be able to show the guest VM a
GICv2 view of the world (or only a GICv3, as the case may be).
For this to work it does require that guests figure out what
their per-cpu peripherals are by looking at the device tree
rather than saying "oh, this is an A57, I know all A57s
have this", of course...

-- PMM

             reply	other threads:[~2013-08-08 12:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 12:51 Peter Maydell [this message]
2013-08-08 12:51 ` [Qemu-devel] -cpu host (was Re: KVM call minutes for 2013-08-06) Peter Maydell
2013-08-08 15:55 ` Andreas Färber
2013-08-08 15:55   ` Andreas Färber
2013-08-08 18:20   ` Peter Maydell
2013-08-08 18:20     ` Peter Maydell
2013-08-08 18:39     ` Christoffer Dall
2013-08-08 18:39       ` Christoffer Dall
2013-08-08 19:05       ` Peter Maydell
2013-08-08 19:05         ` Peter Maydell
2013-08-08 19:29         ` Christoffer Dall
2013-08-08 19:29           ` Christoffer Dall
2013-08-08 20:48           ` Peter Maydell
2013-08-08 20:48             ` Peter Maydell
2013-08-08 20:57             ` Christoffer Dall
2013-08-08 20:57               ` Christoffer Dall
2013-08-08 21:16               ` Peter Maydell
2013-08-08 21:16                 ` Peter Maydell
2013-08-09 17:53           ` Eduardo Habkost
2013-08-09 17:53             ` Eduardo Habkost
2013-08-25 13:49             ` Gleb Natapov
2013-08-25 13:49               ` Gleb Natapov
2013-08-25 13:55     ` Gleb Natapov
2013-08-25 13:55       ` [Qemu-devel] " Gleb Natapov
2013-08-25 13:14   ` Gleb Natapov
2013-08-25 13:14     ` Gleb Natapov
2013-08-09 13:12 ` Peter Maydell
2013-08-09 20:07   ` Andreas Färber
2013-08-09 20:07     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA-GM-M7EidPw8k0efUYZKoYumRecATiFC9hwOA_SG9zrA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.