lkml.org 
[lkml]   [2022]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 5/6] x86/hyperv: Support hypercalls for TDX guests
From
On 11/28/22 11:03, Dexuan Cui wrote:
...
> u64 hv_tdx_hypercall(u64 control, u64 param1, u64 param2)
> {
> struct tdx_hypercall_args args = { };
>
> if (!(control & HV_HYPERCALL_FAST_BIT)) {
> if (param1)
> param1 = cc_mkdec(param1);
>
> if (param2)
> param2 = cc_mkdec(param2);
> }
>
> args.r10 = control;
> args.rdx = param1;
> args.r8 = param2;
>
> (void)__tdx_hypercall(&args, TDX_HCALL_HAS_OUTPUT);
>
> return args.r11;
> }

I still think this is problematic.

The cc_mkdec() should be done on the parameters when the code still
*knows* that they are addresses.

How do we know, for instance, that no hypercall using this interface
will *ever* take the 0x0 physical address as an argument?


\
 
 \ /
  Last update: 2022-11-28 20:12    [W:0.104 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site