diff mbox series

[v3,12/22] target/i386/sev: Declare system-specific functions in 'sev_i386.h'

Message ID 20211002125317.3418648-13-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series target/i386/sev: Housekeeping SEV + measured Linux SEV guest | expand

Commit Message

Philippe Mathieu-Daudé Oct. 2, 2021, 12:53 p.m. UTC
While prefixed with sysemu, 'sysemu/sev.h' contains the architecture
specific declarations. The system specific parts are declared in
'sev_i386.h'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/sysemu/sev.h   | 6 ------
 target/i386/sev_i386.h | 7 +++++++
 hw/i386/pc_sysfw.c     | 2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

Comments

Paolo Bonzini Oct. 4, 2021, 8:15 a.m. UTC | #1
On 02/10/21 14:53, Philippe Mathieu-Daudé wrote:
> While prefixed with sysemu, 'sysemu/sev.h' contains the architecture
> specific declarations. The system specific parts are declared in
> 'sev_i386.h'.

While outside target/i386, 'sysemu/sev.h' contains some architecture 
specific declarations. Move them to 'sev_i386.h'.

Otherwise,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   include/sysemu/sev.h   | 6 ------
>   target/i386/sev_i386.h | 7 +++++++
>   hw/i386/pc_sysfw.c     | 2 +-
>   3 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h
> index 94d821d737c..a329ed75c1c 100644
> --- a/include/sysemu/sev.h
> +++ b/include/sysemu/sev.h
> @@ -18,11 +18,5 @@
>   
>   bool sev_enabled(void);
>   int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp);
> -int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
> -int sev_inject_launch_secret(const char *hdr, const char *secret,
> -                             uint64_t gpa, Error **errp);
> -
> -int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size);
> -void sev_es_set_reset_vector(CPUState *cpu);
>   
>   #endif
> diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h
> index afa19a0a161..0798ab3519a 100644
> --- a/target/i386/sev_i386.h
> +++ b/target/i386/sev_i386.h
> @@ -33,4 +33,11 @@ extern SevCapability *sev_get_capabilities(Error **errp);
>   extern SevAttestationReport *
>   sev_get_attestation_report(const char *mnonce, Error **errp);
>   
> +int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
> +int sev_inject_launch_secret(const char *hdr, const char *secret,
> +                             uint64_t gpa, Error **errp);
> +
> +int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size);
> +void sev_es_set_reset_vector(CPUState *cpu);
> +
>   #endif
> diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
> index 68d6b1f783e..0b202138b66 100644
> --- a/hw/i386/pc_sysfw.c
> +++ b/hw/i386/pc_sysfw.c
> @@ -37,7 +37,7 @@
>   #include "hw/qdev-properties.h"
>   #include "hw/block/flash.h"
>   #include "sysemu/kvm.h"
> -#include "sysemu/sev.h"
> +#include "sev_i386.h"
>   
>   #define FLASH_SECTOR_SIZE 4096
>   
>
diff mbox series

Patch

diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h
index 94d821d737c..a329ed75c1c 100644
--- a/include/sysemu/sev.h
+++ b/include/sysemu/sev.h
@@ -18,11 +18,5 @@ 
 
 bool sev_enabled(void);
 int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp);
-int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
-int sev_inject_launch_secret(const char *hdr, const char *secret,
-                             uint64_t gpa, Error **errp);
-
-int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size);
-void sev_es_set_reset_vector(CPUState *cpu);
 
 #endif
diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h
index afa19a0a161..0798ab3519a 100644
--- a/target/i386/sev_i386.h
+++ b/target/i386/sev_i386.h
@@ -33,4 +33,11 @@  extern SevCapability *sev_get_capabilities(Error **errp);
 extern SevAttestationReport *
 sev_get_attestation_report(const char *mnonce, Error **errp);
 
+int sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp);
+int sev_inject_launch_secret(const char *hdr, const char *secret,
+                             uint64_t gpa, Error **errp);
+
+int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size);
+void sev_es_set_reset_vector(CPUState *cpu);
+
 #endif
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index 68d6b1f783e..0b202138b66 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -37,7 +37,7 @@ 
 #include "hw/qdev-properties.h"
 #include "hw/block/flash.h"
 #include "sysemu/kvm.h"
-#include "sysemu/sev.h"
+#include "sev_i386.h"
 
 #define FLASH_SECTOR_SIZE 4096