Commit 83b584d9 authored by Andrew Cooper's avatar Andrew Cooper Committed by Thomas Gleixner
Browse files

x86/paravirt: Drop {read,write}_cr8() hooks



There is a lot of infrastructure for functionality which is used
exclusively in __{save,restore}_processor_state() on the suspend/resume
path.

cr8 is an alias of APIC_TASKPRI, and APIC_TASKPRI is saved/restored by
lapic_{suspend,resume}().  Saving and restoring cr8 independently of the
rest of the Local APIC state isn't a clever thing to be doing.

Delete the suspend/resume cr8 handling, which shrinks the size of struct
saved_context, and allows for the removal of both PVOPS.

Signed-off-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Link: https://lkml.kernel.org/r/20190715151641.29210-1-andrew.cooper3@citrix.com
parent 229b969b
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -139,18 +139,6 @@ static inline void __write_cr4(unsigned long x)
	PVOP_VCALL1(cpu.write_cr4, x);
}

#ifdef CONFIG_X86_64
static inline unsigned long read_cr8(void)
{
	return PVOP_CALL0(unsigned long, cpu.read_cr8);
}

static inline void write_cr8(unsigned long x)
{
	PVOP_VCALL1(cpu.write_cr8, x);
}
#endif

static inline void arch_safe_halt(void)
{
	PVOP_VCALL0(irq.safe_halt);
+0 −5
Original line number Diff line number Diff line
@@ -119,11 +119,6 @@ struct pv_cpu_ops {

	void (*write_cr4)(unsigned long);

#ifdef CONFIG_X86_64
	unsigned long (*read_cr8)(void);
	void (*write_cr8)(unsigned long);
#endif

	/* Segment descriptor handling */
	void (*load_tr_desc)(void);
	void (*load_gdt)(const struct desc_ptr *);
+0 −24
Original line number Diff line number Diff line
@@ -73,20 +73,6 @@ static inline unsigned long native_read_cr4(void)

void native_write_cr4(unsigned long val);

#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

#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
static inline u32 rdpkru(void)
{
@@ -200,16 +186,6 @@ static inline void wbinvd(void)

#ifdef CONFIG_X86_64

static inline unsigned long read_cr8(void)
{
	return native_read_cr8();
}

static inline void write_cr8(unsigned long x)
{
	native_write_cr8(x);
}

static inline void load_gs_index(unsigned selector)
{
	native_load_gs_index(selector);
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ struct saved_context {
	 */
	unsigned long kernelmode_gs_base, usermode_gs_base, fs_base;

	unsigned long cr0, cr2, cr3, cr4, cr8;
	unsigned long cr0, cr2, cr3, cr4;
	u64 misc_enable;
	bool misc_enable_saved;
	struct saved_msrs saved_msrs;
+0 −1
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ int main(void)
	ENTRY(cr2);
	ENTRY(cr3);
	ENTRY(cr4);
	ENTRY(cr8);
	ENTRY(gdt_desc);
	BLANK();
#undef ENTRY
Loading