qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Patch Tracking <patches@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Subject: Re: [Qemu-devel] [PATCH 5/5] hw: arm_gic_kvm: Add KVM VGIC save/restore logic
Date: Fri, 20 Sep 2013 22:46:07 +0100	[thread overview]
Message-ID: <20130920214607.GX7623@lvm> (raw)
In-Reply-To: <CAFEAcA-nWhaabZ2GDq1bsB14ZOjypGksct8njjnNx3Q3LQzgDQ@mail.gmail.com>

On Sat, Sep 21, 2013 at 06:22:23AM +0900, Peter Maydell wrote:
> On 21 September 2013 04:50, Christoffer Dall
> <christoffer.dall@linaro.org> wrote:
> > On Fri, Sep 06, 2013 at 04:13:32PM +0100, Peter Maydell wrote:
> >> >      /* these registers are mainly used for save/restore of KVM state */
> >> >      uint8_t  binary_point[2][NCPU]; /* [0]: group 0, [1]: group 1 */
> >> > +    uint32_t active_prio[4][NCPU]; /* implementation defined layout */
> >>
> >> You can't make this impdef in QEMU's state, that would mean
> >> we couldn't do migration between implementations which
> >> use different layouts. We need to pick a standard ("whatever
> >> the ARM v2 GIC implementation is" seems the obvious choice)
> >> and make the kernel convert if it's on an implementation which
> >> doesn't follow that version.
> 
> > Implementation defined as in implementation defined in the
> > architecture.  I didn't think it would make sense to choose a format for
> > an a15 implementation, for example, and then translate to that format
> > for other cores using the ARM gic.  Wouldn't migration only be support
> > for same qemu model to same qemu model, in which case the format of this
> > register would always be the same, and the kernel must return a format
> > corresponding to the target cpu.  Am I missing something here?
> 
> I know it's architecturally impdef, but there are a couple of issues
> here:
>  *) moving to the 'create me an irqchip' API is separating out the
> "which GIC do I have?" and "which CPU do I have?" questions
> somewhat, so it seems a shame to tangle them up again

Hmm, they are inherently coupled in hardware at least for v7 though,
right?

> 
>  *) for getting TCG<->KVM and KVM-with-non-host-CPU cases
> right we need to do translation anyway, or at least think about it.

Why? Wouldn't we always only support the case where QEMU emulates the
same model as KVM in the first case, and the kernel should behave the
same and export the same state if you ask for a specific target no
matter what the underlying hardware is, no?

> So we need to at minimum specifically document what the format
> is for the CPUs we care about. At that point we might as well have
> a standard format. IIRC the GIC spec defines a "this is the sensible
> format" anyway.
> 
> In practice, for the v7 and v8 CPUs we support, what format do
> they use?
> 

It's not particularly clear as far as I can read it, but I'll have to
investigate in more details.  Also, I'm not quite clear on how TCG GIC
reads/writes would get translated to the proper format depending on the
core in that case, and we would have to have code in the arm_gic_kvm
file to detect the emulated target and do translation.  I'm failing to
see the benefits?

-Christoffer

  reply	other threads:[~2013-09-20 21:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 20:10 [Qemu-devel] [PATCH 0/5] Support arm-gic-kvm save/restore Christoffer Dall
2013-08-23 20:10 ` [Qemu-devel] [PATCH 1/5] hw: arm_gic: Fix gic_set_irq handling Christoffer Dall
2013-09-06 13:59   ` Peter Maydell
2013-09-13  6:38     ` Christoffer Dall
2013-08-23 20:10 ` [Qemu-devel] [PATCH 2/5] hw: arm_gic: Introduce GIC_SET_PRIORITY macro Christoffer Dall
2013-08-25 15:37   ` Alexander Graf
2013-09-13  6:47     ` Christoffer Dall
2013-08-23 20:10 ` [Qemu-devel] [PATCH 3/5] hw: arm_gic: Keep track of SGI sources Christoffer Dall
2013-09-06 14:08   ` Peter Maydell
2013-09-13 19:29     ` Christoffer Dall
2013-08-23 20:10 ` [Qemu-devel] [PATCH 4/5] hw: arm_gic: Support setting/getting binary point reg Christoffer Dall
2013-08-23 21:57   ` Andreas Färber
2013-09-06 14:41   ` Peter Maydell
2013-09-14  1:52     ` Christoffer Dall
2013-09-14  9:46       ` Peter Maydell
2013-09-19 19:48         ` Christoffer Dall
2013-09-19 20:03           ` Christoffer Dall
2013-08-23 20:10 ` [Qemu-devel] [PATCH 5/5] hw: arm_gic_kvm: Add KVM VGIC save/restore logic Christoffer Dall
2013-08-25 15:47   ` Alexander Graf
2013-09-06 14:57     ` Paolo Bonzini
2013-09-20 20:41       ` Christoffer Dall
2013-09-20 21:09         ` Paolo Bonzini
2013-09-20 21:23           ` Christoffer Dall
2013-09-20 20:39     ` Christoffer Dall
2013-09-06 15:13   ` Peter Maydell
2013-09-20 19:50     ` Christoffer Dall
2013-09-20 21:22       ` Peter Maydell
2013-09-20 21:46         ` Christoffer Dall [this message]
2013-09-21  9:38           ` Peter Maydell
2013-09-23  2:14             ` Christoffer Dall
2013-09-23 12:02               ` Peter Maydell
2013-09-23 15:30                 ` Christoffer Dall
2013-08-25 15:48 ` [Qemu-devel] [PATCH 0/5] Support arm-gic-kvm save/restore Alexander Graf

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=20130920214607.GX7623@lvm \
    --to=christoffer.dall@linaro.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).