src/mainboard/emulation/qemu-i440fx: Fix struct packing

On x86_64 the struct isn't packed, causing the fw_cfg parser to return
invalid memory entries (possible others as well) through fw_cfg.
Fix that by packing all structs.

Change-Id: Id1bab99f06be99674efe219dda443fb7d44be560
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59872
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Patrick Rudolph 2021-12-03 17:15:10 +01:00 committed by Felix Held
parent cab1285c03
commit 17c9cfe212

View File

@ -69,18 +69,18 @@ typedef struct FWCfgFile {
uint16_t select; /* write this to 0x510 to read it */
uint16_t reserved;
char name[FW_CFG_MAX_FILE_PATH];
} FWCfgFile;
} __packed FWCfgFile;
typedef struct FWCfgFiles {
uint32_t count;
FWCfgFile f[];
} FWCfgFiles;
} __packed FWCfgFiles;
typedef struct FwCfgE820Entry {
uint64_t address;
uint64_t length;
uint32_t type;
} FwCfgE820Entry __attribute((__aligned__(4)));
} __packed FwCfgE820Entry __attribute((__aligned__(4)));
#define SMBIOS_FIELD_ENTRY 0
@ -91,7 +91,7 @@ typedef struct FwCfgSmbios {
uint8_t headertype;
uint8_t tabletype;
uint16_t fieldoffset;
} FwCfgSmbios;
} __packed FwCfgSmbios;
/* FW_CFG_ID bits */
#define FW_CFG_VERSION 0x01
@ -113,6 +113,6 @@ typedef struct FwCfgDmaAccess {
uint32_t control;
uint32_t length;
uint64_t address;
} FwCfgDmaAccess;
} __packed FwCfgDmaAccess;
#endif /* FW_CFG_IF_H */