Messages in this thread | | | Date | Sun, 6 Aug 2023 14:25:50 +0300 | From | kirill.shutemov@linux ... | Subject | Re: [PATCH v3 08/12] x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm |
| |
On Wed, Jul 26, 2023 at 11:25:10PM +1200, Kai Huang wrote: > Now the TDX_HYPERCALL asm is basically identical to the TDX_MODULE_CALL > with both '\saved' and '\ret' enabled, with two minor things though: > > 1) The way to restore the structure pointer is different > > The TDX_HYPERCALL uses RCX as spare to restore the structure pointer, > but the TDX_MODULE_CALL assumes no spare register can be used. In other > words, TDX_MODULE_CALL already covers what TDX_HYPERCALL does. > > 2) TDX_MODULE_CALL only clears shared registers for TDH.VP.ENTER > > For this just need to make that code available for the non-host case. > > Thus, remove the TDX_HYPERCALL and reimplement the __tdx_hypercall() > using the TDX_MODULE_CALL. > > Extend the TDX_MODULE_CALL to cover "clear shared registers" for > TDG.VP.VMCALL. Introduce a new __tdcall_saved_ret() to replace the > temporary __tdcall_hypercall(). > > The __tdcall_saved_ret() can also be used for those new TDCALLs which > require more input/output registers than the basic TDCALLs do. > > Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> > Cc: Dave Hansen <dave.hansen@linux.intel.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Suggested-by: Peter Zijlstra <peterz@infradead.org> > Signed-off-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
-- Kiryl Shutsemau / Kirill A. Shutemov
| |