From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH v6 13/23] hmp: display memory encryption support in 'info kvm' Date: Wed, 31 Jan 2018 18:43:47 +0100 Message-ID: <87r2q5vs8c.fsf@dusky.pond.sub.org> References: <20180129174132.108925-1-brijesh.singh@amd.com> <20180129174132.108925-14-brijesh.singh@amd.com> Mime-Version: 1.0 Content-Type: text/plain Cc: qemu-devel@nongnu.org, "Edgar E. Iglesias" , Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Tom Lendacky , Stefan Hajnoczi , "Michael S. Tsirkin" , Richard Henderson , "Dr. David Alan Gilbert" , Paolo Bonzini To: Brijesh Singh Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbeAaRnv (ORCPT ); Wed, 31 Jan 2018 12:43:51 -0500 In-Reply-To: <20180129174132.108925-14-brijesh.singh@amd.com> (Brijesh Singh's message of "Mon, 29 Jan 2018 11:41:22 -0600") Sender: kvm-owner@vger.kernel.org List-ID: Brijesh Singh writes: > update 'info kvm' to display the memory encryption support. > > (qemu) info kvm > kvm support: enabled > memory encryption: disabled > > Cc: "Dr. David Alan Gilbert" > Cc: Eric Blake > Cc: Markus Armbruster > Cc: Paolo Bonzini > Signed-off-by: Brijesh Singh > --- > hmp.c | 2 ++ > qapi-schema.json | 5 ++++- > qmp.c | 1 + > 3 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/hmp.c b/hmp.c > index 056bf70cf1e2..6ceb6b30af75 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -88,6 +88,8 @@ void hmp_info_kvm(Monitor *mon, const QDict *qdict) > monitor_printf(mon, "kvm support: "); > if (info->present) { > monitor_printf(mon, "%s\n", info->enabled ? "enabled" : "disabled"); > + monitor_printf(mon, "memory encryption: %s\n", > + info->mem_encryption ? "enabled" : "disabled"); > } else { > monitor_printf(mon, "not compiled\n"); > } > diff --git a/qapi-schema.json b/qapi-schema.json > index 5c06745c7927..2046c96669bf 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -314,9 +314,12 @@ > # > # @present: true if KVM acceleration is built into this executable > # > +# @mem-encryption: true if Memory Encryption is active (since 2.12) > +# > # Since: 0.14.0 > ## > -{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} } > +{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool', > + 'mem-encryption' : 'bool'} } This extends QMP's query-kvm. Your commit message claims the patch affects only HMP. Needs fixing. The cleanest way is to split the patch into its QMP part (hunks #2 and #3) and its HMP part (hunk #1). > > ## > # @query-kvm: > diff --git a/qmp.c b/qmp.c > index 52cfd2d81c0f..3a527bc8c39c 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -69,6 +69,7 @@ KvmInfo *qmp_query_kvm(Error **errp) > > info->enabled = kvm_enabled(); > info->present = kvm_available(); > + info->mem_encryption = kvm_memcrypt_enabled(); > > return info; > }