[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 45/49] i386/sev: Reorder struct declarations
From: |
Michael Roth |
Subject: |
[PATCH v3 45/49] i386/sev: Reorder struct declarations |
Date: |
Wed, 20 Mar 2024 03:39:41 -0500 |
From: Dov Murik <dovmurik@linux.ibm.com>
Move the declaration of PaddedSevHashTable before SevSnpGuest so
we can add a new such field to the latter.
No functional change intended.
Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
target/i386/sev.c | 56 +++++++++++++++++++++++------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 0913cb7fed..4bc6004037 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -41,6 +41,34 @@
#include "exec/address-spaces.h"
#include "qemu/queue.h"
+/* hard code sha256 digest size */
+#define HASH_SIZE 32
+
+typedef struct QEMU_PACKED SevHashTableEntry {
+ QemuUUID guid;
+ uint16_t len;
+ uint8_t hash[HASH_SIZE];
+} SevHashTableEntry;
+
+typedef struct QEMU_PACKED SevHashTable {
+ QemuUUID guid;
+ uint16_t len;
+ SevHashTableEntry cmdline;
+ SevHashTableEntry initrd;
+ SevHashTableEntry kernel;
+} SevHashTable;
+
+/*
+ * Data encrypted by sev_encrypt_flash() must be padded to a multiple of
+ * 16 bytes.
+ */
+typedef struct QEMU_PACKED PaddedSevHashTable {
+ SevHashTable ht;
+ uint8_t padding[ROUND_UP(sizeof(SevHashTable), 16) - sizeof(SevHashTable)];
+} PaddedSevHashTable;
+
+QEMU_BUILD_BUG_ON(sizeof(PaddedSevHashTable) % 16 != 0);
+
OBJECT_DECLARE_SIMPLE_TYPE(SevCommonState, SEV_COMMON)
OBJECT_DECLARE_SIMPLE_TYPE(SevGuestState, SEV_GUEST)
OBJECT_DECLARE_SIMPLE_TYPE(SevSnpGuestState, SEV_SNP_GUEST)
@@ -131,34 +159,6 @@ typedef struct QEMU_PACKED SevHashTableDescriptor {
uint32_t size;
} SevHashTableDescriptor;
-/* hard code sha256 digest size */
-#define HASH_SIZE 32
-
-typedef struct QEMU_PACKED SevHashTableEntry {
- QemuUUID guid;
- uint16_t len;
- uint8_t hash[HASH_SIZE];
-} SevHashTableEntry;
-
-typedef struct QEMU_PACKED SevHashTable {
- QemuUUID guid;
- uint16_t len;
- SevHashTableEntry cmdline;
- SevHashTableEntry initrd;
- SevHashTableEntry kernel;
-} SevHashTable;
-
-/*
- * Data encrypted by sev_encrypt_flash() must be padded to a multiple of
- * 16 bytes.
- */
-typedef struct QEMU_PACKED PaddedSevHashTable {
- SevHashTable ht;
- uint8_t padding[ROUND_UP(sizeof(SevHashTable), 16) - sizeof(SevHashTable)];
-} PaddedSevHashTable;
-
-QEMU_BUILD_BUG_ON(sizeof(PaddedSevHashTable) % 16 != 0);
-
static Error *sev_mig_blocker;
static const char *const sev_fw_errlist[] = {
--
2.25.1
- [PATCH v3 40/49] hw/i386/sev: Add function to get SEV metadata from OVMF header, (continued)
- [PATCH v3 40/49] hw/i386/sev: Add function to get SEV metadata from OVMF header, Michael Roth, 2024/03/20
- [PATCH v3 03/49] scripts/update-linux-headers: Add bits.h to file imports, Michael Roth, 2024/03/20
- [PATCH v3 41/49] i386/sev: Add support for populating OVMF metadata pages, Michael Roth, 2024/03/20
- [PATCH v3 42/49] i386/sev: Add support for SNP CPUID validation, Michael Roth, 2024/03/20
- [PATCH v3 43/49] qapi, i386: Move kernel-hashes to SevCommonProperties, Michael Roth, 2024/03/20
- [PATCH v3 44/49] i386/sev: Extract build_kernel_loader_hashes, Michael Roth, 2024/03/20
- [PATCH v3 45/49] i386/sev: Reorder struct declarations,
Michael Roth <=
- [PATCH v3 46/49] i386/sev: Allow measured direct kernel boot on SNP, Michael Roth, 2024/03/20
- [PATCH v3 47/49] hw/i386/sev: Add support to encrypt BIOS when SEV-SNP is enabled, Michael Roth, 2024/03/20
- [PATCH v3 48/49] hw/i386/sev: Use guest_memfd for legacy ROMs, Michael Roth, 2024/03/20
- [PATCH v3 49/49] hw/i386: Add support for loading BIOS using guest_memfd, Michael Roth, 2024/03/20
- [PATCH v3 04/49] [HACK] linux-headers: Update headers for 6.8 + kvm-coco-queue + SNP, Michael Roth, 2024/03/20
- [PATCH v3 05/49] [TEMP] hw/i386: Remove redeclaration of struct setup_data, Michael Roth, 2024/03/20