[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v10 14/28] hmp: add 'info sev' command
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH v10 14/28] hmp: add 'info sev' command |
Date: |
Fri, 2 Mar 2018 11:31:19 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
* Brijesh Singh (address@hidden) wrote:
> The command can be used to show the SEV information when memory
> encryption is enabled on AMD platform.
>
> Cc: Eric Blake <address@hidden>
> Cc: "Daniel P. Berrangé" <address@hidden>
> Cc: "Dr. David Alan Gilbert" <address@hidden>
> Cc: Markus Armbruster <address@hidden>
> Reviewed-by: "Dr. David Alan Gilbert" <address@hidden>
> Signed-off-by: Brijesh Singh <address@hidden>
> ---
>
> Hi Dave,
>
> I updated the patch to address your comment on making this x86 specific, but
> still kept your R-b, if you don't agree with changes then let me know.
Yes, that's fine, thanks.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Dave
> thanks
>
> hmp-commands-info.hx | 16 ++++++++++++++++
> hmp.h | 1 +
> target/i386/monitor.c | 20 ++++++++++++++++++++
> 3 files changed, 37 insertions(+)
>
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index ad590a4ffb2b..ddfcd5adcca6 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -867,6 +867,22 @@ Display the amount of initially allocated and present
> hotpluggable (if
> enabled) memory in bytes.
> ETEXI
>
> +#if defined(TARGET_I386)
> + {
> + .name = "sev",
> + .args_type = "",
> + .params = "",
> + .help = "show SEV information",
> + .cmd = hmp_info_sev,
> + },
> +#endif
> +
> +STEXI
> address@hidden info sev
> address@hidden info sev
> +Show SEV information.
> +ETEXI
> +
> STEXI
> @end table
> ETEXI
> diff --git a/hmp.h b/hmp.h
> index 1143db44a760..4ca1a77b2c1f 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -146,5 +146,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
> void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
> void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
> void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict);
> +void hmp_info_sev(Monitor *mon, const QDict *qdict);
>
> #endif
> diff --git a/target/i386/monitor.c b/target/i386/monitor.c
> index e2f02c4be95c..e664030dbd72 100644
> --- a/target/i386/monitor.c
> +++ b/target/i386/monitor.c
> @@ -29,6 +29,7 @@
> #include "qapi/qmp/qdict.h"
> #include "hw/i386/pc.h"
> #include "sysemu/kvm.h"
> +#include "sysemu/sev.h"
> #include "hmp.h"
> #include "sev_i386.h"
> #include "qmp-commands.h"
> @@ -680,3 +681,22 @@ SevInfo *qmp_query_sev(Error **errp)
>
> return info;
> }
> +
> +void hmp_info_sev(Monitor *mon, const QDict *qdict)
> +{
> + SevInfo *info = sev_get_info();
> +
> + if (info && info->enabled) {
> + monitor_printf(mon, "handle: %d\n", info->handle);
> + monitor_printf(mon, "state: %s\n", SevState_str(info->state));
> + monitor_printf(mon, "build: %d\n", info->build_id);
> + monitor_printf(mon, "api version: %d.%d\n",
> + info->api_major, info->api_minor);
> + monitor_printf(mon, "debug: %s\n",
> + info->policy & SEV_POLICY_NODBG ? "off" : "on");
> + monitor_printf(mon, "key-sharing: %s\n",
> + info->policy & SEV_POLICY_NOKS ? "off" : "on");
> + } else {
> + monitor_printf(mon, "SEV is not enabled\n");
> + }
> +}
> --
> 2.14.3
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v10 14/28] hmp: add 'info sev' command,
Dr. David Alan Gilbert <=