KVM: PPC: Book3S HV: add support for XIVE native migration
Subsystems (2)
RFC PATCH 14/16 KVM: PPC: Book3S HV: add support for XIVE native migration
States we need to capture are :
- the IVE table defining the source targeting
- the main interrupt management registers for each vCPU
- the EQs. Also mark the EQ page dirty to make sure it is transferred.
This is work in progress. We need to make sure the HW has reached a quiescence point.
Signed-off-by Cédric Le Goater <[email protected]>
--- arch/powerpc/include/asm/kvm_ppc.h | 10 ++ arch/powerpc/include/uapi/asm/kvm.h | 11 ++ arch/powerpc/kvm/book3s.c | 46 +++++ arch/powerpc/kvm/book3s_xive_native.c | 320 ++++++++++++++++++++++++++++++++++ 4 files changed, 387 insertions(+)
arch/powerpc/include/asm/kvm_ppc.h +10 -0
@@ -269,6 +269,8 @@ union kvmppc_one_reg {u64 addr;u64 length; } vpaval; +u32 xeqval[8 ]; +u64 vpval[2 ]; };struct kvmppc_ops {
@@ -594,6 +596,10 @@ extern int kvmppc_xive_native_cleanup_vcpu(struct kvm_vcpu *vcpu);extern void kvmppc_xive_native_init_module (void );extern void kvmppc_xive_native_exit_module (void );extern int kvmppc_xive_hcall (struct kvm_vcpu *vcpu,u32 cmd); +extern int kvmppc_xive_get_vp (struct kvm_vcpu *vcpu,union kvmppc_one_reg *val); +extern int kvmppc_xive_set_vp (struct kvm_vcpu *vcpu,union kvmppc_one_reg *val); +extern int kvmppc_xive_get_vp_queue (struct kvm_vcpu *vcpu,int priority,union kvmppc_one_reg *val); +extern int kvmppc_xive_set_vp_queue (struct kvm_vcpu *vcpu,int priority,union kvmppc_one_reg *val);#else static inline int kvmppc_xive_set_xive(struct kvm *kvm, u32 irq, u32 server,
@@ -627,6 +633,10 @@ static inline void kvmppc_xive_native_init_module(void) { }static inline void kvmppc_xive_native_exit_module (void ) { }static inline int kvmppc_xive_hcall (struct kvm_vcpu *vcpu,u32 cmd) {return 0 ; } +static inline int kvmppc_xive_get_vp (struct kvm_vcpu *vcpu,union kvmppc_one_reg *val) {return 0 ; } +static inline int kvmppc_xive_set_vp (struct kvm_vcpu *vcpu,union kvmppc_one_reg *val) {return -ENOENT ; } +static inline int kvmppc_xive_get_vp_queue (struct kvm_vcpu *vcpu,int priority,union kvmppc_one_reg *val) {return 0 ; } +static inline int kvmppc_xive_set_vp_queue (struct kvm_vcpu *vcpu,int priority,union kvmppc_one_reg *val) {return -ENOENT ; }#endif /* CONFIG_KVM_XIVE */
arch/powerpc/include/uapi/asm/kvm.h +11 -0
@@ -480,6 +480,16 @@ struct kvm_ppc_cpu_char {#define KVM_REG_PPC_ICP_PPRI_SHIFT 16/* pending irq priority */ #define KVM_REG_PPC_ICP_PPRI_MASK 0xff +#define KVM_REG_PPC_VP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U128 | 0x8d) +#define KVM_REG_PPC_VP_EQ0 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x8e) +#define KVM_REG_PPC_VP_EQ1 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x8f) +#define KVM_REG_PPC_VP_EQ2 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x90) +#define KVM_REG_PPC_VP_EQ3 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x91) +#define KVM_REG_PPC_VP_EQ4 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x92) +#define KVM_REG_PPC_VP_EQ5 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x93) +#define KVM_REG_PPC_VP_EQ6 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x94) +#define KVM_REG_PPC_VP_EQ7 (KVM_REG_PPC | KVM_REG_SIZE_U256 | 0x95) +/* Device control API: PPC-specific devices */ #define KVM_DEV_MPIC_GRP_MISC 1#define KVM_DEV_MPIC_BASE_ADDR 0/* 64-bit */
@@ -679,6 +689,7 @@ struct kvm_ppc_cpu_char {#define KVM_DEV_XIVE_GET_ESB_FD 1#define KVM_DEV_XIVE_GET_TIMA_FD 2#define KVM_DEV_XIVE_VC_BASE 3 +#define KVM_DEV_XIVE_GRP_IVE 3/* Layout of 64-bit XIVE source attribute values */ #define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0)
arch/powerpc/kvm/book3s.c +46 -0
58 lines not on this page · raw message
arch/powerpc/kvm/book3s_xive_native.c +320 -0
350 lines not on this page · raw message
Signature · 1 line
2.13.6