qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] target/i386/sev: Reduce system specific declarations


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/2] target/i386/sev: Reduce system specific declarations
Date: Wed, 18 Dec 2024 17:18:30 +0100
User-agent: Mozilla Thunderbird

On 18/12/24 16:59, Philippe Mathieu-Daudé wrote:
"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>
---
  target/i386/sev.h  | 29 ++++++++++++++++-------------
  hw/i386/pc_sysfw.c |  2 +-
  2 files changed, 17 insertions(+), 14 deletions(-)


+#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);

The motivation is to reduce system-specific definitions
exposed to user-mode in target/i386/cpu.c, like hwaddr &co,
but I'm not there yet and have too many local patches so
starting to send what's ready.

@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]