diff options
author | Gleb Natapov <gleb@redhat.com> | 2013-04-22 03:38:15 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-22 03:38:15 -0400 |
commit | d10ab869ae5f76231a729fbf575370bf76e4bcb8 (patch) | |
tree | 19f3ababc655c210a0eab2c8603f568effaf5af6 | |
parent | e606264797d11d6488bc079fb95e38fb5bf5c60a (diff) | |
parent | be28a27c993ca6f806145d02dbe493baac83a8e9 (diff) |
Merge git://github.com/agraf/linux-2.6.git kvm-ppc-next into queue
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/kvm_booke.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/kvm.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kvm/booke.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kvm/emulate.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 1 |
7 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 5a56e1c5f851..bc81842ea25a 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
@@ -458,6 +458,8 @@ static inline bool kvmppc_critical_section(struct kvm_vcpu *vcpu) | |||
458 | #define OSI_SC_MAGIC_R4 0x77810F9B | 458 | #define OSI_SC_MAGIC_R4 0x77810F9B |
459 | 459 | ||
460 | #define INS_DCBZ 0x7c0007ec | 460 | #define INS_DCBZ 0x7c0007ec |
461 | /* TO = 31 for unconditional trap */ | ||
462 | #define INS_TW 0x7fe00008 | ||
461 | 463 | ||
462 | /* LPIDs we support with this build -- runtime limit may be lower */ | 464 | /* LPIDs we support with this build -- runtime limit may be lower */ |
463 | #define KVMPPC_NR_LPIDS (LPID_RSVD + 1) | 465 | #define KVMPPC_NR_LPIDS (LPID_RSVD + 1) |
diff --git a/arch/powerpc/include/asm/kvm_booke.h b/arch/powerpc/include/asm/kvm_booke.h index b7cd3356a532..d3c1eb34c986 100644 --- a/arch/powerpc/include/asm/kvm_booke.h +++ b/arch/powerpc/include/asm/kvm_booke.h | |||
@@ -26,6 +26,8 @@ | |||
26 | /* LPIDs we support with this build -- runtime limit may be lower */ | 26 | /* LPIDs we support with this build -- runtime limit may be lower */ |
27 | #define KVMPPC_NR_LPIDS 64 | 27 | #define KVMPPC_NR_LPIDS 64 |
28 | 28 | ||
29 | #define KVMPPC_INST_EHPRIV 0x7c00021c | ||
30 | |||
29 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) | 31 | static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) |
30 | { | 32 | { |
31 | vcpu->arch.gpr[num] = val; | 33 | vcpu->arch.gpr[num] = val; |
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index ef072b1a6e3f..c2ff99c01562 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h | |||
@@ -422,4 +422,8 @@ struct kvm_get_htab_header { | |||
422 | #define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88) | 422 | #define KVM_REG_PPC_CLEAR_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x88) |
423 | #define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89) | 423 | #define KVM_REG_PPC_TCR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x89) |
424 | #define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a) | 424 | #define KVM_REG_PPC_TSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8a) |
425 | |||
426 | /* Debugging: Special instruction for software breakpoint */ | ||
427 | #define KVM_REG_PPC_DEBUG_INST (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0x8b) | ||
428 | |||
425 | #endif /* __LINUX_KVM_POWERPC_H */ | 429 | #endif /* __LINUX_KVM_POWERPC_H */ |
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 6548445fd823..2d32ae4bc439 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -529,6 +529,12 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
529 | val = get_reg_val(reg->id, vcpu->arch.vscr.u[3]); | 529 | val = get_reg_val(reg->id, vcpu->arch.vscr.u[3]); |
530 | break; | 530 | break; |
531 | #endif /* CONFIG_ALTIVEC */ | 531 | #endif /* CONFIG_ALTIVEC */ |
532 | case KVM_REG_PPC_DEBUG_INST: { | ||
533 | u32 opcode = INS_TW; | ||
534 | r = copy_to_user((u32 __user *)(long)reg->addr, | ||
535 | &opcode, sizeof(u32)); | ||
536 | break; | ||
537 | } | ||
532 | default: | 538 | default: |
533 | r = -EINVAL; | 539 | r = -EINVAL; |
534 | break; | 540 | break; |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 58057d6f146d..a49a68a25c39 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -1447,6 +1447,12 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
1447 | case KVM_REG_PPC_TSR: | 1447 | case KVM_REG_PPC_TSR: |
1448 | r = put_user(vcpu->arch.tsr, (u32 __user *)(long)reg->addr); | 1448 | r = put_user(vcpu->arch.tsr, (u32 __user *)(long)reg->addr); |
1449 | break; | 1449 | break; |
1450 | case KVM_REG_PPC_DEBUG_INST: { | ||
1451 | u32 opcode = KVMPPC_INST_EHPRIV; | ||
1452 | r = copy_to_user((u32 __user *)(long)reg->addr, | ||
1453 | &opcode, sizeof(u32)); | ||
1454 | break; | ||
1455 | } | ||
1450 | default: | 1456 | default: |
1451 | break; | 1457 | break; |
1452 | } | 1458 | } |
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c index 7a73b6f72a8b..631a2650e4e4 100644 --- a/arch/powerpc/kvm/emulate.c +++ b/arch/powerpc/kvm/emulate.c | |||
@@ -38,6 +38,7 @@ | |||
38 | 38 | ||
39 | #define OP_31_XOP_TRAP 4 | 39 | #define OP_31_XOP_TRAP 4 |
40 | #define OP_31_XOP_LWZX 23 | 40 | #define OP_31_XOP_LWZX 23 |
41 | #define OP_31_XOP_DCBST 54 | ||
41 | #define OP_31_XOP_TRAP_64 68 | 42 | #define OP_31_XOP_TRAP_64 68 |
42 | #define OP_31_XOP_DCBF 86 | 43 | #define OP_31_XOP_DCBF 86 |
43 | #define OP_31_XOP_LBZX 87 | 44 | #define OP_31_XOP_LBZX 87 |
@@ -370,6 +371,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) | |||
370 | emulated = kvmppc_emulate_mtspr(vcpu, sprn, rs); | 371 | emulated = kvmppc_emulate_mtspr(vcpu, sprn, rs); |
371 | break; | 372 | break; |
372 | 373 | ||
374 | case OP_31_XOP_DCBST: | ||
373 | case OP_31_XOP_DCBF: | 375 | case OP_31_XOP_DCBF: |
374 | case OP_31_XOP_DCBI: | 376 | case OP_31_XOP_DCBI: |
375 | /* Do nothing. The guest is performing dcbi because | 377 | /* Do nothing. The guest is performing dcbi because |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 16b45954511c..a822659db50a 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -683,7 +683,6 @@ int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
683 | 683 | ||
684 | if (!kvm_io_bus_write(vcpu->kvm, KVM_MMIO_BUS, run->mmio.phys_addr, | 684 | if (!kvm_io_bus_write(vcpu->kvm, KVM_MMIO_BUS, run->mmio.phys_addr, |
685 | bytes, &run->mmio.data)) { | 685 | bytes, &run->mmio.data)) { |
686 | kvmppc_complete_mmio_load(vcpu, run); | ||
687 | vcpu->mmio_needed = 0; | 686 | vcpu->mmio_needed = 0; |
688 | return EMULATE_DONE; | 687 | return EMULATE_DONE; |
689 | } | 688 | } |