Subject: Re: [PATCH v9 19/23] x86/virt/tdx: Refresh TDX module version after update
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.]

The changelog's "do not refresh the rest of tdx_sysinfo" explanation
is exactly what I asked for on v8 -- thanks.  That's the kind of
non-obvious decision that belongs in the commit message
(Dave_Hansen.txt RULE 1) AND a one-line comment in the code:

  /*
   * Only ->version is refreshed.  Other tdx_sys_info fields are
   * intentionally frozen at boot; KVM and other consumers configured
   * themselves against those values and we don't want a runtime
   * update to silently surface a new feature bit without the
   * consumer having been initialised for it.  See commit log.
   */

> +	/* Shouldn't fail as the update has succeeded. */
> +	ret = get_tdx_sys_info_version(&tdx_sysinfo.version);
> +	WARN_ON_ONCE(ret);

Same pattern as 14/23: WARN_ON_ONCE then continue.  If the metadata
read fails here, `tdx_sysinfo.version` is whatever the failed read
left behind.  At minimum:

  if (WARN_ON_ONCE(ret)) {
      /* version may be inconsistent with the installed module;
       * mark the cache invalid rather than serving stale data */
      memset(&tdx_sysinfo.version, 0, sizeof(tdx_sysinfo.version));
  }

or propagate the error.

Drop of __ro_after_init is called out in the changelog.  Good
(RULE 1).