mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 20:34:05 +00:00
x86/hyperv: Use current_stack_pointer to avoid asm() in hv_hvcrash_ctxt_save()
Use current_stack_pointer to avoid asm() when saving %rsp to the crash context memory in hv_hvcrash_ctxt_save(). The new code is more readable and results in exactly the same object file. Signed-off-by: Uros Bizjak <[email protected]> Cc: K. Y. Srinivasan <[email protected]> Cc: Haiyang Zhang <[email protected]> Cc: Wei Liu <[email protected]> Cc: Dexuan Cui <[email protected]> Cc: Long Li <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: H. Peter Anvin <[email protected]> Signed-off-by: Wei Liu <[email protected]>
This commit is contained in:
@@ -199,7 +199,7 @@ static void hv_hvcrash_ctxt_save(void)
|
||||
{
|
||||
struct hv_crash_ctxt *ctxt = &hv_crash_ctxt;
|
||||
|
||||
asm volatile("movq %%rsp,%0" : "=m"(ctxt->rsp));
|
||||
ctxt->rsp = current_stack_pointer;
|
||||
|
||||
ctxt->cr0 = native_read_cr0();
|
||||
ctxt->cr4 = native_read_cr4();
|
||||
|
||||
Reference in New Issue
Block a user