On Wed, 2025-03-05 at 19:04 +0100, Thomas Huth wrote: [...]
> > + > > +static int write_event_data(SCLPEvent *event, EventBufferHeader > > *evt_buf_hdr) > > +{ > > + ControlProgramIdMsg *cpi = container_of(evt_buf_hdr, > > ControlProgramIdMsg, > > + ebh); > > + S390CcwMachineState *ms = S390_CCW_MACHINE(qdev_get_machine()); > > + > > + ascii_put(ms->cpi.system_type, (char *)cpi->data.system_type, 8); > > + ascii_put(ms->cpi.system_name, (char *)cpi->data.system_name, 8); > > + ascii_put(ms->cpi.sysplex_name, (char *)cpi->data.sysplex_name, 8); > > + ms->cpi.system_level = be64_to_cpu(cpi->data.system_level); > > Can we be confident that system_level is always properly aligned? It has offset 40 from the start of a heap allocation, so yes, but it is far from obvious so I wouldn't mind ldq_be_p. > Otherwise it's maybe better to use ldq_be_p() instead? > > Thomas > > -- IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294