svn commit: r336906 - in head/sys: kern net
Andrew Turner
andrew at FreeBSD.org
Mon Jul 30 14:25:19 UTC 2018
Author: andrew
Date: Mon Jul 30 14:25:17 2018
New Revision: 336906
URL: https://svnweb.freebsd.org/changeset/base/336906
Log:
Ensure the DPCPU and VNET module spaces are aligned to hold a pointer.
Previously they may have been aligned to a char, leading to misaligned
DPCPU and VNET variables.
Sponsored by: DARPA, AFRL
Modified:
head/sys/kern/subr_pcpu.c
head/sys/net/vnet.c
Modified: head/sys/kern/subr_pcpu.c
==============================================================================
--- head/sys/kern/subr_pcpu.c Mon Jul 30 14:21:49 2018 (r336905)
+++ head/sys/kern/subr_pcpu.c Mon Jul 30 14:25:17 2018 (r336906)
@@ -72,7 +72,7 @@ struct dpcpu_free {
TAILQ_ENTRY(dpcpu_free) df_link;
};
-DPCPU_DEFINE_STATIC(char, modspace[DPCPU_MODMIN]);
+DPCPU_DEFINE_STATIC(char, modspace[DPCPU_MODMIN] __aligned(__alignof(void *)));
static TAILQ_HEAD(, dpcpu_free) dpcpu_head = TAILQ_HEAD_INITIALIZER(dpcpu_head);
static struct sx dpcpu_lock;
uintptr_t dpcpu_off[MAXCPU];
Modified: head/sys/net/vnet.c
==============================================================================
--- head/sys/net/vnet.c Mon Jul 30 14:21:49 2018 (r336905)
+++ head/sys/net/vnet.c Mon Jul 30 14:25:17 2018 (r336906)
@@ -178,7 +178,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET d
* Space to store virtualized global variables from loadable kernel modules,
* and the free list to manage it.
*/
-VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN]);
+VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN] __aligned(__alignof(void *)));
/*
* Global lists of subsystem constructor and destructors for vnets. They are
More information about the svn-src-all
mailing list