The command can be used to show the SGX information in the monitor when SGX is enabled on intel platform.
Signed-off-by: Yang Zhong <yang.zh...@intel.com> --- hmp-commands-info.hx | 15 +++++++++++++++ include/monitor/hmp-target.h | 1 + target/i386/monitor.c | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index 27206ac049..4c966e8a6b 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -877,3 +877,18 @@ SRST ``info dirty_rate`` Display the vcpu dirty rate information. ERST + +#if defined(TARGET_I386) + { + .name = "sgx", + .args_type = "", + .params = "", + .help = "show intel SGX information", + .cmd = hmp_info_sgx, + }, +#endif + +SRST + ``info sgx`` + Show intel SGX information. +ERST diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 60fc92722a..dc53add7ee 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -49,5 +49,6 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict); void hmp_mce(Monitor *mon, const QDict *qdict); void hmp_info_local_apic(Monitor *mon, const QDict *qdict); void hmp_info_io_apic(Monitor *mon, const QDict *qdict); +void hmp_info_sgx(Monitor *mon, const QDict *qdict); #endif /* MONITOR_HMP_TARGET_H */ diff --git a/target/i386/monitor.c b/target/i386/monitor.c index 942274c1c2..f1861fe6c2 100644 --- a/target/i386/monitor.c +++ b/target/i386/monitor.c @@ -769,3 +769,9 @@ SGXInfo *qmp_query_sgx(Error **errp) error_setg(errp, QERR_FEATURE_DISABLED, "query-sgx"); return NULL; } + +void hmp_info_sgx(Monitor *mon, const QDict *qdict) +{ + error_setg(errp, QERR_FEATURE_DISABLED, "query-sgx"); + return NULL; +}