KVM: PPC: booke: Added DECAR support
Added the decrementer auto-reload support. DECAR is readable on e500v2/e500mc and later cpus. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Родитель
32fad281c0
Коммит
21bd000abf
|
@ -418,7 +418,9 @@ struct kvm_vcpu_arch {
|
||||||
ulong mcsrr1;
|
ulong mcsrr1;
|
||||||
ulong mcsr;
|
ulong mcsr;
|
||||||
u32 dec;
|
u32 dec;
|
||||||
|
#ifdef CONFIG_BOOKE
|
||||||
u32 decar;
|
u32 decar;
|
||||||
|
#endif
|
||||||
u32 tbl;
|
u32 tbl;
|
||||||
u32 tbu;
|
u32 tbu;
|
||||||
u32 tcr;
|
u32 tcr;
|
||||||
|
|
|
@ -1267,6 +1267,11 @@ void kvmppc_decrementer_func(unsigned long data)
|
||||||
{
|
{
|
||||||
struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
|
struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
|
||||||
|
|
||||||
|
if (vcpu->arch.tcr & TCR_ARE) {
|
||||||
|
vcpu->arch.dec = vcpu->arch.decar;
|
||||||
|
kvmppc_emulate_dec(vcpu);
|
||||||
|
}
|
||||||
|
|
||||||
kvmppc_set_tsr_bits(vcpu, TSR_DIS);
|
kvmppc_set_tsr_bits(vcpu, TSR_DIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,9 @@ int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val)
|
||||||
kvmppc_set_tcr(vcpu, spr_val);
|
kvmppc_set_tcr(vcpu, spr_val);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SPRN_DECAR:
|
||||||
|
vcpu->arch.decar = spr_val;
|
||||||
|
break;
|
||||||
/*
|
/*
|
||||||
* Note: SPRG4-7 are user-readable.
|
* Note: SPRG4-7 are user-readable.
|
||||||
* These values are loaded into the real SPRGs when resuming the
|
* These values are loaded into the real SPRGs when resuming the
|
||||||
|
|
|
@ -269,6 +269,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val)
|
||||||
*spr_val = vcpu->arch.shared->mas7_3 >> 32;
|
*spr_val = vcpu->arch.shared->mas7_3 >> 32;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case SPRN_DECAR:
|
||||||
|
*spr_val = vcpu->arch.decar;
|
||||||
|
break;
|
||||||
case SPRN_TLB0CFG:
|
case SPRN_TLB0CFG:
|
||||||
*spr_val = vcpu->arch.tlbcfg[0];
|
*spr_val = vcpu->arch.tlbcfg[0];
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче