diff options
author | Bibo Mao <maobibo@loongson.cn> | 2024-09-12 16:56:14 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-09-12 16:56:14 +0200 |
commit | 3abb708ec0be25da16a1ee9f1ab5cbc93f3256f3 (patch) | |
tree | 667cab9b2871b97c38f80e454589edc270f041df /arch/loongarch/include/asm | |
parent | LoongArch: KVM: Enable paravirt feature control from VMM (diff) | |
download | linux-3abb708ec0be25da16a1ee9f1ab5cbc93f3256f3.tar.xz linux-3abb708ec0be25da16a1ee9f1ab5cbc93f3256f3.zip |
LoongArch: KVM: Implement function kvm_para_has_feature()
Implement function kvm_para_has_feature() to detect supported paravirt
features. It can be used by device driver to detect and enable paravirt
features, such as the EIOINTC irqchip driver is able to detect feature
KVM_FEATURE_VIRT_EXTIOI and do some optimization.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm')
-rw-r--r-- | arch/loongarch/include/asm/kvm_para.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/kvm_para.h b/arch/loongarch/include/asm/kvm_para.h index d0f087870628..c4e84227280d 100644 --- a/arch/loongarch/include/asm/kvm_para.h +++ b/arch/loongarch/include/asm/kvm_para.h @@ -156,10 +156,20 @@ static __always_inline long kvm_hypercall5(u64 fid, return ret; } +#ifdef CONFIG_PARAVIRT +bool kvm_para_available(void); +unsigned int kvm_arch_para_features(void); +#else +static inline bool kvm_para_available(void) +{ + return false; +} + static inline unsigned int kvm_arch_para_features(void) { return 0; } +#endif static inline unsigned int kvm_arch_para_hints(void) { |