Re: [PATCH 06/26] x86/tdx: Add MSR support for TDX guests

From: Borislav Petkov
Date: Wed Dec 29 2021 - 06:59:44 EST


On Tue, Dec 14, 2021 at 06:02:44PM +0300, Kirill A. Shutemov wrote:
> +static bool tdx_read_msr_safe(unsigned int msr, u64 *val)
> +{
> + struct tdx_hypercall_output out;
> +
> + /*
> + * Emulate the MSR read via hypercall. More info about ABI
> + * can be found in TDX Guest-Host-Communication Interface
> + * (GHCI), sec titled "TDG.VP.VMCALL<Instruction.RDMSR>".
> + */
> + if (_tdx_hypercall(EXIT_REASON_MSR_READ, msr, 0, 0, 0, &out))
> + return false;
> +
> + *val = out.r11;
> +
> + return true;
> +}
> +
> +static bool tdx_write_msr_safe(unsigned int msr, unsigned int low,

Why the "_safe" suffix?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette