Loading arch/arm/include/asm/paravirt.h +5 −9 Original line number Diff line number Diff line Loading @@ -3,23 +3,19 @@ #define _ASM_ARM_PARAVIRT_H #ifdef CONFIG_PARAVIRT #include <linux/static_call_types.h> struct static_key; extern struct static_key paravirt_steal_enabled; extern struct static_key paravirt_steal_rq_enabled; struct pv_time_ops { unsigned long long (*steal_clock)(int cpu); }; struct paravirt_patch_template { struct pv_time_ops time; }; u64 dummy_steal_clock(int cpu); extern struct paravirt_patch_template pv_ops; DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); static inline u64 paravirt_steal_clock(int cpu) { return pv_ops.time.steal_clock(cpu); return static_call(pv_steal_clock)(cpu); } #endif Loading arch/arm/kernel/paravirt.c +7 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,15 @@ #include <linux/export.h> #include <linux/jump_label.h> #include <linux/types.h> #include <linux/static_call.h> #include <asm/paravirt.h> struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; struct paravirt_patch_template pv_ops; EXPORT_SYMBOL_GPL(pv_ops); static u64 native_steal_clock(int cpu) { return 0; } DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); arch/arm64/include/asm/paravirt.h +5 −9 Original line number Diff line number Diff line Loading @@ -3,23 +3,19 @@ #define _ASM_ARM64_PARAVIRT_H #ifdef CONFIG_PARAVIRT #include <linux/static_call_types.h> struct static_key; extern struct static_key paravirt_steal_enabled; extern struct static_key paravirt_steal_rq_enabled; struct pv_time_ops { unsigned long long (*steal_clock)(int cpu); }; struct paravirt_patch_template { struct pv_time_ops time; }; u64 dummy_steal_clock(int cpu); extern struct paravirt_patch_template pv_ops; DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); static inline u64 paravirt_steal_clock(int cpu) { return pv_ops.time.steal_clock(cpu); return static_call(pv_steal_clock)(cpu); } int __init pv_time_init(void); Loading arch/arm64/kernel/paravirt.c +9 −4 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/reboot.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/static_call.h> #include <asm/paravirt.h> #include <asm/pvclock-abi.h> Loading @@ -26,8 +27,12 @@ struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; struct paravirt_patch_template pv_ops; EXPORT_SYMBOL_GPL(pv_ops); static u64 native_steal_clock(int cpu) { return 0; } DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); struct pv_time_stolen_time_region { struct pvclock_vcpu_stolen_time *kaddr; Loading @@ -45,7 +50,7 @@ static int __init parse_no_stealacc(char *arg) early_param("no-steal-acc", parse_no_stealacc); /* return stolen time in ns by asking the hypervisor */ static u64 pv_steal_clock(int cpu) static u64 para_steal_clock(int cpu) { struct pv_time_stolen_time_region *reg; Loading Loading @@ -150,7 +155,7 @@ int __init pv_time_init(void) if (ret) return ret; pv_ops.time.steal_clock = pv_steal_clock; static_call_update(pv_steal_clock, para_steal_clock); static_key_slow_inc(¶virt_steal_enabled); if (steal_acc) Loading arch/x86/Kconfig +1 −0 Original line number Diff line number Diff line Loading @@ -774,6 +774,7 @@ if HYPERVISOR_GUEST config PARAVIRT bool "Enable paravirtualization code" depends on HAVE_STATIC_CALL help This changes the kernel so it can modify itself when it is run under a hypervisor, potentially improving performance significantly Loading Loading
arch/arm/include/asm/paravirt.h +5 −9 Original line number Diff line number Diff line Loading @@ -3,23 +3,19 @@ #define _ASM_ARM_PARAVIRT_H #ifdef CONFIG_PARAVIRT #include <linux/static_call_types.h> struct static_key; extern struct static_key paravirt_steal_enabled; extern struct static_key paravirt_steal_rq_enabled; struct pv_time_ops { unsigned long long (*steal_clock)(int cpu); }; struct paravirt_patch_template { struct pv_time_ops time; }; u64 dummy_steal_clock(int cpu); extern struct paravirt_patch_template pv_ops; DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); static inline u64 paravirt_steal_clock(int cpu) { return pv_ops.time.steal_clock(cpu); return static_call(pv_steal_clock)(cpu); } #endif Loading
arch/arm/kernel/paravirt.c +7 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,15 @@ #include <linux/export.h> #include <linux/jump_label.h> #include <linux/types.h> #include <linux/static_call.h> #include <asm/paravirt.h> struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; struct paravirt_patch_template pv_ops; EXPORT_SYMBOL_GPL(pv_ops); static u64 native_steal_clock(int cpu) { return 0; } DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);
arch/arm64/include/asm/paravirt.h +5 −9 Original line number Diff line number Diff line Loading @@ -3,23 +3,19 @@ #define _ASM_ARM64_PARAVIRT_H #ifdef CONFIG_PARAVIRT #include <linux/static_call_types.h> struct static_key; extern struct static_key paravirt_steal_enabled; extern struct static_key paravirt_steal_rq_enabled; struct pv_time_ops { unsigned long long (*steal_clock)(int cpu); }; struct paravirt_patch_template { struct pv_time_ops time; }; u64 dummy_steal_clock(int cpu); extern struct paravirt_patch_template pv_ops; DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); static inline u64 paravirt_steal_clock(int cpu) { return pv_ops.time.steal_clock(cpu); return static_call(pv_steal_clock)(cpu); } int __init pv_time_init(void); Loading
arch/arm64/kernel/paravirt.c +9 −4 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/reboot.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/static_call.h> #include <asm/paravirt.h> #include <asm/pvclock-abi.h> Loading @@ -26,8 +27,12 @@ struct static_key paravirt_steal_enabled; struct static_key paravirt_steal_rq_enabled; struct paravirt_patch_template pv_ops; EXPORT_SYMBOL_GPL(pv_ops); static u64 native_steal_clock(int cpu) { return 0; } DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock); struct pv_time_stolen_time_region { struct pvclock_vcpu_stolen_time *kaddr; Loading @@ -45,7 +50,7 @@ static int __init parse_no_stealacc(char *arg) early_param("no-steal-acc", parse_no_stealacc); /* return stolen time in ns by asking the hypervisor */ static u64 pv_steal_clock(int cpu) static u64 para_steal_clock(int cpu) { struct pv_time_stolen_time_region *reg; Loading Loading @@ -150,7 +155,7 @@ int __init pv_time_init(void) if (ret) return ret; pv_ops.time.steal_clock = pv_steal_clock; static_call_update(pv_steal_clock, para_steal_clock); static_key_slow_inc(¶virt_steal_enabled); if (steal_acc) Loading
arch/x86/Kconfig +1 −0 Original line number Diff line number Diff line Loading @@ -774,6 +774,7 @@ if HYPERVISOR_GUEST config PARAVIRT bool "Enable paravirtualization code" depends on HAVE_STATIC_CALL help This changes the kernel so it can modify itself when it is run under a hypervisor, potentially improving performance significantly Loading