Skip to contentSkip to conversation

ARM: KVM: split cp15 mrc/mcr and mrrc/mcrr handling.

PATCH In review Rusty Russell 1 participant 1 message Mar 9, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 4/8 ARM: KVM: split cp15 mrc/mcr and mrrc/mcrr handling.

From: Rusty Russell <[email protected]>

The hardware has separate traps for the two cases, so don't prematurely unify them.

---
 arch/arm/include/asm/kvm_emulate.h |    3 +
 arch/arm/kvm/arm.c                 |    4 +
 arch/arm/kvm/emulate.c             |  102 ++++++++++++++++++++----------------
 3 files changed, 62 insertions(+), 47 deletions(-)
arch/arm/include/asm/kvm_emulate.h +2 -1
index 029f45f..fa54247 100644
@@ -44,7 +44,8 @@ int kvm_handle_cp10_id(struct kvm_vcpu *vcpu, struct kvm_run *run);
 int kvm_handle_cp_0_13_access(struct kvm_vcpu *vcpu, struct kvm_run *run);
 int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run);
 int kvm_handle_cp14_access(struct kvm_vcpu *vcpu, struct kvm_run *run);
-int kvm_handle_cp15_access(struct kvm_vcpu *vcpu, struct kvm_run *run);
+int kvm_handle_cp15_32(struct kvm_vcpu *vcpu, struct kvm_run *run);
+int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run);
 int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run);
 int kvm_emulate_mmio_ls(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 			unsigned long instr);
arch/arm/kvm/arm.c +2 -2
index f27a96b..a6cf02b 100644
@@ -377,8 +377,8 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
 static int (*arm_exit_handlers[])(struct kvm_vcpu *vcpu, struct kvm_run *r) = {
 	[HSR_EC_WFI]		= kvm_handle_wfi,
-	[HSR_EC_CP15_32]	= kvm_handle_cp15_access,
-	[HSR_EC_CP15_64]	= kvm_handle_cp15_access,
+	[HSR_EC_CP15_32]	= kvm_handle_cp15_32,
+	[HSR_EC_CP15_64]	= kvm_handle_cp15_64,
 	[HSR_EC_CP14_MR]	= kvm_handle_cp14_access,
 	[HSR_EC_CP14_LS]	= kvm_handle_cp14_load_store,
 	[HSR_EC_CP14_64]	= kvm_handle_cp14_access,
arch/arm/kvm/emulate.c +58 -44

130 lines not on this page · raw message