[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 26/33] qmp: Add query-sgx command
From: |
Yang Zhong |
Subject: |
[PATCH v4 26/33] qmp: Add query-sgx command |
Date: |
Mon, 19 Jul 2021 19:21:29 +0800 |
This QMP query command can be used by some userspaces to retrieve
the SGX information when SGX is enabled on Intel platform.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
v1-->v2:
- "Since: 5.1" to "Since: 6.1", and grammar error(Eric Blake).
---
monitor/qmp-cmds.c | 6 ++++++
qapi/misc.json | 42 ++++++++++++++++++++++++++++++++++++++
tests/qtest/qmp-cmd-test.c | 1 +
3 files changed, 49 insertions(+)
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index f7d64a6457..d63d59149f 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -351,3 +351,9 @@ void qmp_display_reload(DisplayReloadOptions *arg, Error
**errp)
abort();
}
}
+
+SGXInfo *qmp_query_sgx(Error **errp)
+{
+ error_setg(errp, QERR_FEATURE_DISABLED, "query-sgx");
+ return NULL;
+}
diff --git a/qapi/misc.json b/qapi/misc.json
index 156f98203e..83b45a1460 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -519,3 +519,45 @@
'data': { '*option': 'str' },
'returns': ['CommandLineOptionInfo'],
'allow-preconfig': true }
+
+##
+# @SGXInfo:
+#
+# Information about intel Safe Guard eXtension (SGX) support
+#
+# @sgx: true if SGX is supported
+#
+# @sgx1: true if SGX1 is supported
+#
+# @sgx2: true if SGX2 is supported
+#
+# @flc: true if FLC is supported
+#
+# @section-size: The EPC section size for guest
+#
+# Since: 6.1
+##
+{ 'struct': 'SGXInfo',
+ 'data': { 'sgx': 'bool',
+ 'sgx1': 'bool',
+ 'sgx2': 'bool',
+ 'flc': 'bool',
+ 'section-size': 'uint64'}}
+
+##
+# @query-sgx:
+#
+# Returns information about SGX
+#
+# Returns: @SGXInfo
+#
+# Since: 6.1
+#
+# Example:
+#
+# -> { "execute": "query-sgx" }
+# <- { "return": { "sgx": true, "sgx1" : true, "sgx2" : true,
+# "flc": true, "section-size" : 0 } }
+#
+##
+{ 'command': 'query-sgx', 'returns': 'SGXInfo' }
diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
index c98b78d033..b75f3364f3 100644
--- a/tests/qtest/qmp-cmd-test.c
+++ b/tests/qtest/qmp-cmd-test.c
@@ -100,6 +100,7 @@ static bool query_is_ignored(const char *cmd)
/* Success depends on Host or Hypervisor SEV support */
"query-sev",
"query-sev-capabilities",
+ "query-sgx",
NULL
};
int i;
- [PATCH v4 16/33] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly, (continued)
- [PATCH v4 16/33] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly, Yang Zhong, 2021/07/19
- [PATCH v4 17/33] hw/i386/pc: Account for SGX EPC sections when calculating device memory, Yang Zhong, 2021/07/19
- [PATCH v4 18/33] i386/pc: Add e820 entry for SGX EPC section(s), Yang Zhong, 2021/07/19
- [PATCH v4 19/33] i386: acpi: Add SGX EPC entry to ACPI tables, Yang Zhong, 2021/07/19
- [PATCH v4 20/33] q35: Add support for SGX EPC, Yang Zhong, 2021/07/19
- [PATCH v4 21/33] i440fx: Add support for SGX EPC, Yang Zhong, 2021/07/19
- [PATCH v4 22/33] hostmem-epc: Add the reset interface for EPC backend reset, Yang Zhong, 2021/07/19
- [PATCH v4 23/33] sgx-epc: Add the reset interface for sgx-epc virt device, Yang Zhong, 2021/07/19
- [PATCH v4 24/33] sgx-epc: Avoid bios reset during sgx epc initialization, Yang Zhong, 2021/07/19
- [PATCH v4 25/33] hostmem-epc: Make prealloc consistent with qemu cmdline during reset, Yang Zhong, 2021/07/19
- [PATCH v4 26/33] qmp: Add query-sgx command,
Yang Zhong <=
- [PATCH v4 27/33] hmp: Add 'info sgx' command, Yang Zhong, 2021/07/19
- [PATCH v4 28/33] i386: Add sgx_get_info() interface, Yang Zhong, 2021/07/19
- [PATCH v4 29/33] bitops: Support 32 and 64 bit mask macro, Yang Zhong, 2021/07/19
- [PATCH v4 30/33] qmp: Add the qmp_query_sgx_capabilities(), Yang Zhong, 2021/07/19
- [PATCH v4 31/33] Kconfig: Add CONFIG_SGX support, Yang Zhong, 2021/07/19
- [PATCH v4 32/33] sgx-epc: Add the fill_device_info() callback support, Yang Zhong, 2021/07/19
- [PATCH v4 33/33] doc: Add the SGX doc, Yang Zhong, 2021/07/19
- Re: [PATCH v4 00/33] Qemu SGX virtualization, Paolo Bonzini, 2021/07/28