KVM: PPC: BOOK3S: PR: Emulate instruction counter
Writing to IC is not allowed in the privileged mode. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:

committed by
Alexander Graf

parent
8f42ab2749
commit
06da28e76b
@@ -126,6 +126,8 @@ void kvmppc_copy_to_svcpu(struct kvmppc_book3s_shadow_vcpu *svcpu,
|
||||
*/
|
||||
vcpu->arch.entry_tb = get_tb();
|
||||
vcpu->arch.entry_vtb = get_vtb();
|
||||
if (cpu_has_feature(CPU_FTR_ARCH_207S))
|
||||
vcpu->arch.entry_ic = mfspr(SPRN_IC);
|
||||
svcpu->in_use = true;
|
||||
}
|
||||
|
||||
@@ -178,6 +180,8 @@ void kvmppc_copy_from_svcpu(struct kvm_vcpu *vcpu,
|
||||
vcpu->arch.purr += get_tb() - vcpu->arch.entry_tb;
|
||||
vcpu->arch.spurr += get_tb() - vcpu->arch.entry_tb;
|
||||
vcpu->arch.vtb += get_vtb() - vcpu->arch.entry_vtb;
|
||||
if (cpu_has_feature(CPU_FTR_ARCH_207S))
|
||||
vcpu->arch.ic += mfspr(SPRN_IC) - vcpu->arch.entry_ic;
|
||||
svcpu->in_use = false;
|
||||
|
||||
out:
|
||||
|
Reference in New Issue
Block a user