KVM: PPC: 440: Implement mtdcrx
Subsystems (3)
PATCH 1/2 KVM: PPC: 440: Implement mtdcrx
Signed-off-by Alexander Graf <[email protected]>
--- arch/powerpc/kvm/44x_emulate.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/powerpc/kvm/44x_emulate.c +3 -0
@@ -28,6 +28,7 @@#include "44x_tlb.h" #define XOP_MFDCR 323 +#define XOP_MTDCRX 387#define XOP_MTDCR 451#define XOP_TLBSX 914#define XOP_ICCCI 966
@@ -84,6 +85,8 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,break ; +case XOP_MTDCRX : + dcrn =kvmppc_get_gpr (vcpu, ra);case XOP_MTDCR :/* emulate some access in kernel */ switch (dcrn) {
Signature · 1 line
1.6.0.2
PATCH 2/2 KVM: PPC: 440: Implement mfdcrx
Signed-off-by Alexander Graf <[email protected]>
--- arch/powerpc/kvm/44x_emulate.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/powerpc/kvm/44x_emulate.c +3 -0
@@ -27,6 +27,7 @@#include "booke.h" #include "44x_tlb.h" +#define XOP_MFDCRX 259#define XOP_MFDCR 323#define XOP_MTDCRX 387#define XOP_MTDCR 451
@@ -50,6 +51,8 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,case 31 :switch (get_xop (inst)) { +case XOP_MFDCRX : + dcrn =kvmppc_get_gpr (vcpu, ra);case XOP_MFDCR :/* The guest may access CPR0 registers to determine the timebase * frequency, and it must know the real host frequency because it
Signature · 1 line
1.6.0.2
Quoted 18 lines · Alexander Graf
Signed-off-by Alexander Graf <[email protected]>--- arch/powerpc/kvm/44x_emulate.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)arch/powerpc/kvm/44x_emulate.c +1
-0@@ -28,6 +28,7 @@#include "44x_tlb.h" #define XOP_MFDCR 323 +#define XOP_MTDCRX 387#define XOP_MTDCR 451#define XOP_TLBSX 914#define XOP_ICCCI 966
arch/powerpc/kvm/44x_emulate.c int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, · line 90
Quoted 6 lines
arch/powerpc/kvm/44x_emulate.c +2
-0@@ -84,6 +85,8 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,break ; +case XOP_MTDCRX : + dcrn =kvmppc_get_gpr (vcpu, ra);case XOP_MTDCR :
It's customary to put a /* fallthrough */ comment to shut down any alarms that may be firing off in readers' minds.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 20 lines · Avi Kivity
Quoted 19 lines · Alexander Graf
Signed-off-by Alexander Graf <[email protected]>---
arch/powerpc/kvm/44x_emulate.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)arch/powerpc/kvm/44x_emulate.c +1
-0@@ -28,6 +28,7 @@#include "44x_tlb.h" #define XOP_MFDCR 323 +#define XOP_MTDCRX 387#define XOP_MTDCR 451#define XOP_TLBSX 914#define XOP_ICCCI 966@@ -84,6 +85,8 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
Quoted 8 lines
arch/powerpc/kvm/44x_emulate.c int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, · line 90
Quoted 5 lines
arch/powerpc/kvm/44x_emulate.c +2
-0break ; +case XOP_MTDCRX : + dcrn =kvmppc_get_gpr (vcpu, ra);case XOP_MTDCR :It's customary to put a /* fallthrough */ comment to shut down any alarms that may be firing off in readers' minds.
Yeah, I moved this over into function calls now. Makes the code easier to read :). And hopefully the compiler is smart enough to optimize it the same way.
Alex