[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/25] target/i386: SEV: do not assume machine->cgs is SEV
From: |
Paolo Bonzini |
Subject: |
[PULL 25/25] target/i386: SEV: do not assume machine->cgs is SEV |
Date: |
Tue, 11 Jun 2024 16:25:23 +0200 |
There can be other confidential computing classes that are not derived
from sev-common. Avoid aborting when encountering them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/sev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index c40562dce31..30b83f1d77d 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -1712,7 +1712,9 @@ void sev_es_set_reset_vector(CPUState *cpu)
{
X86CPU *x86;
CPUX86State *env;
- SevCommonState *sev_common = SEV_COMMON(MACHINE(qdev_get_machine())->cgs);
+ ConfidentialGuestSupport *cgs = MACHINE(qdev_get_machine())->cgs;
+ SevCommonState *sev_common = SEV_COMMON(
+ object_dynamic_cast(OBJECT(cgs), TYPE_SEV_COMMON));
/* Only update if we have valid reset information */
if (!sev_common || !sev_common->reset_data_valid) {
--
2.45.1
- [PULL 14/25] target/i386: fix bad sorting of entries in the 0F table, (continued)
- [PULL 14/25] target/i386: fix bad sorting of entries in the 0F table, Paolo Bonzini, 2024/06/11
- [PULL 17/25] target/i386: split X86_CHECK_prot into PE and VM86 checks, Paolo Bonzini, 2024/06/11
- [PULL 16/25] target/i386: replace read_crN helper with read_cr8, Paolo Bonzini, 2024/06/11
- [PULL 18/25] target/i386: convert non-grouped, helper-based 2-byte opcodes, Paolo Bonzini, 2024/06/11
- [PULL 20/25] target/i386: adapt gen_shift_count for SHLD/SHRD, Paolo Bonzini, 2024/06/11
- [PULL 21/25] target/i386: convert SHLD/SHRD to new decoder, Paolo Bonzini, 2024/06/11
- [PULL 19/25] target/i386: pull load/writeback out of gen_shiftd_rm_T1, Paolo Bonzini, 2024/06/11
- [PULL 22/25] target/i386: convert LZCNT/TZCNT/BSF/BSR/POPCNT to new decoder, Paolo Bonzini, 2024/06/11
- [PULL 23/25] target/i386: convert XADD to new decoder, Paolo Bonzini, 2024/06/11
- [PULL 24/25] target/i386: convert CMPXCHG to new decoder, Paolo Bonzini, 2024/06/11
- [PULL 25/25] target/i386: SEV: do not assume machine->cgs is SEV,
Paolo Bonzini <=
- Re: [PULL 00/25] target/i386, SCSI changes for 2024-06-11, Richard Henderson, 2024/06/13