From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command Date: Wed, 11 Oct 2017 15:53:39 -0500 Message-ID: <97ed3294-a06a-58da-6531-cb30c7154726@amd.com> References: <20171004131412.13038-13-brijesh.singh@amd.com> <20171007010607.78088-1-brijesh.singh@amd.com> <20171007010607.78088-4-brijesh.singh@amd.com> <20171011170205.qpu677qiqe4ludwm@pd.tnic> <20171011200444.3njniblsvxn2vhl6@pd.tnic> <20171011202836.d3ur3ndrnea25ywi@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: brijesh.singh@amd.com, Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Herbert Xu , Gary Hook , Tom Lendacky , linux-crypto@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Borislav Petkov Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org 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