lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 04/30] x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions
On 2/24/22 07:56, Kirill A. Shutemov wrote:
> + tdcall
> +
> + /*
> + * TDVMCALL leaf does not suppose to fail. If it fails something
> + * is horribly wrong with TDX module. Stop the world.
> + */
> + testq %rax, %rax
> + jne .Lpanic

This should be:

"A TDVMCALL is not supposed to fail."

I also wish this was mentioning something about the difference between a
failure and return code.

/*
* %rax==0 indicates a failure of the TDVMCALL mechanism itself
* and that something has gone horribly wrong with the TDX
* module.
*
* The return status of the hypercall operation is separate
* (in %r10). Hypercall errors are a part of normal operation
* and are handled by callers.
*/

I've been confused by this exact thing multiple times over the months
that I've been looking at this code. I think it deserves a good comment.

\
 
 \ /
  Last update: 2022-02-24 18:06    [W:0.412 / U:1.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site