lkml.org 
[lkml]   [2017]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 04/10] x86/hyper-v: fast hypercall implementation
On Wed, May 24, 2017 at 3:03 PM, Vitaly Kuznetsov <vkuznets@redhat.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

\
 
 \ /
  Last update: 2017-05-27 19:50    [W:0.241 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site