Re: [PATCH 5/6] x86/hyperv: Support hypercalls for TDX guests

From: Dave Hansen
Date: Mon Nov 28 2022 - 10:22:44 EST


On 11/27/22 16:58, Dexuan Cui wrote:
> +u64 hv_tdx_hypercall(u64 control, u64 input_addr, u64 output_addr)
> +{
> + struct tdx_hypercall_args args = { };
> +
> + if (!(control & HV_HYPERCALL_FAST_BIT)) {
> + if (input_addr)
> + input_addr += ms_hyperv.shared_gpa_boundary;
> +
> + if (output_addr)
> + output_addr += ms_hyperv.shared_gpa_boundary;
> + }

This:

>
https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/hypercall-interface

makes it sound like HV_HYPERCALL_FAST_BIT says whether arguments go in
registers (fast) or memory (slow). But this hv_tdx_hypercall() function
looks like it takes addresses only.

*Is* there a register based calling convention to make Hyper-V
hypercalls when running under TDX?

Also, is this the output address manipulation fundamentally different from:

output_addr = cc_mkdec(output_addr);

? Decrypted addresses are the shared ones, right?