Skip to content

target-arm: KVM to TCG migration

Alvise Rigo qemu-devel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 0 repliesNew
  2. v1 RFC4 patches 18 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7target-arm: Decouple AArch64 cp registerstarget-arm/helper.c+13 -20 replies
2/7target-arm: Migrate CCSIDR registerstarget-arm/cpu.c+64 -00 replies
3/7target-arm: Add a way to mask sometarget-arm/cpu.h target-arm/helper.c+48 -20 replies
4/7target-arm: Exclude IC bit from L2CTLRtarget-arm/cpu.c+3 -50 replies
5/7target-arm: Make TTBR0/1 and TTBRC cptarget-arm/helper.c+27 -110 replies
6/7target-arm: Added ADFSR/AIFSR and REVIDRtarget-arm/cpu.h target-arm/helper.c+10 -00 replies
7/7target-arm: Minor cp registers changestarget-arm/helper.c+14 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/7] target-arm: KVM to TCG migration

QEMU at the moment doesn't allow the migration between KVM and TCG, in both directions. This limitation is due first of all to the different set of coprocessor registers supported by KVM and TCG, but also in the way the coprocessors values are copied from the incoming data to the local QEMU structures.
This set of patches is focused on the KVM to TCG migration using the CortexA15 processor (in both sides) and proposes a way to mitigate all the blocking discrepancies between the two processors.

The major changes carried by this patch set could be summed as following:
- Excluded any AArch64 register definition from a AArch32 only execution since KVM has none of those registers defined when running on an ARMv7 processor.
- KVM migrates the values of the supported CSSIDR registers as coprocessors cp17 registers. We can do the same in TCG adopting the same encoding used in KVM.
- Some registers are partially supported in TCG mostly because some of their bits reflect tightly the underlying real hardware.
In some cases TCG simply ignores those bits considering only the modelled ones, in some other these bits have the default value.
In both cases however, the values carried by these registers could differ from those migrated by KVM: this is why it is necessary a mechanism to ignore part of a register when we are copying its value from the incoming data. For this purpose a new field is introduced (attr_mask) inside ARMCPRegInfo to explicitly specify, where necessary, which bits are to be considered when comparing the incoming values with the current ones.
- Some definitions of coprocessors registers have been slightly modified to guarantee backward compatibility with the AArch32 definitions. TTBCR, for instance, is one of these registers.

This set of patches has been tested by booting a guest running the Linux 3.13 and 3.14 kernel in a host using KVM.
Two types of hosts have been used: ARM FastModels and the ARM Chromebook. Then, in the middle of the kernel boot, the guest was migrated to a x86 host running TCG.
The machine model used is vexpress-a15 with cortex-a15 as CPU.

Alvise Rigo (7):
Decouple AArch64 cp registers from AArch32
Migrate CCSIDR registers values as cp17 registers
Add a way to mask some unimplemented bits of cp registers Exclude IC bit from L2CTLR register and add attributes mask Make TTBR0/1 and TTBRC cp registers backward compatible with AArch32
ids
Added ADFSR/AIFSR and REVIDR cp registers
Minor cp registers changes for KVM -> TCG migration

 target-arm/cpu.c    |  72 +++++++++++++++++++++++++++--
 target-arm/cpu.h    |   2 +
 target-arm/helper.c | 129 ++++++++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 179 insertions(+), 24 deletions(-)
Signature · 1 line
1.8.3.2