qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, Juan Quintela <quintela@redhat.com>,
	patches@linaro.org, Andre Przywara <andre.przywara@linaro.org>,
	kvmarm@lists.cs.columbia.edu,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: [Qemu-devel] [PATCH v2 0/7] target-arm: cpregs list for migration, kvm reset
Date: Mon,  3 Jun 2013 14:47:10 +0100	[thread overview]
Message-ID: <1370267237-25772-1-git-send-email-peter.maydell@linaro.org> (raw)

This patch series overhauls how we handle ARM coprocessor registers,
so that we use a consistent approach for migration, reset and
QEMU<->KVM synchronisation, driven by the kernel's list of supported
registers.

The basic principle here is that we trust the kernel's list of what
registers it knows about, and that QEMU doesn't have to have specific
knowledge of a coprocessor register to support running and migrating
a KVM session on a kernel that does support that register.

We maintain a list of cp registers, which is initialized either from
the current cpreg hashtable (for TCG), or by querying the kernel (for
KVM).  For migration we simply send the lists of register indexes and
values; migration fails if there's a register the destination kernel
is unaware of, or if the value can't be set as required, but isn't
gated on whether source or destination QEMU know about the register.

We also use the register list to properly reset the vcpu by simply
feeding it back the initial set of register values; this fixes a bug
where we weren't resetting everything we should have (though Linux
guests don't care about most reset values).

Note that vm save/load with KVM requires that you run with -machine
kernel_irqchip=off, because the kernel doesn't currently support
save/load of either the VGIC or virtual timer state.  It may also be
necessary to nobble the device tree blob to remove the "armv7-timer"
node so the guest doesn't try to use the vtimers.  Migration between
TCG and KVM is not supported at the moment (it would require us to
add a lot of registers to TCG, which I may do at some point, but this
is a bit of an obscure usecase IMHO).

Changes v1->v2:
 * added raw write accessors for regs which do a tlb_flush()
   in their write function (CONTEXTIDR and others)
 * added kvm-stub.h accidentally omitted in v1

(Remembered to cc kvm list this time around...)

Peter Maydell (7):
  target-arm: Allow special cpregs to have flags set
  target-arm: Add raw_readfn and raw_writefn to ARMCPRegInfo
  target-arm: mark up cpregs for no-migrate or raw access
  target-arm: Convert TCG to using (index,value) list for cp migration
  target-arm: Initialize cpreg list from KVM when using KVM
  target-arm: Reinitialize all KVM VCPU registers on reset
  target-arm: Use tuple list to sync cp regs with KVM

 target-arm/Makefile.objs |    1 +
 target-arm/cpu-qom.h     |   24 ++++
 target-arm/cpu.c         |    2 +
 target-arm/cpu.h         |   89 ++++++++++++-
 target-arm/helper.c      |  327 +++++++++++++++++++++++++++++++++++++++-------
 target-arm/kvm-stub.c    |   23 ++++
 target-arm/kvm.c         |  292 +++++++++++++++++++++++++++++++----------
 target-arm/kvm_arm.h     |   33 +++++
 target-arm/machine.c     |  134 ++++++++++++-------
 9 files changed, 759 insertions(+), 166 deletions(-)
 create mode 100644 target-arm/kvm-stub.c

-- 
1.7.9.5

             reply	other threads:[~2013-06-03 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 13:47 Peter Maydell [this message]
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 1/7] target-arm: Allow special cpregs to have flags set Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 2/7] target-arm: Add raw_readfn and raw_writefn to ARMCPRegInfo Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 3/7] target-arm: mark up cpregs for no-migrate or raw access Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 4/7] target-arm: Convert TCG to using (index, value) list for cp migration Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 5/7] target-arm: Initialize cpreg list from KVM when using KVM Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 6/7] target-arm: Reinitialize all KVM VCPU registers on reset Peter Maydell
2013-06-03 13:47 ` [Qemu-devel] [PATCH v2 7/7] target-arm: Use tuple list to sync cp regs with KVM Peter Maydell
2013-06-13 14:13 ` [Qemu-devel] [PATCH v2 0/7] target-arm: cpregs list for migration, kvm reset Peter Maydell

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=1370267237-25772-1-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=andre.przywara@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@linaro.org \
    --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 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).