Commit f2ac256b authored by Borislav Petkov's avatar Borislav Petkov
Browse files

Merge 'x86/alternatives'



Pick up dependent changes.

Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parents 52fa82c2 054ac8ad
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -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

+7 −2
Original line number Diff line number Diff line
@@ -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);
+5 −9
Original line number Diff line number Diff line
@@ -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);
+9 −4
Original line number Diff line number Diff line
@@ -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>
@@ -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;
@@ -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;

@@ -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(&paravirt_steal_enabled);
	if (steal_acc)
+1 −0
Original line number Diff line number Diff line
@@ -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