Re: [PATCH v7 10/16] x86/sev: Add Secure TSC support for SNP guests

From: Paolo Bonzini
Date: Thu Feb 01 2024 - 10:48:50 EST


On Thu, Feb 1, 2024 at 4:46 PM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
>
> On Wed, Dec 20, 2023 at 4:16 PM Nikunj A Dadhania <nikunj@xxxxxxx> wrote:
>
> > + /* Setting Secure TSC parameters */
> > + if (cpu_feature_enabled(X86_FEATURE_SNP_SECURE_TSC)) {
> > + vmsa->tsc_scale = snp_tsc_scale;
> > + vmsa->tsc_offset = snp_tsc_offset;
> > + }
>
> This needs to use guest_cpu_has, otherwise updating the hypervisor or
> processor will change the initial VMSA and any measurement derived
> from there.
>
> In fact, the same issue exists for DEBUG_SWAP and I will shortly post
> a series to allow enabling/disabling DEBUG_SWAP per-VM, so that
> updating the kernel does not break existing measurements.

Nevermind, I keep confusing guest and host-side patches.

/me goes in the corner.

Paolo