From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: Re: [PATCH v10 26/28] qmp: add query-sev-capabilities command Date: Mon, 5 Mar 2018 11:35:10 -0600 Message-ID: <0cd852ce-33cf-379d-9c71-bad6fc19a8a2@amd.com> References: <20180228211028.83970-1-brijesh.singh@amd.com> <20180228211028.83970-27-brijesh.singh@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: "Edgar E. Iglesias" , Peter Maydell , brijesh.singh@amd.com, Eduardo Habkost , kvm@vger.kernel.org, "Michael S. Tsirkin" , Marcel Apfelbaum , Markus Armbruster , Stefan Hajnoczi , Peter Crosthwaite , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Christian Borntraeger , Alexander Graf , Paolo Bonzini , Cornelia Huck , Thomas Lendacky , Borislav Petkov , Bruce Rogers To: Eric Blake , qemu-devel@nongnu.org Return-path: In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On 03/01/2018 02:13 PM, Eric Blake wrote: > On 02/28/2018 03:10 PM, Brijesh Singh wrote: >> The command can be used by libvirt to query the SEV capabilities. >> >> Cc: "Daniel P. Berrang=C3=A9" >> Cc: "Dr. David Alan Gilbert" >> Cc: Markus Armbruster >> Signed-off-by: Brijesh Singh >> --- >> =C2=A0 monitor.c=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 7 +++++++ >> =C2=A0 qapi-schema.json=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 42 +++++++++++++= +++++++++++++++++++++++++++++ >> =C2=A0 target/i386/monitor.c |=C2=A0 5 +++++ >> =C2=A0 3 files changed, 54 insertions(+) >=20 > And another rebase victim. >=20 >=20 I will wait for couple of days for more feedback then rebase the series. >> +## >> +# @query-sev-capabilities: >> +# >> +# This command is used to get the SEV capabilities and supported on AMD >=20 > grammar suggestion: s/capabilities and/capabilities, and is/ >=20 >> +# X86 platform only. >=20 > s/platform/platforms/ >=20 Will fix it. >> +# >> +# Returns: a list of SevCapability objects. >=20 > This says it returns a list of objects... >=20 Earlier I thought we may need list but we really need one element. I=20 will fix it. >> +# >> +# Since: 2.12 >> +# >> +# Example: >> +# >> +# -> { "execute": "query-sev-capabilities" } >=20 > ...but this says it returns a single object. >=20 >> +# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", >> +#=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=C2=A0=C2=A0=C2=A0=C2=A0 "cbitpos": 47, "reduced-phys-bits": 5}} >> +# >> +## >> +{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' } >> diff --git a/target/i386/monitor.c b/target/i386/monitor.c >> index 577d50eebaaa..1b55dd0fff88 100644 >> --- a/target/i386/monitor.c >> +++ b/target/i386/monitor.c >> @@ -737,3 +737,8 @@ SevLaunchMeasureInfo=20 >> *qmp_query_sev_launch_measure(Error **errp) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return info; >> =C2=A0 } >> + >> +SevCapability *qmp_query_sev_capabilities(Error **errp) >> +{ >> +=C2=A0=C2=A0=C2=A0 return NULL; >=20 > Should call error_setg() before returning NULL. >=20 Later in the patches this function gets filled with capability call and=20 we set the error before returning NULL. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esu1I-00023g-8e for qemu-devel@nongnu.org; Mon, 05 Mar 2018 12:35:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esu1E-00080S-PN for qemu-devel@nongnu.org; Mon, 05 Mar 2018 12:35:28 -0500 Received: from mail-sn1nam01on0074.outbound.protection.outlook.com ([104.47.32.74]:54080 helo=NAM01-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 1esu1E-000804-Em for qemu-devel@nongnu.org; Mon, 05 Mar 2018 12:35:24 -0500 References: <20180228211028.83970-1-brijesh.singh@amd.com> <20180228211028.83970-27-brijesh.singh@amd.com> From: Brijesh Singh Message-ID: <0cd852ce-33cf-379d-9c71-bad6fc19a8a2@amd.com> Date: Mon, 5 Mar 2018 11:35:10 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v10 26/28] qmp: add query-sev-capabilities 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 03/01/2018 02:13 PM, Eric Blake wrote: > On 02/28/2018 03:10 PM, Brijesh Singh wrote: >> The command can be used by libvirt to query the SEV capabilities. >> >> Cc: "Daniel P. Berrang=C3=A9" >> Cc: "Dr. David Alan Gilbert" >> Cc: Markus Armbruster >> Signed-off-by: Brijesh Singh >> --- >> =C2=A0 monitor.c=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 7 +++++++ >> =C2=A0 qapi-schema.json=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 42 +++++++++++++= +++++++++++++++++++++++++++++ >> =C2=A0 target/i386/monitor.c |=C2=A0 5 +++++ >> =C2=A0 3 files changed, 54 insertions(+) >=20 > And another rebase victim. >=20 >=20 I will wait for couple of days for more feedback then rebase the series. >> +## >> +# @query-sev-capabilities: >> +# >> +# This command is used to get the SEV capabilities and supported on AMD >=20 > grammar suggestion: s/capabilities and/capabilities, and is/ >=20 >> +# X86 platform only. >=20 > s/platform/platforms/ >=20 Will fix it. >> +# >> +# Returns: a list of SevCapability objects. >=20 > This says it returns a list of objects... >=20 Earlier I thought we may need list but we really need one element. I=20 will fix it. >> +# >> +# Since: 2.12 >> +# >> +# Example: >> +# >> +# -> { "execute": "query-sev-capabilities" } >=20 > ...but this says it returns a single object. >=20 >> +# <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", >> +#=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=C2=A0=C2=A0=C2=A0=C2=A0 "cbitpos": 47, "reduced-phys-bits": 5}} >> +# >> +## >> +{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability' } >> diff --git a/target/i386/monitor.c b/target/i386/monitor.c >> index 577d50eebaaa..1b55dd0fff88 100644 >> --- a/target/i386/monitor.c >> +++ b/target/i386/monitor.c >> @@ -737,3 +737,8 @@ SevLaunchMeasureInfo=20 >> *qmp_query_sev_launch_measure(Error **errp) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return info; >> =C2=A0 } >> + >> +SevCapability *qmp_query_sev_capabilities(Error **errp) >> +{ >> +=C2=A0=C2=A0=C2=A0 return NULL; >=20 > Should call error_setg() before returning NULL. >=20 Later in the patches this function gets filled with capability call and=20 we set the error before returning NULL.