Skip to content

Commit f2ac256

Browse files
committed
Merge 'x86/alternatives'
Pick up dependent changes. Signed-off-by: Borislav Petkov <[email protected]>
2 parents 52fa82c + 054ac8a commit f2ac256

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+482
-638
lines changed

arch/arm/include/asm/paravirt.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
#define _ASM_ARM_PARAVIRT_H
44

55
#ifdef CONFIG_PARAVIRT
6+
#include <linux/static_call_types.h>
7+
68
struct static_key;
79
extern struct static_key paravirt_steal_enabled;
810
extern struct static_key paravirt_steal_rq_enabled;
911

10-
struct pv_time_ops {
11-
unsigned long long (*steal_clock)(int cpu);
12-
};
13-
14-
struct paravirt_patch_template {
15-
struct pv_time_ops time;
16-
};
12+
u64 dummy_steal_clock(int cpu);
1713

18-
extern struct paravirt_patch_template pv_ops;
14+
DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock);
1915

2016
static inline u64 paravirt_steal_clock(int cpu)
2117
{
22-
return pv_ops.time.steal_clock(cpu);
18+
return static_call(pv_steal_clock)(cpu);
2319
}
2420
#endif
2521

arch/arm/kernel/paravirt.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
#include <linux/export.h>
1010
#include <linux/jump_label.h>
1111
#include <linux/types.h>
12+
#include <linux/static_call.h>
1213
#include <asm/paravirt.h>
1314

1415
struct static_key paravirt_steal_enabled;
1516
struct static_key paravirt_steal_rq_enabled;
1617

17-
struct paravirt_patch_template pv_ops;
18-
EXPORT_SYMBOL_GPL(pv_ops);
18+
static u64 native_steal_clock(int cpu)
19+
{
20+
return 0;
21+
}
22+
23+
DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);

arch/arm64/include/asm/paravirt.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
#define _ASM_ARM64_PARAVIRT_H
44

55
#ifdef CONFIG_PARAVIRT
6+
#include <linux/static_call_types.h>
7+
68
struct static_key;
79
extern struct static_key paravirt_steal_enabled;
810
extern struct static_key paravirt_steal_rq_enabled;
911

10-
struct pv_time_ops {
11-
unsigned long long (*steal_clock)(int cpu);
12-
};
13-
14-
struct paravirt_patch_template {
15-
struct pv_time_ops time;
16-
};
12+
u64 dummy_steal_clock(int cpu);
1713

18-
extern struct paravirt_patch_template pv_ops;
14+
DECLARE_STATIC_CALL(pv_steal_clock, dummy_steal_clock);
1915

2016
static inline u64 paravirt_steal_clock(int cpu)
2117
{
22-
return pv_ops.time.steal_clock(cpu);
18+
return static_call(pv_steal_clock)(cpu);
2319
}
2420

2521
int __init pv_time_init(void);

arch/arm64/kernel/paravirt.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/reboot.h>
1919
#include <linux/slab.h>
2020
#include <linux/types.h>
21+
#include <linux/static_call.h>
2122

2223
#include <asm/paravirt.h>
2324
#include <asm/pvclock-abi.h>
@@ -26,8 +27,12 @@
2627
struct static_key paravirt_steal_enabled;
2728
struct static_key paravirt_steal_rq_enabled;
2829

29-
struct paravirt_patch_template pv_ops;
30-
EXPORT_SYMBOL_GPL(pv_ops);
30+
static u64 native_steal_clock(int cpu)
31+
{
32+
return 0;
33+
}
34+
35+
DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);
3136

3237
struct pv_time_stolen_time_region {
3338
struct pvclock_vcpu_stolen_time *kaddr;
@@ -45,7 +50,7 @@ static int __init parse_no_stealacc(char *arg)
4550
early_param("no-steal-acc", parse_no_stealacc);
4651

4752
/* return stolen time in ns by asking the hypervisor */
48-
static u64 pv_steal_clock(int cpu)
53+
static u64 para_steal_clock(int cpu)
4954
{
5055
struct pv_time_stolen_time_region *reg;
5156

@@ -150,7 +155,7 @@ int __init pv_time_init(void)
150155
if (ret)
151156
return ret;
152157

153-
pv_ops.time.steal_clock = pv_steal_clock;
158+
static_call_update(pv_steal_clock, para_steal_clock);
154159

155160
static_key_slow_inc(&paravirt_steal_enabled);
156161
if (steal_acc)

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ if HYPERVISOR_GUEST
774774

775775
config PARAVIRT
776776
bool "Enable paravirtualization code"
777+
depends on HAVE_STATIC_CALL
777778
help
778779
This changes the kernel so it can modify itself when it is run
779780
under a hypervisor, potentially improving performance significantly

arch/x86/entry/entry_32.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include <asm/processor-flags.h>
4141
#include <asm/irq_vectors.h>
4242
#include <asm/cpufeatures.h>
43-
#include <asm/alternative-asm.h>
43+
#include <asm/alternative.h>
4444
#include <asm/asm.h>
4545
#include <asm/smap.h>
4646
#include <asm/frame.h>
@@ -349,7 +349,7 @@
349349
* will soon execute iret and the tracer was already set to
350350
* the irqstate after the IRET:
351351
*/
352-
DISABLE_INTERRUPTS(CLBR_ANY)
352+
cli
353353
lss (%esp), %esp /* switch to espfix segment */
354354
.Lend_\@:
355355
#endif /* CONFIG_X86_ESPFIX32 */
@@ -994,7 +994,7 @@ restore_all_switch_stack:
994994
* when returning from IPI handler and when returning from
995995
* scheduler to user-space.
996996
*/
997-
INTERRUPT_RETURN
997+
iret
998998

999999
.section .fixup, "ax"
10001000
SYM_CODE_START(asm_iret_error)

arch/x86/entry/entry_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ SYM_CODE_END(ret_from_fork)
305305
.macro DEBUG_ENTRY_ASSERT_IRQS_OFF
306306
#ifdef CONFIG_DEBUG_ENTRY
307307
pushq %rax
308-
SAVE_FLAGS(CLBR_RAX)
308+
SAVE_FLAGS
309309
testl $X86_EFLAGS_IF, %eax
310310
jz .Lokay_\@
311311
ud2

arch/x86/entry/vdso/vdso32/system_call.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <linux/linkage.h>
77
#include <asm/dwarf2.h>
88
#include <asm/cpufeatures.h>
9-
#include <asm/alternative-asm.h>
9+
#include <asm/alternative.h>
1010

1111
.text
1212
.globl __kernel_vsyscall

arch/x86/include/asm/alternative-asm.h

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)