From patchwork Sat Oct 7 14:20:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 9991309 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29F3560364 for ; Sat, 7 Oct 2017 14:21:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 189ED2897B for ; Sat, 7 Oct 2017 14:21:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AB7528A86; Sat, 7 Oct 2017 14:21:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81E0D2897B for ; Sat, 7 Oct 2017 14:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751027AbdJGOU6 (ORCPT ); Sat, 7 Oct 2017 10:20:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:55790 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750929AbdJGOU5 (ORCPT ); Sat, 7 Oct 2017 10:20:57 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 83A1AAAB6; Sat, 7 Oct 2017 14:20:55 +0000 (UTC) Date: Sat, 7 Oct 2017 16:20:28 +0200 From: Borislav Petkov To: Brijesh Singh Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Herbert Xu , Gary Hook , Tom Lendacky , linux-crypto@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Part2 PATCH v5.1 12.2/31] crypto: ccp: Define SEV userspace ioctl and command id Message-ID: <20171007142010.6cnkeyywbitk6u73@pd.tnic> References: <20171004131412.13038-13-brijesh.singh@amd.com> <20171007010607.78088-1-brijesh.singh@amd.com> <20171007010607.78088-2-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171007010607.78088-2-brijesh.singh@amd.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Oct 06, 2017 at 08:06:00PM -0500, Brijesh Singh wrote: > Add a include file which defines the ioctl and command id used for > issuing SEV platform management specific commands. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav Petkov > Cc: Herbert Xu > Cc: Gary Hook > Cc: Tom Lendacky > Cc: linux-crypto@vger.kernel.org > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Brijesh Singh > --- > include/uapi/linux/psp-sev.h | 115 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 115 insertions(+) > create mode 100644 include/uapi/linux/psp-sev.h First of all, thanks for splitting the patch - it is much easier to review this way. Then, this patch should be 12.1, i.e., the first of the split because otherwise the previous one - which should be the next - fails building due to drivers/crypto/ccp/psp-dev.c:26:32: fatal error: uapi/linux/psp-sev.h: No such file or directory #include ^ Just swap them in their order. Also, those SEV commands should be __packed, see below. With that addressed: Reviewed-by: Borislav Petkov diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h index a385bf2b8d2a..b63e116f18c1 100644 --- a/include/uapi/linux/psp-sev.h +++ b/include/uapi/linux/psp-sev.h @@ -53,7 +53,7 @@ struct sev_user_data_status { __u32 config; /* Out */ __u8 build; /* Out */ __u32 guest_count; /* Out */ -}; +} __packed; /** * struct sev_user_data_pek_csr - PEK_CSR command parameters @@ -64,7 +64,7 @@ struct sev_user_data_status { struct sev_user_data_pek_csr { __u64 address; /* In */ __u32 length; /* In/Out */ -}; +} __packed; /** * struct sev_user_data_cert_import - PEK_CERT_IMPORT command parameters @@ -79,7 +79,7 @@ struct sev_user_data_pek_cert_import { __u32 pek_cert_len; /* In */ __u64 oca_cert_address; /* In */ __u32 oca_cert_len; /* In */ -}; +} __packed; /** * struct sev_user_data_pdh_cert_export - PDH_CERT_EXPORT command parameters @@ -94,7 +94,7 @@ struct sev_user_data_pdh_cert_export { __u32 pdh_cert_len; /* In/Out */ __u64 cert_chain_address; /* In */ __u32 cert_chain_len; /* In/Out */ -}; +} __packed; /** * struct sev_issue_cmd - SEV ioctl parameters @@ -107,7 +107,7 @@ struct sev_issue_cmd { __u32 cmd; /* In */ __u64 data; /* In */ __u32 error; /* Out */ -}; +} __packed; #define SEV_IOC_TYPE 'S' #define SEV_ISSUE_CMD _IOWR(SEV_IOC_TYPE, 0x0, struct sev_issue_cmd)