[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/59] target/i386/sev: Reduce system specific declarations
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 10/59] target/i386/sev: Reduce system specific declarations |
Date: |
Fri, 20 Dec 2024 17:15:01 +0100 |
"system/confidential-guest-support.h" is not needed,
remove it. Reorder #ifdef'ry to reduce declarations
exposed on user emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20241218155913.72288-3-philmd@linaro.org>
---
target/i386/sev.h | 29 ++++++++++++++++-------------
hw/i386/pc_sysfw.c | 2 +-
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/target/i386/sev.h b/target/i386/sev.h
index 858005a119c..373669eaace 100644
--- a/target/i386/sev.h
+++ b/target/i386/sev.h
@@ -18,7 +18,17 @@
#include CONFIG_DEVICES /* CONFIG_SEV */
#endif
-#include "exec/confidential-guest-support.h"
+#if !defined(CONFIG_SEV) || defined(CONFIG_USER_ONLY)
+#define sev_enabled() 0
+#define sev_es_enabled() 0
+#define sev_snp_enabled() 0
+#else
+bool sev_enabled(void);
+bool sev_es_enabled(void);
+bool sev_snp_enabled(void);
+#endif
+
+#if !defined(CONFIG_USER_ONLY)
#define TYPE_SEV_COMMON "sev-common"
#define TYPE_SEV_GUEST "sev-guest"
@@ -45,18 +55,6 @@ typedef struct SevKernelLoaderContext {
size_t cmdline_size;
} SevKernelLoaderContext;
-#ifdef CONFIG_SEV
-bool sev_enabled(void);
-bool sev_es_enabled(void);
-bool sev_snp_enabled(void);
-#else
-#define sev_enabled() 0
-#define sev_es_enabled() 0
-#define sev_snp_enabled() 0
-#endif
-
-uint32_t sev_get_cbit_position(void);
-uint32_t sev_get_reduced_phys_bits(void);
bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp);
int sev_encrypt_flash(hwaddr gpa, uint8_t *ptr, uint64_t len, Error **errp);
@@ -68,4 +66,9 @@ void sev_es_set_reset_vector(CPUState *cpu);
void pc_system_parse_sev_metadata(uint8_t *flash_ptr, size_t flash_size);
+#endif /* !CONFIG_USER_ONLY */
+
+uint32_t sev_get_cbit_position(void);
+uint32_t sev_get_reduced_phys_bits(void);
+
#endif
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index ef80281d28b..e6271e10208 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -36,7 +36,7 @@
#include "hw/qdev-properties.h"
#include "hw/block/flash.h"
#include "sysemu/kvm.h"
-#include "sev.h"
+#include "target/i386/sev.h"
#define FLASH_SECTOR_SIZE 4096
--
2.47.1
- [PULL 00/59] Accel & exec patches for 2024-12-20, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 02/59] log: Add separate debug option for logging invalid memory accesses, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 01/59] hvf: arm: Ignore writes to CNTP_CTL_EL0, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 03/59] qom: Add TYPE_CONTAINER macro, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 04/59] qom: New object_property_add_new_container(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 05/59] tests: Fix test-qdev-global-props on anonymous qdev realize(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 06/59] tests: Explicitly create containers in test_qom_partial_path(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 07/59] ppc/e500: Avoid abuse of container_get(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 08/59] hw/ppc: Explicitly create the drc container, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 09/59] qom: Create system containers explicitly, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 10/59] target/i386/sev: Reduce system specific declarations,
Philippe Mathieu-Daudé <=
- [PULL 11/59] include: Rename sysemu/ -> system/, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 12/59] system: Move 'exec/confidential-guest-support.h' to system/, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 13/59] tcg/tci: Include missing 'disas/dis-asm.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 14/59] accel/tcg: Include missing 'exec/tswap.h' header in translator.c, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 15/59] accel/tcg: Have tlb_vaddr_to_host() use vaddr type, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 16/59] exec/cpu-all: Include missing 'exec/cpu-defs.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 19/59] linux-user/aarch64: Include missing 'user/abitypes.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 17/59] exec/cpu-defs: Remove unnecessary headers, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 21/59] target/arm/cpu: Restrict cpu_untagged_addr() to user emulation, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 18/59] exec/translation-block: Include missing 'exec/vaddr.h' header, Philippe Mathieu-Daudé, 2024/12/20