Lines Matching +full:timebase +full:- +full:frequency

1 // SPDX-License-Identifier: GPL-2.0-only
22 #include <asm/ppc-opcode.h>
31 pr_debug("mtDEC: %lx\n", vcpu->arch.dec); in kvmppc_emulate_dec()
32 hrtimer_try_to_cancel(&vcpu->arch.dec_timer); in kvmppc_emulate_dec()
41 if (vcpu->arch.dec == 0) in kvmppc_emulate_dec()
46 * The decrementer ticks at the same rate as the timebase, so in kvmppc_emulate_dec()
51 dec_time = vcpu->arch.dec; in kvmppc_emulate_dec()
53 * Guest timebase ticks at the same frequency as host timebase. in kvmppc_emulate_dec()
54 * So use the host timebase calculations for decrementer emulation. in kvmppc_emulate_dec()
58 hrtimer_start(&vcpu->arch.dec_timer, in kvmppc_emulate_dec()
60 vcpu->arch.dec_jiffies = get_tb(); in kvmppc_emulate_dec()
65 u64 jd = tb - vcpu->arch.dec_jiffies; in kvmppc_get_dec()
68 if (vcpu->arch.dec < jd) in kvmppc_get_dec()
72 return vcpu->arch.dec - jd; in kvmppc_get_dec()
88 /* XXX We need to context-switch the timebase for in kvmppc_emulate_mtspr()
94 vcpu->arch.dec = (u32) spr_val; in kvmppc_emulate_mtspr()
115 emulated = vcpu->kvm->arch.kvm_ops->emulate_mtspr(vcpu, sprn, in kvmppc_emulate_mtspr()
141 spr_val = vcpu->arch.pvr; in kvmppc_emulate_mfspr()
144 spr_val = vcpu->vcpu_id; in kvmppc_emulate_mfspr()
147 /* Note: mftb and TBRL/TBWL are user-accessible, so in kvmppc_emulate_mfspr()
169 /* Note: SPRG4-7 are user-readable, so we don't get in kvmppc_emulate_mfspr()
176 emulated = vcpu->kvm->arch.kvm_ops->emulate_mfspr(vcpu, sprn, in kvmppc_emulate_mfspr()
192 /* XXX Should probably auto-generate instruction decoding for a particular core
223 vcpu->arch.shared->esr | ESR_PTR); in kvmppc_emulate_instruction()
239 vcpu->arch.shared->esr | ESR_PTR); in kvmppc_emulate_instruction()
264 /* Attempt core-specific emulation below. */ in kvmppc_emulate_instruction()
275 vcpu->run->exit_reason = KVM_EXIT_DEBUG; in kvmppc_emulate_instruction()
276 vcpu->run->debug.arch.status = 0; in kvmppc_emulate_instruction()
277 vcpu->run->debug.arch.address = kvmppc_get_pc(vcpu); in kvmppc_emulate_instruction()
290 emulated = vcpu->kvm->arch.kvm_ops->emulate_op(vcpu, inst, in kvmppc_emulate_instruction()