[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/40] target/i386/sev: Mark unreachable code with g_assert_not_re
From: |
Paolo Bonzini |
Subject: |
[PULL 15/40] target/i386/sev: Mark unreachable code with g_assert_not_reached() |
Date: |
Wed, 13 Oct 2021 11:07:03 +0200 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
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>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211007161716.453984-11-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@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 20b1e18ec1..55f1ec7419 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
- [PULL 03/40] build: fix "make check" without earlier "make", (continued)
- [PULL 03/40] build: fix "make check" without earlier "make", Paolo Bonzini, 2021/10/13
- [PULL 07/40] qapi/misc-target: Group SEV QAPI definitions, Paolo Bonzini, 2021/10/13
- [PULL 10/40] target/i386/sev: Prefix QMP errors with 'SEV', Paolo Bonzini, 2021/10/13
- [PULL 17/40] target/i386/sev: Use g_autofree in sev_launch_get_measure(), Paolo Bonzini, 2021/10/13
- [PULL 22/40] target/i386/sev: Move qmp_query_sev_attestation_report() to sev.c, Paolo Bonzini, 2021/10/13
- [PULL 06/40] qapi/misc-target: Wrap long 'SEV Attestation Report' long lines, Paolo Bonzini, 2021/10/13
- [PULL 11/40] target/i386/monitor: Return QMP error when SEV is not enabled for guest, Paolo Bonzini, 2021/10/13
- [PULL 14/40] target/i386/sev: Remove sev_get_me_mask(), Paolo Bonzini, 2021/10/13
- [PULL 19/40] target/i386/sev: Rename sev_i386.h -> sev.h, Paolo Bonzini, 2021/10/13
- [PULL 25/40] target/i386/sev: Move qmp_query_sev_launch_measure() to sev.c, Paolo Bonzini, 2021/10/13
- [PULL 15/40] target/i386/sev: Mark unreachable code with g_assert_not_reached(),
Paolo Bonzini <=
- [PULL 21/40] target/i386/sev: Remove stubs by using code elision, Paolo Bonzini, 2021/10/13
- [PULL 26/40] target/i386/sev: Move qmp_query_sev() & hmp_info_sev() to sev.c, Paolo Bonzini, 2021/10/13
- [PULL 28/40] MAINTAINERS: Cover SEV-related files with X86/KVM section, Paolo Bonzini, 2021/10/13
- [PULL 29/40] qapi: Make some ObjectTypes depend on the build settings, Paolo Bonzini, 2021/10/13
- [PULL 30/40] tests: tcg: Fix PVH test with binutils 2.36+, Paolo Bonzini, 2021/10/13
- [PULL 12/40] target/i386/cpu: Add missing 'qapi/error.h' header, Paolo Bonzini, 2021/10/13
- [PULL 13/40] target/i386/sev_i386.h: Remove unused headers, Paolo Bonzini, 2021/10/13
- [PULL 18/40] target/i386/sev: Restrict SEV to system emulation, Paolo Bonzini, 2021/10/13
- [PULL 16/40] target/i386/sev: sev_get_attestation_report use g_autofree, Paolo Bonzini, 2021/10/13
- [PULL 24/40] target/i386/sev: Move qmp_query_sev_capabilities() to sev.c, Paolo Bonzini, 2021/10/13