lkml.org 
[lkml]   [2020]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [EXTERNAL] Re: [PATCH] x86/Hyper-V: Support for free page reporting
Date
From: Sunil Muthuswamy <sunilmut@microsoft.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

\
 
 \ /
  Last update: 2020-05-23 02:40    [W:0.027 / U:3.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site