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:49:04 +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 04/10] x86/hyper-v: fast hypercall implementation

On Wed, May 24, 2017 at 3:03 PM, Vitaly Kuznetsov <vkuznets@...hat.com> wrote:
> Hyper-V supports 'fast' hypercalls when all parameters are passed through
> registers. Implement an inline version of a simpliest of these calls:
> hypercall with one 8-byte input and no output.
>
> Proper hypercall input interface (struct hv_hypercall_input) definition is
> added as well.

> +               u32 hv_status_hi, hv_status_lo;
> +               u32 input1_hi = (u32)(input1 >> 32);
> +               u32 input1_lo = (u32)input1;

Explicit casting is redundant.
Also consider using macros.

> +/* Hypercall interface */
> +union hv_hypercall_input {

Be careful wrt union aliasing.

> +       u64 as_uint64;
> +       struct {
> +               __u32 as_uint32_lo;
> +               __u32 as_uint32_hi;
> +       };
> +       struct {
> +               __u64 code:16;
> +               __u64 fast:1;
> +               __u64 varhead_size:10;
> +               __u64 reserved1:5;
> +               __u64 rep_count:12;
> +               __u64 reserved2:4;
> +               __u64 rep_start:12;
> +               __u64 reserved3:4;
> +       };
> +};

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ