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