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

From: Andy Shevchenko
Date: Tue May 30 2017 - 12:29:58 EST


On Tue, May 30, 2017 at 2:34 PM, Vitaly Kuznetsov <vkuznets@xxxxxxxxxx> 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@xxxxxxxxxx>
> Acked-by: K. Y. Srinivasan <kys@xxxxxxxxxxxxx>

> #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