summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Bayer <gbayer@linux.ibm.com>2026-10-12 16:21:49 +0200
committerHeiko Carstens <hca@linux.ibm.com>2026-10-14 17:33:39 +0200
commit9bfcede4926054b8ee154e92e30dfabecf238ca4 (patch)
tree66faf50e3bc2575d53e9f809459bdd4988c523c5
parentcfadcb9c0fb6025950c2891b808b0e23efa827e6 (diff)
downloadlinux-9bfcede4926054b8ee154e92e30dfabecf238ca4.tar.gz
linux-9bfcede4926054b8ee154e92e30dfabecf238ca4.zip
s390/pci: Adjust alignment in insn trace
Currently we have 64bit wide fields start at odd byte-offsets in the insn traces for pci_error in the s390dbf debug area, which are hard to decode in hex dumps. At the same time, trace entries are padded at the end. Drop the packed attribute on the struct definition to exploit the compiler's natural alignment, introduce explicit padding before and after the 64bit fields for humans, and add a static assertion to avoid accidental overruns of 2 lines in the s390dbf trace. Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/pci/pci_insn.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/pci/pci_insn.c b/arch/s390/pci/pci_insn.c
index ed0def408f18..6afabc5b68aa 100644
--- a/arch/s390/pci/pci_insn.c
+++ b/arch/s390/pci/pci_insn.c
@@ -18,11 +18,13 @@
#include <asm/asm.h>
#define ZPCI_INSN_BUSY_DELAY 1 /* 1 microsecond */
+#define ZPCI_ERR_INSN_DATA_SIZE 32
struct zpci_err_insn_data {
u8 insn;
u8 cc;
u8 status;
+ u8 pad0[5];
union {
struct {
u64 req;
@@ -33,7 +35,10 @@ struct zpci_err_insn_data {
u64 len;
};
};
-} __packed;
+ u64 pad1;
+};
+
+static_assert(sizeof(struct zpci_err_insn_data) <= ZPCI_ERR_INSN_DATA_SIZE);
static inline void zpci_err_insn_req(int lvl, u8 insn, u8 cc, u8 status,
u64 req, u64 offset)