From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: Re: [PATCH v8 13/28] qmp: add query-sev command Date: Mon, 12 Feb 2018 12:47:57 -0600 Message-ID: <4dca2760-df74-ca42-ca8d-3462c200a715@amd.com> References: <20180212153715.87555-1-brijesh.singh@amd.com> <20180212153715.87555-14-brijesh.singh@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: brijesh.singh@amd.com, Alistair Francis , Christian Borntraeger , Cornelia Huck , "Daniel P . Berrange" , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , "Edgar E. Iglesias" , Eduardo Habkost , kvm@vger.kernel.org, Marcel Apfelbaum , Markus Armbruster , Paolo Bonzini , Peter Crosthwaite , Peter Maydell , Richard Henderson , Stefan Hajnoczi , Thomas Lendacky , Borislav Petkov , qemu-devel@nongnu.org Return-path: Received: from mail-sn1nam02on0043.outbound.protection.outlook.com ([104.47.36.43]:10012 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754052AbeBLSsH (ORCPT ); Mon, 12 Feb 2018 13:48:07 -0500 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 2/12/18 11:27 AM, Eric Blake wrote: > On 02/12/2018 09:37 AM, Brijesh Singh wrote: >> The QMP query command can used to retrieve the SEV information when >> memory encryption is enabled on AMD platform. >> >> Cc: "Daniel P. Berrangé" >> Cc: "Dr. David Alan Gilbert" >> Cc: Markus Armbruster >> Signed-off-by: Brijesh Singh >> --- > >> +# @SevInfo: >> +# >> +# Information about Secure Encrypted Virtualization (SEV) support >> +# >> +# @enabled: true if SEV is active >> +# >> +# @api-major: SEV API major version >> +# >> +# @api-minor: SEV API minor version >> +# >> +# @build-id: SEV FW build id >> +# >> +# @policy: SEV policy value >> +# >> +# @state: SEV guest state > > Is there a finite list of guest states? > Yes, the list is finite. include/sysemu/sev.h defines the enum typedef enum {     SEV_STATE_UNINIT = 0,     SEV_STATE_LUPDATE,     SEV_STATE_SECRET,     SEV_STATE_RUNNING,     SEV_STATE_SUPDATE,     SEV_STATE_RUPDATE,     SEV_STATE_MAX } >> +# >> +# Since: 2.12 >> +## >> +{ 'struct': 'SevInfo', >> +    'data': { 'enabled': 'bool', >> +              'api-major': 'uint8', >> +              'api-minor' : 'uint8', >> +              'build-id' : 'uint8', >> +              'policy' : 'uint32', >> +              'state' : 'str' > > If so, this should be an enum type listing those possible states, > rather than an open-coded 'str' that can hold anything. > If the preference is to return enum, then I can convert the state to return enum instead of string. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elJ99-0007Gr-On for qemu-devel@nongnu.org; Mon, 12 Feb 2018 13:48:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elJ96-0003Wz-82 for qemu-devel@nongnu.org; Mon, 12 Feb 2018 13:48:11 -0500 Received: from mail-sn1nam02on0047.outbound.protection.outlook.com ([104.47.36.47]:7402 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elJ96-0003Vq-0L for qemu-devel@nongnu.org; Mon, 12 Feb 2018 13:48:08 -0500 References: <20180212153715.87555-1-brijesh.singh@amd.com> <20180212153715.87555-14-brijesh.singh@amd.com> From: Brijesh Singh Message-ID: <4dca2760-df74-ca42-ca8d-3462c200a715@amd.com> Date: Mon, 12 Feb 2018 12:47:57 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH v8 13/28] qmp: add query-sev command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: brijesh.singh@amd.com, Alistair Francis , Christian Borntraeger , Cornelia Huck , "Daniel P . Berrange" , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , "Edgar E. Iglesias" , Eduardo Habkost , kvm@vger.kernel.org, Marcel Apfelbaum , Markus Armbruster , Paolo Bonzini , Peter Crosthwaite , Peter Maydell , Richard Henderson , Stefan Hajnoczi , Thomas Lendacky , Borislav Petkov , Alexander Graf , Bruce Rogers On 2/12/18 11:27 AM, Eric Blake wrote: > On 02/12/2018 09:37 AM, Brijesh Singh wrote: >> The QMP query command can used to retrieve the SEV information when >> memory encryption is enabled on AMD platform. >> >> Cc: "Daniel P. Berrang=C3=A9" >> Cc: "Dr. David Alan Gilbert" >> Cc: Markus Armbruster >> Signed-off-by: Brijesh Singh >> --- > >> +# @SevInfo: >> +# >> +# Information about Secure Encrypted Virtualization (SEV) support >> +# >> +# @enabled: true if SEV is active >> +# >> +# @api-major: SEV API major version >> +# >> +# @api-minor: SEV API minor version >> +# >> +# @build-id: SEV FW build id >> +# >> +# @policy: SEV policy value >> +# >> +# @state: SEV guest state > > Is there a finite list of guest states? > Yes, the list is finite. include/sysemu/sev.h defines the enum typedef enum { =C2=A0=C2=A0=C2=A0 SEV_STATE_UNINIT =3D 0, =C2=A0=C2=A0=C2=A0 SEV_STATE_LUPDATE, =C2=A0=C2=A0=C2=A0 SEV_STATE_SECRET, =C2=A0=C2=A0=C2=A0 SEV_STATE_RUNNING, =C2=A0=C2=A0=C2=A0 SEV_STATE_SUPDATE, =C2=A0=C2=A0=C2=A0 SEV_STATE_RUPDATE, =C2=A0=C2=A0=C2=A0 SEV_STATE_MAX } >> +# >> +# Since: 2.12 >> +## >> +{ 'struct': 'SevInfo', >> +=C2=A0=C2=A0=C2=A0 'data': { 'enabled': 'bool', >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'api-major': 'uint8', >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'api-minor' : 'uint8', >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'build-id' : 'uint8', >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'policy' : 'uint32', >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 'state' : 'str' > > If so, this should be an enum type listing those possible states, > rather than an open-coded 'str' that can hold anything. > If the preference is to return enum, then I can convert the state to return enum instead of string.