Lines Matching refs:csrid
65 static unsigned long kvm_emu_read_csr(struct kvm_vcpu *vcpu, int csrid) in kvm_emu_read_csr() argument
74 if (get_gcsr_flag(csrid) & SW_GCSR) in kvm_emu_read_csr()
75 val = kvm_read_sw_gcsr(csr, csrid); in kvm_emu_read_csr()
77 pr_warn_once("Unsupported csrrd 0x%x with pc %lx\n", csrid, vcpu->arch.pc); in kvm_emu_read_csr()
82 static unsigned long kvm_emu_write_csr(struct kvm_vcpu *vcpu, int csrid, unsigned long val) in kvm_emu_write_csr() argument
87 if (get_gcsr_flag(csrid) & SW_GCSR) { in kvm_emu_write_csr()
88 old = kvm_read_sw_gcsr(csr, csrid); in kvm_emu_write_csr()
89 kvm_write_sw_gcsr(csr, csrid, val); in kvm_emu_write_csr()
91 pr_warn_once("Unsupported csrwr 0x%x with pc %lx\n", csrid, vcpu->arch.pc); in kvm_emu_write_csr()
96 static unsigned long kvm_emu_xchg_csr(struct kvm_vcpu *vcpu, int csrid, in kvm_emu_xchg_csr() argument
102 if (get_gcsr_flag(csrid) & SW_GCSR) { in kvm_emu_xchg_csr()
103 old = kvm_read_sw_gcsr(csr, csrid); in kvm_emu_xchg_csr()
105 kvm_write_sw_gcsr(csr, csrid, val); in kvm_emu_xchg_csr()
108 pr_warn_once("Unsupported csrxchg 0x%x with pc %lx\n", csrid, vcpu->arch.pc); in kvm_emu_xchg_csr()
115 unsigned int rd, rj, csrid; in kvm_handle_csr() local
126 csrid = inst.reg2csr_format.csr; in kvm_handle_csr()
128 if (csrid >= LOONGARCH_CSR_PERFCTRL0 && csrid <= vcpu->arch.max_pmu_csrid) { in kvm_handle_csr()
139 val = kvm_emu_read_csr(vcpu, csrid); in kvm_handle_csr()
144 val = kvm_emu_write_csr(vcpu, csrid, val); in kvm_handle_csr()
150 val = kvm_emu_xchg_csr(vcpu, csrid, csr_mask, val); in kvm_handle_csr()