summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorScott Soule Cheloha <cheloha@cvs.openbsd.org>2023-07-04 17:29:33 +0000
committerScott Soule Cheloha <cheloha@cvs.openbsd.org>2023-07-04 17:29:33 +0000
commitde489bda99b4491c27c240b1cf1457dbbc89df7b (patch)
treefdb48d490d988421f1d2ca9c012de35a3ce0c344 /sys
parent7642ce5ebdcd726ee5f698a905acfeb250dad9a4 (diff)
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@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/include/cpu.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index eea800a78ff..d9980176657 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.154 2022/11/29 21:41:39 guenther Exp $ */
+/* $OpenBSD: cpu.h,v 1.155 2023/07/04 17:29:32 cheloha Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -112,10 +112,8 @@ struct cpu_info {
#define ci_PAGEALIGN ci_dev
struct device *ci_dev; /* [I] */
struct cpu_info *ci_self; /* [I] */
- struct schedstate_percpu ci_schedstate; /* scheduler state */
struct cpu_info *ci_next; /* [I] */
- struct proc *ci_curproc; /* [o] */
u_int ci_cpuid; /* [I] */
u_int ci_apicid; /* [I] */
u_int ci_acpi_proc_id; /* [I] */
@@ -129,6 +127,9 @@ struct cpu_info {
char ci_mds_tmp[32]; /* [o] 32byte aligned */
void *ci_mds_buf; /* [I] */
+ struct proc *ci_curproc; /* [o] */
+ struct schedstate_percpu ci_schedstate; /* scheduler state */
+
struct pmap *ci_proc_pmap; /* last userspace pmap */
struct pcb *ci_curpcb; /* [o] */
struct pcb *ci_idle_pcb; /* [o] */