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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 23 May 2020 00:40:24 +0000
From:   Michael Kelley <mikelley@...rosoft.com>
To:     Sunil Muthuswamy <sunilmut@...rosoft.com>,
        Wei Liu <wei.liu@...nel.org>,
        Alexander Duyck <alexander.h.duyck@...ux.intel.com>
CC:     KY Srinivasan <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Wei Liu <liuwe@...rosoft.com>,
        Tianyu Lan <Tianyu.Lan@...rosoft.com>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [EXTERNAL] Re: [PATCH] x86/Hyper-V: Support for free page
 reporting

From: Sunil Muthuswamy <sunilmut@...rosoft.com> Sent: Friday, May 22, 2020 9:40 AM
> 
> > > +	if (hv_do_hypercall(HV_EXT_CALL_QUERY_CAPABILITIES, NULL, cap) ==
> > > +	    HV_STATUS_SUCCESS)
> >
> > You're using the input page as the output parameter. Ideally we should
> > introduce hyperv_pcpu_output_arg page, but that would waste one page per
> > cpu just for this one call.
> >
> > So for now I think this setup is fine, but I would like to add the
> > following comment.
> >
> >     /*
> >      * Repurpose the input_arg page to accept output from Hyper-V for
> >      * now because this is the only call that needs output from the
> >      * hypervisor. It should be fixed properly by introducing an
> >      * output_arg page once we have more places that require output.
> >      */
> 
> Sounds good. Will add it in v2.
> 

Note that the only real requirement for the output parameter to hypercalls
is that it not cross a page boundary.  Since '*cap' is only 64-bits, you can
declare it as a static variable or even as a local on the stack.  It will
naturally be aligned  (or can add __aligned(8) to be explicit??), so it won't
cross a page boundary.  Then you can skip using the per-cpu input arg
altogether, along with the associated local_irq_save()/restore().

Michael

Powered by blists - more mailing lists