On Mi 05-06-24 09:07:43, Sean Christopherson wrote: > On Fri, Apr 19, 2024, vsntk18@xxxxxxxxx wrote: > > +static inline void sev_es_wr_ghcb_msr(u64 val) > > +{ > > + wrmsr(MSR_AMD64_SEV_ES_GHCB, val); > > +} > > + > > +static inline u64 sev_es_rd_ghcb_msr(void) > > +{ > > + return rdmsr(MSR_AMD64_SEV_ES_GHCB); > > +} > > These are silly, they just add a layer of obfuscation. It's just as easy to do: > > wrmsr(MSR_AMD64_SEV_ES_GHCB, __pa(ghcb)); > > > + > > + > > Extra newline. > Ok, I will address these two things in the next version. > > +static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, > > + struct es_em_ctxt *ctxt, > > + u64 exit_code, u64 exit_info_1, > > + u64 exit_info_2) > > +{ > > + enum es_result ret; > > + > > + /* Fill in protocol and format specifiers */ > > + ghcb->version = GHCB_VERSION; > > + ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; > > + > > + ghcb_set_sw_exit_code(ghcb, exit_code); > > + ghcb_set_sw_exit_info_1(ghcb, exit_info_1); > > + ghcb_set_sw_exit_info_2(ghcb, exit_info_2); > > + > > + sev_es_wr_ghcb_msr(__pa(ghcb)); -- Vasant Karasulli Kernel generalist www.suse.com<http://www.suse.com> [https://www.suse.com/assets/img/social-platforms-suse-logo.png]<http://www.suse.com/> SUSE - Open Source Solutions for Enterprise Servers & Cloud<http://www.suse.com/> Modernize your infrastructure with SUSE Linux Enterprise servers, cloud technology for IaaS, and SUSE's software-defined storage. www.suse.com