[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/23] target/i386/sev: Mark unreachable code with g_assert_no
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 08/23] target/i386/sev: Mark unreachable code with g_assert_not_reached() |
Date: |
Wed, 16 Jun 2021 22:43:13 +0200 |
The unique sev_encrypt_flash() invocation (in pc_system_flash_map)
is protected by the "if (sev_enabled())" check, so is not
reacheable.
Replace the abort() call in sev_es_save_reset_vector() by
g_assert_not_reached() which meaning is clearer.
Reviewed-by: Connor Kuehl <ckuehl@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
target/i386/sev-stub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c
index eb0c89bf2be..4668365fd3e 100644
--- a/target/i386/sev-stub.c
+++ b/target/i386/sev-stub.c
@@ -54,7 +54,7 @@ int sev_inject_launch_secret(const char *hdr, const char
*secret,
int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp)
{
- return 0;
+ g_assert_not_reached();
}
bool sev_es_enabled(void)
@@ -68,7 +68,7 @@ void sev_es_set_reset_vector(CPUState *cpu)
int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size)
{
- abort();
+ g_assert_not_reached();
}
SevAttestationReport *
--
2.31.1
- [PATCH v2 00/23] target/i386/sev: Housekeeping (OVMF + SEV-disabled binaries), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 02/23] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 01/23] MAINTAINERS: Add Connor Kuehl as reviewer for AMD SEV, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 03/23] qapi/misc-target: Group SEV QAPI definitions, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 05/23] target/i386/cpu: Add missing 'qapi/error.h' header, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 04/23] target/i386/monitor: Return QMP error when SEV is disabled in build, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 06/23] target/i386/sev_i386.h: Remove unused headers, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 07/23] target/i386/sev: Remove sev_get_me_mask(), Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 08/23] target/i386/sev: Mark unreachable code with g_assert_not_reached(),
Philippe Mathieu-Daudé <=
- [PATCH v2 09/23] target/i386/sev: sev_get_attestation_report use g_autofree, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 10/23] target/i386/sev: Restrict SEV to system emulation, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 11/23] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 12/23] target/i386/sev: Move qmp_sev_inject_launch_secret() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 13/23] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 14/23] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 15/23] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 16/23] monitor: Restrict 'info sev' to x86 targets, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 17/23] hw/i386/acpi-common: Remove unused includes, Philippe Mathieu-Daudé, 2021/06/16
- [PATCH v2 18/23] hw/i386: Rename acpi-build.c -> acpi-pc.c, Philippe Mathieu-Daudé, 2021/06/16