diff options
-rw-r--r-- | arch/powerpc/include/uapi/asm/kvm.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kvm/e500mc.c | 22 |
2 files changed, 21 insertions, 2 deletions
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index 2bc4a9409a93..0e56d9e7b2d6 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h | |||
@@ -555,6 +555,7 @@ struct kvm_get_htab_header { | |||
555 | 555 | ||
556 | #define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8) | 556 | #define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8) |
557 | #define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9) | 557 | #define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9) |
558 | #define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba) | ||
558 | 559 | ||
559 | /* Transactional Memory checkpointed state: | 560 | /* Transactional Memory checkpointed state: |
560 | * This is all GPRs, all VSX regs and a subset of SPRs | 561 | * This is all GPRs, all VSX regs and a subset of SPRs |
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index 690499d7669d..164bad2a19bf 100644 --- a/arch/powerpc/kvm/e500mc.c +++ b/arch/powerpc/kvm/e500mc.c | |||
@@ -267,14 +267,32 @@ static int kvmppc_core_set_sregs_e500mc(struct kvm_vcpu *vcpu, | |||
267 | static int kvmppc_get_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id, | 267 | static int kvmppc_get_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id, |
268 | union kvmppc_one_reg *val) | 268 | union kvmppc_one_reg *val) |
269 | { | 269 | { |
270 | int r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val); | 270 | int r = 0; |
271 | |||
272 | switch (id) { | ||
273 | case KVM_REG_PPC_SPRG9: | ||
274 | *val = get_reg_val(id, vcpu->arch.sprg9); | ||
275 | break; | ||
276 | default: | ||
277 | r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val); | ||
278 | } | ||
279 | |||
271 | return r; | 280 | return r; |
272 | } | 281 | } |
273 | 282 | ||
274 | static int kvmppc_set_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id, | 283 | static int kvmppc_set_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id, |
275 | union kvmppc_one_reg *val) | 284 | union kvmppc_one_reg *val) |
276 | { | 285 | { |
277 | int r = kvmppc_set_one_reg_e500_tlb(vcpu, id, val); | 286 | int r = 0; |
287 | |||
288 | switch (id) { | ||
289 | case KVM_REG_PPC_SPRG9: | ||
290 | vcpu->arch.sprg9 = set_reg_val(id, *val); | ||
291 | break; | ||
292 | default: | ||
293 | r = kvmppc_set_one_reg_e500_tlb(vcpu, id, val); | ||
294 | } | ||
295 | |||
278 | return r; | 296 | return r; |
279 | } | 297 | } |
280 | 298 | ||