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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 27 May 2017 20:46:30 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:     devel@...uxdriverproject.org, "x86@...nel.org" <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Haiyang Zhang <haiyangz@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Jork Loeser <Jork.Loeser@...rosoft.com>,
        Simon Xiao <sixiao@...rosoft.com>,
        Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH v4 03/10] x86/hyper-v: make hv_do_hypercall() inline

On Wed, May 24, 2017 at 3:03 PM, Vitaly Kuznetsov <vkuznets@...hat.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.

> +       u32 control_hi = control >> 32;
> +       u32 control_lo = control & 0xFFFFFFFF;
> +       u32 input_address_hi = input_address >> 32;
> +       u32 input_address_lo = input_address & 0xFFFFFFFF;
> +       u32 output_address_hi = output_address >> 32;
> +       u32 output_address_lo = output_address & 0xFFFFFFFF;

Yes, I have noticed it was in older code, but see, all conjunctions
above are redundant.

Besides that, you may consider to use upper_32_bits() / lower_32_bits() macros.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ