On 05/03/18 14:01, Peter Maydell wrote:
> Hi; I've just noticed a bug in QEMU where we weren't migrating
> Secure-bank register state for AArch32 emulated guest correctly, which
> turns out to be intertwined with how KVM defines its index values for
> cp15 registers in the KVM_REG_ARM_* encoding.
> The problem is that QEMU defines the on-the-wire migration format
> for system registers using the KVM encoding. This is fine when we're
> using KVM (because all guest visible registers for KVM are non-secure),
> but if we're using emulation, we might have to migrate both secure and
> non-secure register state, so we need to be able to define ID values
> that distinguish them.
> I could just borrow a currently-spare bit in the encoding to indicate
> S/NS, but this seems liable to future breakage if the bit gets defined
> to have some meaning for the kernel, so it would be nice if we could
> define a bit officially, something like:
> #define KVM_REG_ARM_SECURE_MASK 0x0000000010000000
> in arch/arm/include/uapi/asm/kvm.h
> Does this seem like a good idea? (We could alternatively steal a bit
> from the top of the rather-over-specified 12 bit field for copro
> number, but AFAIK bit 28 isn't used currently so is free.)
I guess that'd be fine. If we ever have KVM running in S-EL2 on a v8.4
core, we'd be able to make use of this bit. Let's hope it never happens
Would you be able to write a patch for this please?
Jazz is not dead. It just smells funny...
kvmarm mailing list