lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command
    From
    Date


    On 10/11/2017 03:45 PM, Brijesh Singh wrote:
    >
    >
    > On 10/11/2017 03:28 PM, Borislav Petkov wrote:
    >> On Wed, Oct 11, 2017 at 03:10:49PM -0500, Brijesh Singh wrote:
    >>> The current 'struct sev_data_status' matches with the firmware names
    >>> and the
    >>> bit fields. Only thing I did was the fields with no name is called as
    >>> "reservedX"
    >>
    >> Ok, I see it. So what you actually wanna do is:
    >>
    >> struct sev_data_status {
    >>          u8 api_major;                           /* Out */
    >>          u8 api_minor;                           /* Out */
    >>          u8 state;                               /* Out */
    >>          u8 flags;                               /* Out */
    >>          u32 config;                             /* Out */
    >>          u32 guest_count;                        /* Out */
    >> } __packed;
    >>
    >
    > OK, if userspace is going to pick bits apart then how about this:
    >
    >  struct sev_data_status {
    >          u8 api_major;                           /* Out */
    >          u8 api_minor;                           /* Out */
    >          u8 state;                               /* Out */
    >          u32 flags;                              /* Out */
    >          u8 build;                               /* Out */
    >          u32 guest_count;                        /* Out */
    >  } __packed;
    >


    BTW, I kept the build name because KVM driver prints some debug
    information like this:

    pr_info_once("SEV: api_major %d api_minor %d build %d\n",
    status->api_major, status->api_minor, status->build);

    Of course, I can modify it to access bit field if we decide to go with
    your recommended structure - thanks

    \
     
     \ /
      Last update: 2017-10-11 22:54    [W:6.022 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site