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;