Re: [PATCH v15 04/13] x86/sev: Change TSC MSR behavior for Secure TSC enabled guests

From: Tom Lendacky
Date: Wed Dec 11 2024 - 17:03:21 EST




On 12/11/24 13:00, Borislav Petkov wrote:
> On Tue, Dec 10, 2024 at 08:29:31AM -0600, Tom Lendacky wrote:
>>> This is changing the behavior for SEV-ES and SNP guests(non SECURE_TSC), TSC MSR
>>> reads are converted to RDTSC. This is a good optimization. But just wanted to
>>> bring up the subtle impact.
>>
>> Right, I think it should still flow through the GHCB MSR request for
>> non-Secure TSC guests.
>
> Why?
>
> I'm trying to think of a reason but I'm getting confused by what needs to
> happen where and when... :-\

It could be any reason... maybe the hypervisor wants to know when this
MSR used in order to tell the guest owner to update their code. Writing
to or reading from that MSR is not that common, so I would think we want
to keep the same behavior that has been in effect.

But if we do want to make this change, maybe do it separate from the
Secure TSC series since it alters the behavior of SEV-ES guests and
SEV-SNP guests without Secure TSC.

Thanks,
Tom

>