Commit 49ea0695 authored by Scott Wood's avatar Scott Wood Committed by Avi Kivity

KVM: PPC: fix exit accounting for SPRs, tlbwe, tlbsx

The exit type setting for mfspr/mtspr is moved from 44x to toplevel SPR
emulation.  This enables it on e500, and makes sure that all SPRs
are covered.

Exit accounting for tlbwe and tlbsx is added to e500.
Signed-off-by: default avatarStuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 90d34b0e
...@@ -158,7 +158,6 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs) ...@@ -158,7 +158,6 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs); emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs);
} }
kvmppc_set_exit_type(vcpu, EMULATED_MTSPR_EXITS);
return emulated; return emulated;
} }
...@@ -179,7 +178,6 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt) ...@@ -179,7 +178,6 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt); emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt);
} }
kvmppc_set_exit_type(vcpu, EMULATED_MFSPR_EXITS);
return emulated; return emulated;
} }
/* /*
* Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
* *
* Author: Yu Liu, yu.liu@freescale.com * Author: Yu Liu, yu.liu@freescale.com
* *
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "../mm/mmu_decl.h" #include "../mm/mmu_decl.h"
#include "e500_tlb.h" #include "e500_tlb.h"
#include "trace.h" #include "trace.h"
#include "timing.h"
#define to_htlb1_esel(esel) (tlb1_entry_num - (esel) - 1) #define to_htlb1_esel(esel) (tlb1_entry_num - (esel) - 1)
...@@ -506,6 +507,7 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb) ...@@ -506,6 +507,7 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb)
vcpu_e500->mas7 = 0; vcpu_e500->mas7 = 0;
} }
kvmppc_set_exit_type(vcpu, EMULATED_TLBSX_EXITS);
return EMULATE_DONE; return EMULATE_DONE;
} }
...@@ -571,6 +573,7 @@ int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu) ...@@ -571,6 +573,7 @@ int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu)
write_host_tlbe(vcpu_e500, stlbsel, sesel); write_host_tlbe(vcpu_e500, stlbsel, sesel);
} }
kvmppc_set_exit_type(vcpu, EMULATED_TLBWE_EXITS);
return EMULATE_DONE; return EMULATE_DONE;
} }
......
...@@ -294,6 +294,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) ...@@ -294,6 +294,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
} }
break; break;
} }
kvmppc_set_exit_type(vcpu, EMULATED_MFSPR_EXITS);
break; break;
case OP_31_XOP_STHX: case OP_31_XOP_STHX:
...@@ -363,6 +364,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) ...@@ -363,6 +364,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
printk("mtspr: unknown spr %x\n", sprn); printk("mtspr: unknown spr %x\n", sprn);
break; break;
} }
kvmppc_set_exit_type(vcpu, EMULATED_MTSPR_EXITS);
break; break;
case OP_31_XOP_DCBI: case OP_31_XOP_DCBI:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment