Re: [PATCH v2 2/8] x86/mtrr: support setting MTRR state for software defined MTRRs

From: Kirill A. Shutemov
Date: Mon Feb 13 2023 - 19:45:25 EST


On Mon, Feb 13, 2023 at 03:07:07PM +0100, Juergen Gross wrote:
> > So this here needs to check:
> >
> > if (!cpu_feature_enabled(X86_FEATURE_HYPERVISOR) &&
> > !(cpu_feature_enabled(X86_FEATURE_SEV_SNP) ||
> > cpu_feature_enabled(X86_FEATURE_XENPV))) {
> > WARN_ON_ONCE(1);
> > return;
> > }
> >
> > as we don't want this to be called somewhere or by something else.
>
> Wouldn't !cpu_feature_enabled(X86_FEATURE_HYPERVISOR) be enough?
>
> I'm not sure we won't need that for TDX guests, too.

TDX guests are covered by X86_FEATURE_HYPERVISOR.


--
Kiryl Shutsemau / Kirill A. Shutemov