amd64: cpu_info: rearrange members, keep ci_mds_tmp 32-byte aligned
authorcheloha <cheloha@openbsd.org>
Tue, 4 Jul 2023 17:29:32 +0000 (17:29 +0000)
committercheloha <cheloha@openbsd.org>
Tue, 4 Jul 2023 17:29:32 +0000 (17:29 +0000)
commita8972bbdccfe12ff7cd06e6c7b306bd7d7b7c727
tree38f7ae96467750f000376143080ff96b23e60d06
parent5dfb914b63d9dac6504bd370f3d9accd4cb0421f
amd64: cpu_info: rearrange members, keep ci_mds_tmp 32-byte aligned

ci_mds_tmp needs to be 32-byte aligned, otherwise we trip a CTASSERT
in amd64/cpu.c and break kernel compilation.  However, ci_mds_tmp's
32-byte alignment is at risk: the size of schedstate_percpu is about
to change.

Move ci_curproc and ci_schedstate up just after ci_mds_buf.  This puts
ci_mds_tmp at page offset 64 with no structs ahead of it in cpu_info.
With this arrangement it should remain 32-byte aligned without much
effort.

With input from guenther@.

ok guenther@
sys/arch/amd64/include/cpu.h