Lines Matching full:csr

46 	kvm_write_sw_gcsr(vcpu->arch.csr, LOONGARCH_CSR_TVAL, 0);  in kvm_init_timer()
57 struct loongarch_csrs *csr = vcpu->arch.csr; in kvm_restore_timer() local
60 * Set guest stable timer cfg csr in kvm_restore_timer()
61 * Disable timer before restore estat CSR register, avoid to in kvm_restore_timer()
64 cfg = kvm_read_sw_gcsr(csr, LOONGARCH_CSR_TCFG); in kvm_restore_timer()
67 kvm_restore_hw_gcsr(csr, LOONGARCH_CSR_ESTAT); in kvm_restore_timer()
68 kvm_restore_hw_gcsr(csr, LOONGARCH_CSR_TCFG); in kvm_restore_timer()
71 kvm_restore_hw_gcsr(csr, LOONGARCH_CSR_TVAL); in kvm_restore_timer()
83 * If oneshot timer is fired, CSR TVAL will be -1, there are two in kvm_restore_timer()
90 ticks = kvm_read_sw_gcsr(csr, LOONGARCH_CSR_TVAL); in kvm_restore_timer()
91 estat = kvm_read_sw_gcsr(csr, LOONGARCH_CSR_ESTAT); in kvm_restore_timer()
95 * and set CSR TVAL with -1 in kvm_restore_timer()
101 * timer interrupt, and CSR TVAL keeps unchanged with -1, it in kvm_restore_timer()
142 struct loongarch_csrs *csr = vcpu->arch.csr; in _kvm_save_timer() local
144 cfg = kvm_read_sw_gcsr(csr, LOONGARCH_CSR_TCFG); in _kvm_save_timer()
145 ticks = kvm_read_sw_gcsr(csr, LOONGARCH_CSR_TVAL); in _kvm_save_timer()
149 * If period timer is fired, CSR TVAL will be reloaded from CSR TCFG in _kvm_save_timer()
150 * If oneshot timer is fired, CSR TVAL will be -1 in _kvm_save_timer()
178 struct loongarch_csrs *csr = vcpu->arch.csr; in kvm_save_timer() local
183 kvm_save_hw_gcsr(csr, LOONGARCH_CSR_TCFG); in kvm_save_timer()
184 kvm_save_hw_gcsr(csr, LOONGARCH_CSR_TVAL); in kvm_save_timer()
185 if (kvm_read_sw_gcsr(csr, LOONGARCH_CSR_TCFG) & CSR_TCFG_EN) in kvm_save_timer()
189 kvm_save_hw_gcsr(csr, LOONGARCH_CSR_ESTAT); in kvm_save_timer()