mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 01:08:50 +00:00
x86: provide read and write cr8 paravirt hooks
Since the cr8 manipulation functions ended up staying in the tree, they can't be defined just when PARAVIRT is off: In this patch, those functions are defined for the PARAVIRT case too. [ mingo@elte.hu: fixes ] Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
4c9890c246
commit
94ea03cdda
@ -619,6 +619,7 @@ static inline void write_cr4(unsigned long x)
|
|||||||
PVOP_VCALL1(pv_cpu_ops.write_cr4, x);
|
PVOP_VCALL1(pv_cpu_ops.write_cr4, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86_64
|
||||||
static inline unsigned long read_cr8(void)
|
static inline unsigned long read_cr8(void)
|
||||||
{
|
{
|
||||||
return PVOP_CALL0(unsigned long, pv_cpu_ops.read_cr8);
|
return PVOP_CALL0(unsigned long, pv_cpu_ops.read_cr8);
|
||||||
@ -628,6 +629,7 @@ static inline void write_cr8(unsigned long x)
|
|||||||
{
|
{
|
||||||
PVOP_VCALL1(pv_cpu_ops.write_cr8, x);
|
PVOP_VCALL1(pv_cpu_ops.write_cr8, x);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void raw_safe_halt(void)
|
static inline void raw_safe_halt(void)
|
||||||
{
|
{
|
||||||
|
@ -231,6 +231,20 @@ static inline void native_write_cr4(unsigned long val)
|
|||||||
asm volatile("mov %0,%%cr4": :"r" (val), "m" (__force_order));
|
asm volatile("mov %0,%%cr4": :"r" (val), "m" (__force_order));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_X86_64
|
||||||
|
static inline unsigned long native_read_cr8(void)
|
||||||
|
{
|
||||||
|
unsigned long cr8;
|
||||||
|
asm volatile("movq %%cr8,%0" : "=r" (cr8));
|
||||||
|
return cr8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void native_write_cr8(unsigned long val)
|
||||||
|
{
|
||||||
|
asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void native_wbinvd(void)
|
static inline void native_wbinvd(void)
|
||||||
{
|
{
|
||||||
asm volatile("wbinvd": : :"memory");
|
asm volatile("wbinvd": : :"memory");
|
||||||
@ -248,21 +262,9 @@ static inline void native_wbinvd(void)
|
|||||||
#define read_cr4_safe() (native_read_cr4_safe())
|
#define read_cr4_safe() (native_read_cr4_safe())
|
||||||
#define write_cr4(x) (native_write_cr4(x))
|
#define write_cr4(x) (native_write_cr4(x))
|
||||||
#define wbinvd() (native_wbinvd())
|
#define wbinvd() (native_wbinvd())
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
|
#define read_cr8() (native_read_cr8())
|
||||||
static inline unsigned long read_cr8(void)
|
#define write_cr8(x) (native_write_cr8(x))
|
||||||
{
|
|
||||||
unsigned long cr8;
|
|
||||||
asm volatile("movq %%cr8,%0" : "=r" (cr8));
|
|
||||||
return cr8;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void write_cr8(unsigned long val)
|
|
||||||
{
|
|
||||||
asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Clear the 'TS' bit */
|
/* Clear the 'TS' bit */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user