|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 21/22] x86/cpu: report SMX, TXT and SKINIT capabilities
On Thu, Jan 22, 2026 at 04:58:48PM +0100, Jan Beulich wrote:
> On 30.05.2025 15:18, Sergii Dmytruk wrote:
> > --- a/xen/arch/x86/cpu/amd.c
> > +++ b/xen/arch/x86/cpu/amd.c
> > @@ -688,6 +688,21 @@ void amd_log_freq(const struct cpuinfo_x86 *c)
> > #undef FREQ
> > }
> >
> > +void amd_log_skinit(const struct cpuinfo_x86 *c)
> > +{
> > + /*
> > + * Run only on BSP and not during resume to report the capability only
> > once.
> > + */
> > + if ( system_state != SYS_STATE_resume && smp_processor_id() )
> > + return;
>
> Comment and code look to not fit together. DYM
>
> if ( system_state == SYS_STATE_resume || smp_processor_id() )
> return;
>
> ?
>
> [...]
>
> Same here?
Right, thanks for pointing this out, something went wrong when adding
system state check.
> > + cr4_val = read_cr4();
> > + if ( !(cr4_val & X86_CR4_SMXE) )
> > + write_cr4(cr4_val | X86_CR4_SMXE);
> > +
> > + asm volatile ("getsec\n"
> > + : "=a" (getsec_caps)
> > + : "a" (GETSEC_CAPABILITIES), "b" (0) :);
> > +
> > + if ( getsec_caps & GETSEC_CAP_TXT_CHIPSET )
> > + printk("Chipset supports TXT\n");
> > + else
> > + printk("Chipset does not support TXT\n");
> > +
> > + if ( !(cr4_val & X86_CR4_SMXE) )
> > + write_cr4(cr4_val & ~X86_CR4_SMXE);
>
> Move this ahead of the printk()s?
>
> Jan
Makes sense, will do.
Regards
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |