+171
−2
Loading
LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9HDDO ------------------------------------------ On LoongArch, the host and guest have their own PMU CSRs registers and they share PMU hardware resources. A set of PMU CSRs consists of a CTRL register and a CNTR register. We can set which PMU CSRs are used by the guest by writing to the GCFG register [24: 26] bits. On KVM side: - we save the host PMU CSRs into structure kvm_context. - If the host supports the PMU feature. - When entering guest mode. we save the host PMU CSRs and restore the guest PMU CSRs. - When exiting guest mode, we save the guest PMU CSRs and restore the host PMU CSRs. Signed-off-by:Song Gao <gaosong@loongson.cn> Reviewed-by:
Bibo Mao <maobibo@loongson.cn> Signed-off-by:
Xianglai Li <lixianglai@loongson.cn>