This command is filtered at build-time for i386/x86_64 binaries.
By using the recently introduced HMPCommand::arch_bitmask flag
we can filter it at runtime, making it possible to compile
hmp-commands-info.hx once.
Since the method depends on the CONFIG_SEV definition, define it
in its own stub file.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20260427080738.77138-17-philmd@linaro.org>
F: docs/system/i386/amd-memory-encryption.rst
F: docs/system/i386/sgx.rst
F: hw/i386/sgx*
+F: stubs/hmp-cmd-info_sev.c
F: stubs/qmp-i386-sev.c
F: stubs/qmp-i386-sgx.c
F: target/i386/kvm/
enabled) memory in bytes.
ERST
-#if defined(TARGET_I386)
{
.name = "sev",
.args_type = "",
.params = "",
.help = "show SEV information",
.cmd = hmp_info_sev,
+ .arch_bitmask = QEMU_ARCH_I386,
},
-#endif
SRST
``info sev``
--- /dev/null
+/*
+ * Human Monitor 'info sev' stub (CONFIG_SEV)
+ *
+ * Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "monitor/hmp.h"
+#include "monitor/monitor.h"
+
+void hmp_info_sev(Monitor *mon, const QDict *qdict)
+{
+ monitor_printf(mon, "SEV is not available in this QEMU\n");
+}
stub_ss.add(files('qmp-cpu.c'))
stub_ss.add(files('qmp-cpu-s390x.c'))
stub_ss.add(files('qmp-cpu-s390x-kvm.c'))
+ stub_ss.add(files('hmp-cmd-info_sev.c'))
stub_ss.add(files('hmp-cmds-hw-s390x.c'))
stub_ss.add(files('hmp-cmds-target-i386.c'))
endif
g_assert_not_reached();
}
-void hmp_info_sev(Monitor *mon, const QDict *qdict)
-{
- monitor_printf(mon, "SEV is not available in this QEMU\n");
-}
-
void pc_system_parse_sev_metadata(uint8_t *flash_ptr, size_t flash_size)
{
}