Subject: Re: [PATCH v9 07/23] x86/virt/seamldr: Add a helper to retrieve P-SEAMLDR information
From: Dave Hansen <[email-masked]>
To: [email-masked]

[Draft review generated by x86-maintainer-agent applying Dave_Hansen.txt
 rules to the v9 series.  Strip this banner before sending.]

> +int seamldr_get_info(struct seamldr_info *seamldr_info);

> +int seamldr_get_info(struct seamldr_info *seamldr_info)
> +{
> +	struct tdx_module_args args = {};
> +
> +	/*
> +	 * Use slow_virt_to_phys() since @seamldr_info may be allocated on
> +	 * the stack.
> +	 */
> +	args.rcx = slow_virt_to_phys(seamldr_info);
> +	return seamldr_call(P_SEAMLDR_INFO, &args);
> +}

Tiny naming nit: parameter name `seamldr_info` shadows the type
`struct seamldr_info`.  Call it `info` (or `out`) to make the OUT
parameter obvious and to stop shadowing the type at call sites that
declare a local variable also called `seamldr_info` (e.g. patch 08's
`struct seamldr_info info;` would have to be careful not to reuse
the name).  Dave_Hansen.txt RULE 10.

The slow_virt_to_phys() comment is great (RULE 2).  static_assert on
the 256-byte layout in <asm/seamldr.h> is exactly right (RULE 8).

Reviewed-by: Dave Hansen <[email-masked]>  [with rename]