2019-05-23 11:14:39 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2006-12-07 02:14:07 +01:00
|
|
|
/* Paravirtualization interfaces
|
|
|
|
Copyright (C) 2006 Rusty Russell IBM Corporation
|
|
|
|
|
2008-01-30 13:32:04 +01:00
|
|
|
|
|
|
|
2007 - x86_64 support added by Glauber de Oliveira Costa, Red Hat Inc
|
2006-12-07 02:14:07 +01:00
|
|
|
*/
|
2008-01-30 13:32:04 +01:00
|
|
|
|
2006-12-07 02:14:07 +01:00
|
|
|
#include <linux/errno.h>
|
2016-07-13 20:18:56 -04:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/export.h>
|
2006-12-07 02:14:07 +01:00
|
|
|
#include <linux/efi.h>
|
|
|
|
#include <linux/bcd.h>
|
2007-05-02 19:27:15 +02:00
|
|
|
#include <linux/highmem.h>
|
2014-04-17 17:17:05 +09:00
|
|
|
#include <linux/kprobes.h>
|
2020-06-08 21:32:42 -07:00
|
|
|
#include <linux/pgtable.h>
|
2021-03-11 15:23:09 +01:00
|
|
|
#include <linux/static_call.h>
|
2006-12-07 02:14:07 +01:00
|
|
|
|
|
|
|
#include <asm/bug.h>
|
|
|
|
#include <asm/paravirt.h>
|
2012-01-20 18:35:53 -05:00
|
|
|
#include <asm/debugreg.h>
|
2006-12-07 02:14:07 +01:00
|
|
|
#include <asm/desc.h>
|
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/time.h>
|
2008-06-25 00:19:12 -04:00
|
|
|
#include <asm/pgalloc.h>
|
2006-12-07 02:14:07 +01:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/delay.h>
|
2006-12-07 02:14:08 +01:00
|
|
|
#include <asm/fixmap.h>
|
|
|
|
#include <asm/apic.h>
|
2006-12-07 02:14:08 +01:00
|
|
|
#include <asm/tlbflush.h>
|
2007-03-05 00:30:35 -08:00
|
|
|
#include <asm/timer.h>
|
2012-03-28 18:11:12 +01:00
|
|
|
#include <asm/special_insns.h>
|
2018-08-22 17:30:16 +02:00
|
|
|
#include <asm/tlb.h>
|
2020-02-18 16:47:12 +01:00
|
|
|
#include <asm/io_bitmap.h>
|
2006-12-07 02:14:07 +01:00
|
|
|
|
x86/paravirt: Replace the paravirt nop with a bona fide empty function
PARAVIRT_ADJUST_EXCEPTION_FRAME generates this code (using nmi as an
example, trimmed for readability):
ff 15 00 00 00 00 callq *0x0(%rip) # 2796 <nmi+0x6>
2792: R_X86_64_PC32 pv_irq_ops+0x2c
That's a call through a function pointer to regular C function that
does nothing on native boots, but that function isn't protected
against kprobes, isn't marked notrace, and is certainly not
guaranteed to preserve any registers if the compiler is feeling
perverse. This is bad news for a CLBR_NONE operation.
Of course, if everything works correctly, once paravirt ops are
patched, it gets nopped out, but what if we hit this code before
paravirt ops are patched in? This can potentially cause breakage
that is very difficult to debug.
A more subtle failure is possible here, too: if _paravirt_nop uses
the stack at all (even just to push RBP), it will overwrite the "NMI
executing" variable if it's called in the NMI prologue.
The Xen case, perhaps surprisingly, is fine, because it's already
written in asm.
Fix all of the cases that default to paravirt_nop (including
adjust_exception_frame) with a big hammer: replace paravirt_nop with
an asm function that is just a ret instruction.
The Xen case may have other problems, so document them.
This is part of a fix for some random crashes that Sasha saw.
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/8f5d2ba295f9d73751c33d97fda03e0495d9ade0.1442791737.git.luto@kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-09-20 16:32:04 -07:00
|
|
|
/*
|
|
|
|
* nop stub, which must not clobber anything *including the stack* to
|
|
|
|
* avoid confusing the entry prologues.
|
|
|
|
*/
|
2022-11-09 14:44:18 +01:00
|
|
|
DEFINE_PARAVIRT_ASM(_paravirt_nop, "", .entry.text);
|
2006-12-07 02:14:07 +01:00
|
|
|
|
2021-10-28 09:27:48 +02:00
|
|
|
/* stub always returning 0. */
|
2022-11-09 14:44:18 +01:00
|
|
|
DEFINE_PARAVIRT_ASM(paravirt_ret0, "xor %eax,%eax", .entry.text);
|
2021-10-28 09:27:48 +02:00
|
|
|
|
2009-08-20 13:19:57 +02:00
|
|
|
void __init default_banner(void)
|
2006-12-07 02:14:07 +01:00
|
|
|
{
|
|
|
|
printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
|
2007-10-16 11:51:29 -07:00
|
|
|
pv_info.name);
|
2006-12-07 02:14:07 +01:00
|
|
|
}
|
|
|
|
|
2007-10-16 11:51:29 -07:00
|
|
|
/* Undefined instruction for dealing with missing ops pointers. */
|
2021-10-28 09:27:48 +02:00
|
|
|
noinstr void paravirt_BUG(void)
|
2021-03-11 15:23:18 +01:00
|
|
|
{
|
|
|
|
BUG();
|
|
|
|
}
|
2006-12-07 02:14:08 +01:00
|
|
|
|
2019-04-25 13:03:31 +02:00
|
|
|
static unsigned paravirt_patch_call(void *insn_buff, const void *target,
|
2018-08-28 09:40:17 +02:00
|
|
|
unsigned long addr, unsigned len)
|
2007-05-02 19:27:14 +02:00
|
|
|
{
|
2022-03-08 16:30:20 +01:00
|
|
|
__text_gen_insn(insn_buff, CALL_INSN_OPCODE,
|
|
|
|
(void *)addr, target, CALL_INSN_SIZE);
|
|
|
|
return CALL_INSN_SIZE;
|
2007-05-02 19:27:14 +02:00
|
|
|
}
|
|
|
|
|
2018-08-28 09:40:23 +02:00
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2018-10-30 07:33:01 +01:00
|
|
|
/* identity function, which can be inlined */
|
|
|
|
u64 notrace _paravirt_ident_64(u64 x)
|
|
|
|
{
|
|
|
|
return x;
|
|
|
|
}
|
2018-08-28 09:40:23 +02:00
|
|
|
#endif
|
2007-05-02 19:27:14 +02:00
|
|
|
|
2017-09-06 19:36:24 +02:00
|
|
|
DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
|
|
|
|
|
|
|
|
void __init native_pv_lock_init(void)
|
|
|
|
{
|
2019-03-29 19:52:59 +01:00
|
|
|
if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
|
2017-09-06 19:36:24 +02:00
|
|
|
static_branch_disable(&virt_spin_lock_key);
|
|
|
|
}
|
|
|
|
|
2021-03-11 15:23:19 +01:00
|
|
|
unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr,
|
|
|
|
unsigned int len)
|
2007-05-02 19:27:14 +02:00
|
|
|
{
|
2018-08-28 09:40:19 +02:00
|
|
|
/*
|
|
|
|
* Neat trick to map patch type back to the call within the
|
|
|
|
* corresponding structure.
|
|
|
|
*/
|
|
|
|
void *opfunc = *((void **)&pv_ops + type);
|
2007-05-02 19:27:14 +02:00
|
|
|
unsigned ret;
|
|
|
|
|
|
|
|
if (opfunc == NULL)
|
2021-03-11 15:23:18 +01:00
|
|
|
/* If there's no function, patch it with paravirt_BUG() */
|
|
|
|
ret = paravirt_patch_call(insn_buff, paravirt_BUG, addr, len);
|
2009-01-28 14:35:02 -08:00
|
|
|
else if (opfunc == _paravirt_nop)
|
2015-11-03 10:18:49 +01:00
|
|
|
ret = 0;
|
2007-05-02 19:27:14 +02:00
|
|
|
else
|
2018-08-28 09:40:17 +02:00
|
|
|
/* Otherwise call the function. */
|
2019-04-25 13:03:31 +02:00
|
|
|
ret = paravirt_patch_call(insn_buff, opfunc, addr, len);
|
2007-05-02 19:27:14 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-02-24 08:31:31 +01:00
|
|
|
struct static_key paravirt_steal_enabled;
|
|
|
|
struct static_key paravirt_steal_rq_enabled;
|
2011-07-11 15:28:15 -04:00
|
|
|
|
|
|
|
static u64 native_steal_clock(int cpu)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-03-11 15:23:09 +01:00
|
|
|
DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);
|
|
|
|
DEFINE_STATIC_CALL(pv_sched_clock, native_sched_clock);
|
|
|
|
|
|
|
|
void paravirt_set_sched_clock(u64 (*func)(void))
|
|
|
|
{
|
|
|
|
static_call_update(pv_sched_clock, func);
|
|
|
|
}
|
|
|
|
|
2006-12-07 02:14:07 +01:00
|
|
|
/* These are in entry.S */
|
2007-07-17 18:37:04 -07:00
|
|
|
static struct resource reserve_ioports = {
|
|
|
|
.start = 0,
|
|
|
|
.end = IO_SPACE_LIMIT,
|
|
|
|
.name = "paravirt-ioport",
|
|
|
|
.flags = IORESOURCE_IO | IORESOURCE_BUSY,
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reserve the whole legacy IO space to prevent any legacy drivers
|
|
|
|
* from wasting time probing for their hardware. This is a fairly
|
|
|
|
* brute-force approach to disabling all non-virtual drivers.
|
|
|
|
*
|
|
|
|
* Note that this must be called very early to have any effect.
|
|
|
|
*/
|
|
|
|
int paravirt_disable_iospace(void)
|
|
|
|
{
|
2008-03-27 17:28:40 -07:00
|
|
|
return request_resource(&ioport_resource, &reserve_ioports);
|
2007-07-17 18:37:04 -07:00
|
|
|
}
|
|
|
|
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
static DEFINE_PER_CPU(enum paravirt_lazy_mode, paravirt_lazy_mode) = PARAVIRT_LAZY_NONE;
|
|
|
|
|
|
|
|
static inline void enter_lazy(enum paravirt_lazy_mode mode)
|
|
|
|
{
|
2012-05-11 15:35:27 +08:00
|
|
|
BUG_ON(this_cpu_read(paravirt_lazy_mode) != PARAVIRT_LAZY_NONE);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
|
2012-05-11 15:35:27 +08:00
|
|
|
this_cpu_write(paravirt_lazy_mode, mode);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
}
|
|
|
|
|
2009-02-17 23:46:21 -08:00
|
|
|
static void leave_lazy(enum paravirt_lazy_mode mode)
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
{
|
2012-05-11 15:35:27 +08:00
|
|
|
BUG_ON(this_cpu_read(paravirt_lazy_mode) != mode);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
|
2012-05-11 15:35:27 +08:00
|
|
|
this_cpu_write(paravirt_lazy_mode, PARAVIRT_LAZY_NONE);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void paravirt_enter_lazy_mmu(void)
|
|
|
|
{
|
|
|
|
enter_lazy(PARAVIRT_LAZY_MMU);
|
|
|
|
}
|
|
|
|
|
|
|
|
void paravirt_leave_lazy_mmu(void)
|
|
|
|
{
|
2009-02-17 23:46:21 -08:00
|
|
|
leave_lazy(PARAVIRT_LAZY_MMU);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
}
|
|
|
|
|
2013-03-23 09:36:36 -04:00
|
|
|
void paravirt_flush_lazy_mmu(void)
|
|
|
|
{
|
|
|
|
preempt_disable();
|
|
|
|
|
|
|
|
if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
|
|
|
|
arch_leave_lazy_mmu_mode();
|
|
|
|
arch_enter_lazy_mmu_mode();
|
|
|
|
}
|
|
|
|
|
|
|
|
preempt_enable();
|
|
|
|
}
|
|
|
|
|
2018-08-28 09:40:23 +02:00
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2009-02-18 11:18:57 -08:00
|
|
|
void paravirt_start_context_switch(struct task_struct *prev)
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
{
|
2009-02-17 23:53:19 -08:00
|
|
|
BUG_ON(preemptible());
|
|
|
|
|
2012-05-11 15:35:27 +08:00
|
|
|
if (this_cpu_read(paravirt_lazy_mode) == PARAVIRT_LAZY_MMU) {
|
2009-02-17 23:46:21 -08:00
|
|
|
arch_leave_lazy_mmu_mode();
|
2009-02-18 11:18:57 -08:00
|
|
|
set_ti_thread_flag(task_thread_info(prev), TIF_LAZY_MMU_UPDATES);
|
2009-02-17 23:46:21 -08:00
|
|
|
}
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
enter_lazy(PARAVIRT_LAZY_CPU);
|
|
|
|
}
|
|
|
|
|
2009-02-18 11:18:57 -08:00
|
|
|
void paravirt_end_context_switch(struct task_struct *next)
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
{
|
2009-02-17 23:53:19 -08:00
|
|
|
BUG_ON(preemptible());
|
|
|
|
|
2009-02-17 23:46:21 -08:00
|
|
|
leave_lazy(PARAVIRT_LAZY_CPU);
|
|
|
|
|
2009-02-18 11:18:57 -08:00
|
|
|
if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES))
|
2009-02-17 23:46:21 -08:00
|
|
|
arch_enter_lazy_mmu_mode();
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
}
|
2021-06-24 11:41:13 +02:00
|
|
|
|
|
|
|
static noinstr unsigned long pv_native_read_cr2(void)
|
|
|
|
{
|
|
|
|
return native_read_cr2();
|
|
|
|
}
|
2021-06-24 11:41:14 +02:00
|
|
|
|
|
|
|
static noinstr void pv_native_write_cr2(unsigned long val)
|
|
|
|
{
|
|
|
|
native_write_cr2(val);
|
|
|
|
}
|
2021-06-24 11:41:15 +02:00
|
|
|
|
|
|
|
static noinstr unsigned long pv_native_get_debugreg(int regno)
|
|
|
|
{
|
|
|
|
return native_get_debugreg(regno);
|
|
|
|
}
|
2021-06-24 11:41:16 +02:00
|
|
|
|
|
|
|
static noinstr void pv_native_set_debugreg(int regno, unsigned long val)
|
|
|
|
{
|
|
|
|
native_set_debugreg(regno, val);
|
|
|
|
}
|
2021-06-24 11:41:19 +02:00
|
|
|
|
|
|
|
static noinstr void pv_native_irq_enable(void)
|
|
|
|
{
|
|
|
|
native_irq_enable();
|
|
|
|
}
|
2021-06-24 11:41:20 +02:00
|
|
|
|
|
|
|
static noinstr void pv_native_irq_disable(void)
|
|
|
|
{
|
|
|
|
native_irq_disable();
|
|
|
|
}
|
2018-08-28 09:40:23 +02:00
|
|
|
#endif
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
|
|
|
|
enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
|
|
|
|
{
|
2009-02-17 23:05:19 -08:00
|
|
|
if (in_interrupt())
|
|
|
|
return PARAVIRT_LAZY_NONE;
|
|
|
|
|
2012-05-11 15:35:27 +08:00
|
|
|
return this_cpu_read(paravirt_lazy_mode);
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
}
|
|
|
|
|
2007-10-16 11:51:29 -07:00
|
|
|
struct pv_info pv_info = {
|
2006-12-07 02:14:07 +01:00
|
|
|
.name = "bare hardware",
|
2018-08-28 09:40:22 +02:00
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2011-08-03 09:31:53 -04:00
|
|
|
.extra_user_64bit_cs = __USER_CS,
|
|
|
|
#endif
|
2007-10-16 11:51:29 -07:00
|
|
|
};
|
2006-12-07 02:14:07 +01:00
|
|
|
|
2009-01-28 14:35:02 -08:00
|
|
|
/* 64-bit pagetable entries */
|
2009-01-28 14:35:07 -08:00
|
|
|
#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64)
|
2009-01-28 14:35:02 -08:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
struct paravirt_patch_template pv_ops = {
|
|
|
|
/* Cpu ops. */
|
2018-08-28 09:40:23 +02:00
|
|
|
.cpu.io_delay = native_io_delay,
|
2006-12-07 02:14:08 +01:00
|
|
|
|
2018-08-28 09:40:23 +02:00
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2018-08-28 09:40:19 +02:00
|
|
|
.cpu.cpuid = native_cpuid,
|
2021-06-24 11:41:15 +02:00
|
|
|
.cpu.get_debugreg = pv_native_get_debugreg,
|
2021-06-24 11:41:16 +02:00
|
|
|
.cpu.set_debugreg = pv_native_set_debugreg,
|
2018-08-28 09:40:19 +02:00
|
|
|
.cpu.read_cr0 = native_read_cr0,
|
|
|
|
.cpu.write_cr0 = native_write_cr0,
|
|
|
|
.cpu.write_cr4 = native_write_cr4,
|
|
|
|
.cpu.wbinvd = native_wbinvd,
|
|
|
|
.cpu.read_msr = native_read_msr,
|
|
|
|
.cpu.write_msr = native_write_msr,
|
|
|
|
.cpu.read_msr_safe = native_read_msr_safe,
|
|
|
|
.cpu.write_msr_safe = native_write_msr_safe,
|
|
|
|
.cpu.read_pmc = native_read_pmc,
|
|
|
|
.cpu.load_tr_desc = native_load_tr_desc,
|
|
|
|
.cpu.set_ldt = native_set_ldt,
|
|
|
|
.cpu.load_gdt = native_load_gdt,
|
|
|
|
.cpu.load_idt = native_load_idt,
|
|
|
|
.cpu.store_tr = native_store_tr,
|
|
|
|
.cpu.load_tls = native_load_tls,
|
|
|
|
.cpu.load_gs_index = native_load_gs_index,
|
|
|
|
.cpu.write_ldt_entry = native_write_ldt_entry,
|
|
|
|
.cpu.write_gdt_entry = native_write_gdt_entry,
|
|
|
|
.cpu.write_idt_entry = native_write_idt_entry,
|
2008-06-25 00:19:12 -04:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.cpu.alloc_ldt = paravirt_nop,
|
|
|
|
.cpu.free_ldt = paravirt_nop,
|
2007-02-13 13:26:21 +01:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.cpu.load_sp0 = native_load_sp0,
|
2007-05-02 19:27:13 +02:00
|
|
|
|
2020-02-18 16:47:12 +01:00
|
|
|
#ifdef CONFIG_X86_IOPL_IOPERM
|
2020-07-17 16:53:55 -07:00
|
|
|
.cpu.invalidate_io_bitmap = native_tss_invalidate_io_bitmap,
|
|
|
|
.cpu.update_io_bitmap = native_tss_update_io_bitmap,
|
2020-02-18 16:47:12 +01:00
|
|
|
#endif
|
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.cpu.start_context_switch = paravirt_nop,
|
|
|
|
.cpu.end_context_switch = paravirt_nop,
|
|
|
|
|
|
|
|
/* Irq ops. */
|
|
|
|
.irq.save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
|
2021-06-24 11:41:20 +02:00
|
|
|
.irq.irq_disable = __PV_IS_CALLEE_SAVE(pv_native_irq_disable),
|
2021-06-24 11:41:19 +02:00
|
|
|
.irq.irq_enable = __PV_IS_CALLEE_SAVE(pv_native_irq_enable),
|
2018-08-28 09:40:19 +02:00
|
|
|
.irq.safe_halt = native_safe_halt,
|
|
|
|
.irq.halt = native_halt,
|
2018-08-28 09:40:24 +02:00
|
|
|
#endif /* CONFIG_PARAVIRT_XXL */
|
2018-08-28 09:40:19 +02:00
|
|
|
|
|
|
|
/* Mmu ops. */
|
2020-04-21 11:20:32 +02:00
|
|
|
.mmu.flush_tlb_user = native_flush_tlb_local,
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.flush_tlb_kernel = native_flush_tlb_global,
|
|
|
|
.mmu.flush_tlb_one_user = native_flush_tlb_one_user,
|
2021-02-20 15:17:07 -08:00
|
|
|
.mmu.flush_tlb_multi = native_flush_tlb_multi,
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.tlb_remove_table =
|
|
|
|
(void (*)(struct mmu_gather *, void *))tlb_remove_page,
|
|
|
|
|
2018-08-28 09:40:25 +02:00
|
|
|
.mmu.exit_mmap = paravirt_nop,
|
2021-08-24 11:05:00 +00:00
|
|
|
.mmu.notify_page_enc_status_changed = paravirt_nop,
|
2018-08-28 09:40:25 +02:00
|
|
|
|
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2021-06-24 11:41:13 +02:00
|
|
|
.mmu.read_cr2 = __PV_IS_CALLEE_SAVE(pv_native_read_cr2),
|
2021-06-24 11:41:14 +02:00
|
|
|
.mmu.write_cr2 = pv_native_write_cr2,
|
2018-08-28 09:40:25 +02:00
|
|
|
.mmu.read_cr3 = __native_read_cr3,
|
|
|
|
.mmu.write_cr3 = native_write_cr3,
|
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.pgd_alloc = __paravirt_pgd_alloc,
|
|
|
|
.mmu.pgd_free = paravirt_nop,
|
|
|
|
|
|
|
|
.mmu.alloc_pte = paravirt_nop,
|
|
|
|
.mmu.alloc_pmd = paravirt_nop,
|
|
|
|
.mmu.alloc_pud = paravirt_nop,
|
|
|
|
.mmu.alloc_p4d = paravirt_nop,
|
|
|
|
.mmu.release_pte = paravirt_nop,
|
|
|
|
.mmu.release_pmd = paravirt_nop,
|
|
|
|
.mmu.release_pud = paravirt_nop,
|
|
|
|
.mmu.release_p4d = paravirt_nop,
|
|
|
|
|
|
|
|
.mmu.set_pte = native_set_pte,
|
|
|
|
.mmu.set_pmd = native_set_pmd,
|
|
|
|
|
|
|
|
.mmu.ptep_modify_prot_start = __ptep_modify_prot_start,
|
|
|
|
.mmu.ptep_modify_prot_commit = __ptep_modify_prot_commit,
|
2008-06-16 04:30:01 -07:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.set_pud = native_set_pud,
|
2009-01-28 14:35:07 -08:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.pmd_val = PTE_IDENT,
|
|
|
|
.mmu.make_pmd = PTE_IDENT,
|
2008-01-30 13:33:20 +01:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.pud_val = PTE_IDENT,
|
|
|
|
.mmu.make_pud = PTE_IDENT,
|
2009-01-28 14:35:07 -08:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.set_p4d = native_set_p4d,
|
2017-03-17 21:55:15 +03:00
|
|
|
|
|
|
|
#if CONFIG_PGTABLE_LEVELS >= 5
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.p4d_val = PTE_IDENT,
|
|
|
|
.mmu.make_p4d = PTE_IDENT,
|
2017-03-30 11:07:28 +03:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.set_pgd = native_set_pgd,
|
2017-03-30 11:07:28 +03:00
|
|
|
#endif /* CONFIG_PGTABLE_LEVELS >= 5 */
|
2006-12-07 02:14:08 +01:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.pte_val = PTE_IDENT,
|
|
|
|
.mmu.pgd_val = PTE_IDENT,
|
2007-05-02 19:27:13 +02:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.make_pte = PTE_IDENT,
|
|
|
|
.mmu.make_pgd = PTE_IDENT,
|
2007-05-02 19:27:13 +02:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.dup_mmap = paravirt_nop,
|
|
|
|
.mmu.activate_mm = paravirt_nop,
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.lazy_mode = {
|
|
|
|
.enter = paravirt_nop,
|
|
|
|
.leave = paravirt_nop,
|
|
|
|
.flush = paravirt_nop,
|
paravirt: clean up lazy mode handling
Currently, the set_lazy_mode pv_op is overloaded with 5 functions:
1. enter lazy cpu mode
2. leave lazy cpu mode
3. enter lazy mmu mode
4. leave lazy mmu mode
5. flush pending batched operations
This complicates each paravirt backend, since it needs to deal with
all the possible state transitions, handling flushing, etc. In
particular, flushing is quite distinct from the other 4 functions, and
seems to just cause complication.
This patch removes the set_lazy_mode operation, and adds "enter" and
"leave" lazy mode operations on mmu_ops and cpu_ops. All the logic
associated with enter and leaving lazy states is now in common code
(basically BUG_ONs to make sure that no mode is current when entering
a lazy mode, and make sure that the mode is current when leaving).
Also, flush is handled in a common way, by simply leaving and
re-entering the lazy mode.
The result is that the Xen, lguest and VMI lazy mode implementations
are much simpler.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Zach Amsden <zach@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Anthony Liguory <aliguori@us.ibm.com>
Cc: "Glauber de Oliveira Costa" <glommer@gmail.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
2007-10-16 11:51:29 -07:00
|
|
|
},
|
2008-06-17 11:42:01 -07:00
|
|
|
|
2018-08-28 09:40:19 +02:00
|
|
|
.mmu.set_fixmap = native_set_fixmap,
|
2018-08-28 09:40:25 +02:00
|
|
|
#endif /* CONFIG_PARAVIRT_XXL */
|
2018-08-28 09:40:19 +02:00
|
|
|
|
|
|
|
#if defined(CONFIG_PARAVIRT_SPINLOCKS)
|
|
|
|
/* Lock ops. */
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
.lock.queued_spin_lock_slowpath = native_queued_spin_lock_slowpath,
|
|
|
|
.lock.queued_spin_unlock =
|
|
|
|
PV_CALLEE_SAVE(__native_queued_spin_unlock),
|
|
|
|
.lock.wait = paravirt_nop,
|
|
|
|
.lock.kick = paravirt_nop,
|
|
|
|
.lock.vcpu_is_preempted =
|
|
|
|
PV_CALLEE_SAVE(__native_vcpu_is_preempted),
|
|
|
|
#endif /* SMP */
|
|
|
|
#endif
|
2006-12-07 02:14:07 +01:00
|
|
|
};
|
2007-01-22 20:40:36 -08:00
|
|
|
|
2018-08-28 09:40:23 +02:00
|
|
|
#ifdef CONFIG_PARAVIRT_XXL
|
2018-08-28 09:40:19 +02:00
|
|
|
NOKPROBE_SYMBOL(native_load_idt);
|
2018-08-28 09:40:23 +02:00
|
|
|
#endif
|
2018-08-28 09:40:19 +02:00
|
|
|
|
2018-10-29 16:01:16 +01:00
|
|
|
EXPORT_SYMBOL(pv_ops);
|
2007-10-16 11:51:29 -07:00
|
|
|
EXPORT_SYMBOL_GPL(pv_info);
|