-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the TODO TDX for the build complaints #566
Comments
(Migrated from internal issue #1258) yjiang5 on Oct 30: Please check microsoft/OHCL-Linux-Kernel#23 for the discussion there. |
The code: #define TDCALL_ASM ".byte 0x66,0x0f,0x01,0xcc" /* TODO TDX: Confirm noinline produces the right asm for saving register state */
...
|
Yunhong's suggestion of using UNWIND_HINT_SAVE/UNWIND_HINT_RESTORE in the linked discussion microsoft/OHCL-Linux-Kernel#23: Based on his suggestion, will the below code change resolve the issue? |
From discussion with @yamahata: Isaku: We need mov %rsp, %rbp for stack unwinder. Isaku suggests using regular assembly in a .S file. It calls FRAME_BEING/FRAME_END macros to setup/save/restore the stack frame. Isaku: You need to twist it for TDG.VP.ENTER. We have an implementation for TDH.VP.ENTER. The existing TDCALL doesn't save/restore necessary GPRs. the calling convention of TDG.VP.ENTER is different. @peterfang please confirm whether TDG.VP.ENTER modifies RBP |
Isaku: “cc”: This is not required because RFLAGS is preserved. |
Some options are:
@chris-oo please suggest which option to use. Below are objdump outputs for #2 Original code as it is now: With the UNWIND_HINT_SAVE and UNWIND_HINT_RESTORE macros: |
It seems like this issue depends on the other one we have about perhaps moving this return call to a separate asm file? |
Yes, the warning is about the push/pop RBP. We can either call the UNWIND_HINT_SAVE/UNWIND_HINT_RESTORE macros as shown in the code above or move the code to a separate .S file where the stack frame setup would be clearer to the compiler. |
On drivers/hv/mshv_vtl_main.c: mshv_vtl_return_tdx(), there is TODO TDX for build complaints as below.
17656 + /* TODO TDX: pushq popq causes some build complaints unclear why
when mshv uses
17657 + it also. alignment checks even though tdcall has no alignment
The building complain are:
drivers/hv/mshv_vtl_main.o: warning: objtool: mshv_vtl_return_tdx+0x22d: call without frame pointer save/setup
drivers/hv/mshv_vtl_main.o: warning: objtool: mshv_vtl_switch_to_vtl0_irqoff+0x2b4: call without frame pointer save/setup
The text was updated successfully, but these errors were encountered: