mirror of https://github.com/xemu-project/xemu.git
target/i386: sev: Move local structure definitions into .c file
Neither QSevGuestInfo nor SEVState (not to be confused with SevState) is used anywhere outside target/i386/sev.c, so they might as well live in there rather than in a (somewhat) exposed header. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200604064219.436242-3-david@gibson.dropbear.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b5b9b1ad46
commit
a86ab19d4a
|
@ -29,6 +29,50 @@
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "migration/blocker.h"
|
#include "migration/blocker.h"
|
||||||
|
|
||||||
|
#define TYPE_QSEV_GUEST_INFO "sev-guest"
|
||||||
|
#define QSEV_GUEST_INFO(obj) \
|
||||||
|
OBJECT_CHECK(QSevGuestInfo, (obj), TYPE_QSEV_GUEST_INFO)
|
||||||
|
|
||||||
|
typedef struct QSevGuestInfo QSevGuestInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* QSevGuestInfo:
|
||||||
|
*
|
||||||
|
* The QSevGuestInfo object is used for creating a SEV guest.
|
||||||
|
*
|
||||||
|
* # $QEMU \
|
||||||
|
* -object sev-guest,id=sev0 \
|
||||||
|
* -machine ...,memory-encryption=sev0
|
||||||
|
*/
|
||||||
|
struct QSevGuestInfo {
|
||||||
|
Object parent_obj;
|
||||||
|
|
||||||
|
char *sev_device;
|
||||||
|
uint32_t policy;
|
||||||
|
uint32_t handle;
|
||||||
|
char *dh_cert_file;
|
||||||
|
char *session_file;
|
||||||
|
uint32_t cbitpos;
|
||||||
|
uint32_t reduced_phys_bits;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SEVState {
|
||||||
|
QSevGuestInfo *sev_info;
|
||||||
|
uint8_t api_major;
|
||||||
|
uint8_t api_minor;
|
||||||
|
uint8_t build_id;
|
||||||
|
uint32_t policy;
|
||||||
|
uint64_t me_mask;
|
||||||
|
uint32_t cbitpos;
|
||||||
|
uint32_t reduced_phys_bits;
|
||||||
|
uint32_t handle;
|
||||||
|
int sev_fd;
|
||||||
|
SevState state;
|
||||||
|
gchar *measurement;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct SEVState SEVState;
|
||||||
|
|
||||||
#define DEFAULT_GUEST_POLICY 0x1 /* disable debug */
|
#define DEFAULT_GUEST_POLICY 0x1 /* disable debug */
|
||||||
#define DEFAULT_SEV_DEVICE "/dev/sev"
|
#define DEFAULT_SEV_DEVICE "/dev/sev"
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,6 @@
|
||||||
#define SEV_POLICY_DOMAIN 0x10
|
#define SEV_POLICY_DOMAIN 0x10
|
||||||
#define SEV_POLICY_SEV 0x20
|
#define SEV_POLICY_SEV 0x20
|
||||||
|
|
||||||
#define TYPE_QSEV_GUEST_INFO "sev-guest"
|
|
||||||
#define QSEV_GUEST_INFO(obj) \
|
|
||||||
OBJECT_CHECK(QSevGuestInfo, (obj), TYPE_QSEV_GUEST_INFO)
|
|
||||||
|
|
||||||
extern bool sev_enabled(void);
|
extern bool sev_enabled(void);
|
||||||
extern uint64_t sev_get_me_mask(void);
|
extern uint64_t sev_get_me_mask(void);
|
||||||
extern SevInfo *sev_get_info(void);
|
extern SevInfo *sev_get_info(void);
|
||||||
|
@ -40,44 +36,4 @@ extern uint32_t sev_get_reduced_phys_bits(void);
|
||||||
extern char *sev_get_launch_measurement(void);
|
extern char *sev_get_launch_measurement(void);
|
||||||
extern SevCapability *sev_get_capabilities(void);
|
extern SevCapability *sev_get_capabilities(void);
|
||||||
|
|
||||||
typedef struct QSevGuestInfo QSevGuestInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* QSevGuestInfo:
|
|
||||||
*
|
|
||||||
* The QSevGuestInfo object is used for creating a SEV guest.
|
|
||||||
*
|
|
||||||
* # $QEMU \
|
|
||||||
* -object sev-guest,id=sev0 \
|
|
||||||
* -machine ...,memory-encryption=sev0
|
|
||||||
*/
|
|
||||||
struct QSevGuestInfo {
|
|
||||||
Object parent_obj;
|
|
||||||
|
|
||||||
char *sev_device;
|
|
||||||
uint32_t policy;
|
|
||||||
uint32_t handle;
|
|
||||||
char *dh_cert_file;
|
|
||||||
char *session_file;
|
|
||||||
uint32_t cbitpos;
|
|
||||||
uint32_t reduced_phys_bits;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct SEVState {
|
|
||||||
QSevGuestInfo *sev_info;
|
|
||||||
uint8_t api_major;
|
|
||||||
uint8_t api_minor;
|
|
||||||
uint8_t build_id;
|
|
||||||
uint32_t policy;
|
|
||||||
uint64_t me_mask;
|
|
||||||
uint32_t cbitpos;
|
|
||||||
uint32_t reduced_phys_bits;
|
|
||||||
uint32_t handle;
|
|
||||||
int sev_fd;
|
|
||||||
SevState state;
|
|
||||||
gchar *measurement;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct SEVState SEVState;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue