[PATCH v5 03/10] x86/hyper-v: make hv_do_hypercall() inline

Andy Shevchenko andy.shevchenko at gmail.com
Tue May 30 16:29:46 UTC 2017


On Tue, May 30, 2017 at 2:34 PM, Vitaly Kuznetsov <vkuznets at redhat.com> wrote:
> We have only three call sites for hv_do_hypercall() and we're going to
> change HVCALL_SIGNAL_EVENT to doing fast hypercall so we can inline this
> function for optimization.
>
> Hyper-V top level functional specification states that r9-r11 registers
> and flags may be clobbered by the hypervisor during hypercall and with
> inlining this is somewhat important, add the clobbers.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets at redhat.com>
> Acked-by: K. Y. Srinivasan <kys at microsoft.com>

>  #if IS_ENABLED(CONFIG_HYPERV)
>  extern struct clocksource *hyperv_cs;
> +extern void *hv_hypercall_pg;
> +
> +static inline u64 hv_do_hypercall(u64 control, void *input, void *output)
> +{

> +       u64 input_address = (input) ? virt_to_phys(input) : 0;
> +       u64 output_address = (output) ? virt_to_phys(output) : 0;

Yes, I see this in original code, but first pairs of parens are
redundant (it's not a macro anyway).

> +#ifdef CONFIG_X86_64
> +

Swap those lines.

-- 
With Best Regards,
Andy Shevchenko


More information about the devel mailing list