Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm/paravirt: Use common code for paravirt_steal_clock()

Remove the arch-specific variant of paravirt_steal_clock() and use
the common one instead.

This allows to remove paravirt.c and paravirt.h from arch/arm.

Until all archs supporting Xen have been switched to the common code
of paravirt_steal_clock(), drivers/xen/time.c needs to include
asm/paravirt.h for those archs, while this is not necessary for arm
any longer.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260105110520.21356-8-jgross@suse.com

authored by

Juergen Gross and committed by
Borislav Petkov (AMD)
15518e63 e6b2aa6d

+3 -39
+1
arch/arm/Kconfig
··· 1320 1320 1321 1321 config PARAVIRT 1322 1322 bool "Enable paravirtualization code" 1323 + select HAVE_PV_STEAL_CLOCK_GEN 1323 1324 help 1324 1325 This changes the kernel so it can modify itself when it is run 1325 1326 under a hypervisor, potentially improving performance significantly
-18
arch/arm/include/asm/paravirt.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_ARM_PARAVIRT_H 3 - #define _ASM_ARM_PARAVIRT_H 4 - 5 - #ifdef CONFIG_PARAVIRT 6 - #include <linux/static_call_types.h> 7 - 8 - u64 dummy_steal_clock(int cpu); 9 - 10 - DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock); 11 - 12 - static inline u64 paravirt_steal_clock(int cpu) 13 - { 14 - return static_call(pv_steal_clock)(cpu); 15 - } 16 - #endif 17 - 18 - #endif
-1
arch/arm/kernel/Makefile
··· 83 83 obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o 84 84 obj-$(CONFIG_VDSO) += vdso.o 85 85 obj-$(CONFIG_EFI) += efi.o 86 - obj-$(CONFIG_PARAVIRT) += paravirt.o 87 86 88 87 obj-y += head$(MMUEXT).o 89 88 obj-$(CONFIG_DEBUG_LL) += debug.o
-20
arch/arm/kernel/paravirt.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * 4 - * Copyright (C) 2013 Citrix Systems 5 - * 6 - * Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com> 7 - */ 8 - 9 - #include <linux/export.h> 10 - #include <linux/jump_label.h> 11 - #include <linux/types.h> 12 - #include <linux/static_call.h> 13 - #include <asm/paravirt.h> 14 - 15 - static u64 native_steal_clock(int cpu) 16 - { 17 - return 0; 18 - } 19 - 20 - DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);
+2
drivers/xen/time.c
··· 10 10 #include <linux/static_call.h> 11 11 #include <linux/sched/cputime.h> 12 12 13 + #ifndef CONFIG_HAVE_PV_STEAL_CLOCK_GEN 13 14 #include <asm/paravirt.h> 15 + #endif 14 16 #include <asm/xen/hypervisor.h> 15 17 #include <asm/xen/hypercall.h> 16 18