render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0001-sgx-stub-fix.patch

Paolo Bonzini 06a96e
From 509b6078631ad2437e1a452f749831e401fb8afb Mon Sep 17 00:00:00 2001
Paolo Bonzini 06a96e
From: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini 06a96e
Date: Tue, 1 Feb 2022 20:09:37 +0100
Paolo Bonzini 06a96e
Subject: [PATCH] target/i386: the sgx_epc_get_section stub is reachable
Paolo Bonzini 06a96e
MIME-Version: 1.0
Paolo Bonzini 06a96e
Content-Type: text/plain; charset=UTF-8
Paolo Bonzini 06a96e
Content-Transfer-Encoding: 8bit
Paolo Bonzini 06a96e
Paolo Bonzini 06a96e
The sgx_epc_get_section stub is reachable from cpu_x86_cpuid.  It
Paolo Bonzini 06a96e
should not assert, instead it should just return true just like
Paolo Bonzini 06a96e
the "real" sgx_epc_get_section does when SGX is disabled.
Paolo Bonzini 06a96e
Paolo Bonzini 06a96e
Reported-by: Vladimír Beneš <vbenes@redhat.com>
Paolo Bonzini 06a96e
Cc: qemu-stable@nongnu.org
Paolo Bonzini 06a96e
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini 06a96e
Paolo Bonzini 06a96e
diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
Paolo Bonzini 06a96e
index 26833eb233..16b1dfd90b 100644
Paolo Bonzini 06a96e
--- a/hw/i386/sgx-stub.c
Paolo Bonzini 06a96e
+++ b/hw/i386/sgx-stub.c
Paolo Bonzini 06a96e
@@ -34,5 +34,5 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
Paolo Bonzini 06a96e
 
Paolo Bonzini 06a96e
 bool sgx_epc_get_section(int section_nr, uint64_t *addr, uint64_t *size)
Paolo Bonzini 06a96e
 {
Paolo Bonzini 06a96e
-    g_assert_not_reached();
Paolo Bonzini 06a96e
+    return true;
Paolo Bonzini 06a96e
 }