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
This commit is contained in:
Andrew Turner 2018-07-30 14:25:17 +00:00
parent d0a179019f
commit cd2106eaea
2 changed files with 2 additions and 2 deletions

View file

@ -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];

View file

@ -178,7 +178,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET data");
* 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