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.