Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2c5ea4f authored by Wanpeng Li's avatar Wanpeng Li Committed by Thomas Gleixner
Browse files

x86/msr: Add wrmsr_notrace()



Required to remove the extra irq_enter()/irq_exit() in
smp_reschedule_interrupt().

Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarBorislav Petkov <bp@alien8.de>
Cc: kvm@vger.kernel.org
Cc: Mike Galbraith <efault@gmx.de>
Link: http://lkml.kernel.org/r/1478488420-5982-2-git-send-email-wanpeng.li@hotmail.com


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent d2d9c4a3
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -115,17 +115,29 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr,
}

/* Can be uninlined because referenced by paravirt */
notrace static inline void native_write_msr(unsigned int msr,
static notrace inline void __native_write_msr_notrace(unsigned int msr,
					    unsigned low, unsigned high)
{
	asm volatile("1: wrmsr\n"
		     "2:\n"
		     _ASM_EXTABLE_HANDLE(1b, 2b, ex_handler_wrmsr_unsafe)
		     : : "c" (msr), "a"(low), "d" (high) : "memory");
}

/* Can be uninlined because referenced by paravirt */
static notrace inline void native_write_msr(unsigned int msr,
					    unsigned low, unsigned high)
{
	__native_write_msr_notrace(msr, low, high);
	if (msr_tracepoint_active(__tracepoint_write_msr))
		do_trace_write_msr(msr, ((u64)high << 32 | low), 0);
}

static inline void wrmsr_notrace(unsigned msr, unsigned low, unsigned high)
{
	__native_write_msr_notrace(msr, low, high);
}

/* Can be uninlined because referenced by paravirt */
notrace static inline int native_write_msr_safe(unsigned int msr,
					unsigned low, unsigned high)