Skip to content

Commit 4a09f4a

Browse files
bibo-maochenhuacai
authored andcommitted
LoongArch: KVM: Move some variable declarations to paravirt.h
Some variables relative with paravirt feature are declared in the header file asm/qspinlock.h, however this file can be included only when option CONFIG_SMP is on. There is compiling warnings if CONFIG_SMP is off since variables are not declared. Move these variable declarations to header file asm/paravirt.h to avoid compiling warnings. Fixes: c43dce6 ("LoongArch: KVM: Make vcpu_is_preempted() as a macro rather than function") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202605061313.O8Hswm2b-lkp@intel.com/ Signed-off-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 1c856e1 commit 4a09f4a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

arch/loongarch/include/asm/paravirt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
#ifdef CONFIG_PARAVIRT
66

7+
#include <linux/jump_label.h>
8+
9+
DECLARE_STATIC_KEY_FALSE(virt_preempt_key);
10+
DECLARE_STATIC_KEY_FALSE(virt_spin_lock_key);
11+
DECLARE_PER_CPU(struct kvm_steal_time, steal_time);
12+
713
int __init pv_ipi_init(void);
814
int __init pv_time_init(void);
915
int __init pv_spinlock_init(void);

arch/loongarch/include/asm/qspinlock.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@
33
#define _ASM_LOONGARCH_QSPINLOCK_H
44

55
#include <asm/kvm_para.h>
6-
#include <linux/jump_label.h>
6+
#include <asm/paravirt.h>
77

88
#ifdef CONFIG_PARAVIRT
9-
DECLARE_STATIC_KEY_FALSE(virt_preempt_key);
10-
DECLARE_STATIC_KEY_FALSE(virt_spin_lock_key);
11-
DECLARE_PER_CPU(struct kvm_steal_time, steal_time);
129

1310
#define virt_spin_lock virt_spin_lock
1411

0 commit comments

Comments
 (0)