Lines Matching full:csr
15 #define kvm_write_hw_gcsr(csr, id, val) gcsr_write(val, id) argument
25 static inline void kvm_save_hw_gcsr(struct loongarch_csrs *csr, int gid) in kvm_save_hw_gcsr() argument
27 csr->csrs[gid] = gcsr_read(gid); in kvm_save_hw_gcsr()
30 static inline void kvm_restore_hw_gcsr(struct loongarch_csrs *csr, int gid) in kvm_restore_hw_gcsr() argument
32 gcsr_write(csr->csrs[gid], gid); in kvm_restore_hw_gcsr()
35 static inline unsigned long kvm_read_sw_gcsr(struct loongarch_csrs *csr, int gid) in kvm_read_sw_gcsr() argument
37 return csr->csrs[gid]; in kvm_read_sw_gcsr()
40 static inline void kvm_write_sw_gcsr(struct loongarch_csrs *csr, int gid, unsigned long val) in kvm_write_sw_gcsr() argument
42 csr->csrs[gid] = val; in kvm_write_sw_gcsr()
45 static inline void kvm_set_sw_gcsr(struct loongarch_csrs *csr, int gid, unsigned long val) in kvm_set_sw_gcsr() argument
47 csr->csrs[gid] |= val; in kvm_set_sw_gcsr()
50 static inline void kvm_change_sw_gcsr(struct loongarch_csrs *csr, int gid, unsigned mask, in kvm_change_sw_gcsr() argument
54 csr->csrs[gid] &= ~_mask; in kvm_change_sw_gcsr()
55 csr->csrs[gid] |= val & _mask; in kvm_change_sw_gcsr()
67 #define GET_SW_GCSR(csr, id, csrid, v) \ argument
70 *v = kvm_read_sw_gcsr(csr, id); \
75 #define SET_HW_GCSR(csr, id, csrid, v) \ argument
78 kvm_write_hw_gcsr(csr, csrid, *v); \
83 #define SET_SW_GCSR(csr, id, csrid, v) \ argument
86 kvm_write_sw_gcsr(csr, csrid, *v); \
100 #define CASE_WRITE_HW_PMU(vcpu, csr, id, csrid, v) \ argument
105 kvm_write_hw_gcsr(csr, csrid, v | CSR_PERFCTRL_GMOD); \
109 kvm_write_sw_gcsr(csr, csrid, v); \