uint32_t cp_idx;
};
+/*
+ * QEMU uses KVM system register ids in the migration format.
+ * Conveniently, HVF uses the same encoding of the op* and cr* parameters
+ * within the low 16 bits of the ids. Thus conversion between the
+ * formats is trivial.
+ */
+
+#define KVMID_TO_HVF(KVM) ((KVM) & 0xffff)
+#define HVF_TO_KVMID(HVF) \
+ (CP_REG_ARM64 | CP_REG_SIZE_U64 | CP_REG_ARM64_SYSREG | (HVF))
+
+/* Verify this at compile-time. */
+
+#define DEF_SYSREG(HVF_ID, ...) \
+ QEMU_BUILD_BUG_ON(HVF_ID != KVMID_TO_HVF(KVMID_AA64_SYS_REG64(__VA_ARGS__)));
+
+#include "sysreg.c.inc"
+
+#undef DEF_SYSREG
+
#define DEF_SYSREG(HVF_ID, op0, op1, crn, crm, op2) \
{ HVF_ID, HVF_SYSREG(crn, crm, op0, op1, op2) },