| From | Paolo Bonzini <> | Subject | Re: [RFC PATCH v2 06/69] KVM: TDX: add a helper function for kvm to call seamcall | Date | Tue, 6 Jul 2021 14:57:37 +0200 |
| |
On 03/07/21 00:04, isaku.yamahata@intel.com wrote: > + > +.Lseamcall: > + seamcall > + jmp .Lseamcall_ret > +.Lspurious_fault: > + call kvm_spurious_fault > +.Lseamcall_ret: > + > + movq (FRAME_OFFSET + 8)(%rsp), %rdi > + testq %rdi, %rdi > + jz 1f > + > + /* If ex is non-NULL, store extra return values into it. */ > + movq %rcx, TDX_SEAM_rcx(%rdi) > + movq %rdx, TDX_SEAM_rdx(%rdi) > + movq %r8, TDX_SEAM_r8(%rdi) > + movq %r9, TDX_SEAM_r9(%rdi) > + movq %r10, TDX_SEAM_r10(%rdi) > + movq %r11, TDX_SEAM_r11(%rdi) > + > +1: > + FRAME_END > + ret > + > + _ASM_EXTABLE(.Lseamcall, .Lspurious_fault)
Please use local labels and avoid unnecessary jmp, for example
1: seamcall movq (FRAME_OFFSET + 8)(%rsp), %rdi testq %rdi, %rdi jz 2f
/* If ex is non-NULL, store extra return values into it. */ movq %rcx, TDX_SEAM_rcx(%rdi) movq %rdx, TDX_SEAM_rdx(%rdi) movq %r8, TDX_SEAM_r8(%rdi) movq %r9, TDX_SEAM_r9(%rdi) movq %r10, TDX_SEAM_r10(%rdi) movq %r11, TDX_SEAM_r11(%rdi) 2: FRAME_END ret 3: /* Probably it helps to write an error code in %rax? */ movq $0x4000000500000000, %rax cmpb $0, kvm_rebooting jne 2b ud2 _ASM_EXTABLE(1b, 3b)
Paolo
|