Re: [RFC PATCH v2 5/6] x86/virt/tdx: Add SEAMCALL wrappers for TDX VM/vCPU field access
From: Dave Hansen
Date: Wed Dec 04 2024 - 15:08:07 EST
On 12/2/24 17:03, Rick Edgecombe wrote:
> +u64 tdh_vp_wr(struct tdx_vp *vp, u64 field, u64 data, u64 mask)
> +{
> + struct tdx_module_args args = {
> + .rcx = tdx_tdvpr_pa(vp),
> + .rdx = field,
> + .r8 = data,
> + .r9 = mask,
> + };
> +
> + return seamcall(TDH_VP_WR, &args);
> +}
> +EXPORT_SYMBOL_GPL(tdh_vp_wr);
There's a bit more tweaking you could _probably_ do here like giving
'field' a real type that means something, probably an enum. But that's
well into nitpicky territory and might not buy anything in practice.
Overall this set looks fine to me. The types are much more safe and
helpers are much more self-explanatory. So, for the series:
Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>