lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211025112033.eqelx54p2dmlhykw@liuwe-devbox-debian-v2>
Date:   Mon, 25 Oct 2021 11:20:33 +0000
From:   Wei Liu <wei.liu@...nel.org>
To:     Tianyu Lan <ltykernel@...il.com>
Cc:     Borislav Petkov <bp@...en8.de>, kys@...rosoft.com,
        haiyangz@...rosoft.com, sthemmin@...rosoft.com, wei.liu@...nel.org,
        decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
        x86@...nel.org, hpa@...or.com, dave.hansen@...ux.intel.com,
        luto@...nel.org, peterz@...radead.org, davem@...emloft.net,
        kuba@...nel.org, gregkh@...uxfoundation.org, arnd@...db.de,
        brijesh.singh@....com, jroedel@...e.de, Tianyu.Lan@...rosoft.com,
        thomas.lendacky@....com, rientjes@...gle.com, pgonda@...gle.com,
        akpm@...ux-foundation.org, kirill.shutemov@...ux.intel.com,
        rppt@...nel.org, saravanand@...com, aneesh.kumar@...ux.ibm.com,
        hannes@...xchg.org, tj@...nel.org, michael.h.kelley@...rosoft.com,
        linux-arch@...r.kernel.org, linux-hyperv@...r.kernel.org,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        vkuznets@...hat.com, konrad.wilk@...cle.com, hch@....de,
        robin.murphy@....com, joro@...tes.org, parri.andrea@...il.com,
        dave.hansen@...el.com
Subject: Re: [PATCH V8 5/9] x86/sev-es: Expose sev_es_ghcb_hv_call() to call
 ghcb hv call out of sev code

On Fri, Oct 22, 2021 at 09:39:48PM +0800, Tianyu Lan wrote:
> On 10/22/2021 12:22 AM, Borislav Petkov wrote:
> > On Thu, Oct 21, 2021 at 11:41:05AM -0400, Tianyu Lan wrote:
> > > diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
> > > index ea9abd69237e..368ed36971e3 100644
> > > --- a/arch/x86/kernel/sev-shared.c
> > > +++ b/arch/x86/kernel/sev-shared.c
> > > @@ -124,10 +124,9 @@ static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt
> > >   	return ES_VMM_ERROR;
> > >   }
> > > -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 sev_es_ghcb_hv_call(struct ghcb *ghcb, bool set_ghcb_msr,
> > > +				   struct es_em_ctxt *ctxt, u64 exit_code,
> > > +				   u64 exit_info_1, u64 exit_info_2)
> > >   {
> > >   	/* Fill in protocol and format specifiers */
> > >   	ghcb->protocol_version = GHCB_PROTOCOL_MAX;
> > > @@ -137,7 +136,15 @@ static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
> > >   	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));
> > > +	/*
> > > +	 * Hyper-V unenlightened guests use a paravisor for communicating and
> > > +	 * GHCB pages are being allocated and set up by that paravisor. Linux
> > > +	 * should not change ghcb page pa in such case and so add set_ghcb_msr
> > 
> > "... not change the GHCB page's physical address."
> > 
> > Remove the "so add... " rest.
> > 
> > Otherwise, LGTM.
> > 
> > Do you want me to take it through the tip tree?
> 
> Yes, please and this patch is based on the your clean up patch which is
> already in the tip sev branch.

Borislav, please take the whole series via the tip tree if possible.
That's perhaps the easiest thing for both of us because the rest of the
series depends on this patch. Or else I will have to base hyperv-next on
the tip tree once you merge this patch.

Let me know what you think.

Thanks,
Wei.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ