Re: [kvm-unit-tests PATCH v2 13/17] x86 AMD SEV-ES: Check SEV-ES status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 27, 2021 at 7:56 AM Tom Lendacky <thomas.lendacky@xxxxxxx> wrote:
>
> On 8/26/21 10:12 PM, Zixuan Wang wrote:
> > +bool amd_sev_es_enabled(void)
> > +{
> > +     static bool sev_es_enabled;
> > +     static bool initialized = false;
> > +
> > +     if (!initialized) {
> > +             sev_es_enabled = false;
> > +             initialized = true;
> > +
> > +             if (!amd_sev_enabled()) {
> > +                     return sev_es_enabled;
> > +             }
> > +
> > +             /* Test if SEV-ES is enabled */
> > +             if (!(rdmsr(MSR_SEV_STATUS) & SEV_ES_ENABLED_MASK)) {
> > +                     return sev_es_enabled;
> > +             }
> > +
> > +             sev_es_enabled = true;
>
> Same comment here as previous for the amd_sev_enabled() function in
> regards to readability.
>
> Thanks,
> Tom

Got it, I will update it in the next version. Thank you for the suggestion!

Best regards,
Zixuan



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux