Re: [PATCH v15 06/13] x86/sev: Prevent GUEST_TSC_FREQ MSR interception for Secure TSC enabled guests

From: Borislav Petkov
Date: Tue Dec 17 2024 - 05:58:15 EST


On Thu, Dec 12, 2024 at 10:23:01AM +0530, Nikunj A. Dadhania wrote:
> @@ -1477,19 +1480,13 @@ static enum es_result vc_handle_msr(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
> case MSR_SVSM_CAA:
> return __vc_handle_msr_caa(regs, write);
> case MSR_IA32_TSC:
> - return __vc_handle_msr_tsc(regs, write);
> + case MSR_AMD64_GUEST_TSC_FREQ:
> + if (sev_status & MSR_AMD64_SNP_SECURE_TSC)
> + return __vc_handle_msr_tsc(regs, write);

Now push that conditional inside the function too.

--
Regards/Gruss,
Boris.

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