On 2025-03-05 20:00, Nina Schoetterl-Glausch wrote:
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.
ok, I will use ldc_be_p() instead, thank you Nina.
Otherwise it's maybe better to use ldq_be_p() instead?
Thomas
--
Mit freundlichen Grüßen / Kind regards
Shalini Chellathurai Saroja
Software Developer
Linux on IBM Z & KVM Development
IBM Deutschland Research & Development GmbH
Dept 1419, Schoenaicher Str. 220, 71032 Boeblingen
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht
Stuttgart, HRB 243294