diff options
author | kib <kib@FreeBSD.org> | 2016-03-16 17:01:24 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-03-16 17:01:24 +0000 |
commit | b277b561e8f6b60a60e4bc085ccb12514cc5ab1c (patch) | |
tree | 2972d89bbda5d158f87b2a8c404101941fded9e3 /sys/amd64 | |
parent | 3b2ab8b89b525fe415be72fdf3de5e59aedc0331 (diff) | |
download | FreeBSD-src-b277b561e8f6b60a60e4bc085ccb12514cc5ab1c.zip FreeBSD-src-b277b561e8f6b60a60e4bc085ccb12514cc5ab1c.tar.gz |
MFC r296908:
Force the desired alignment of the user save area.
Approved by: re (marius)
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index bcc68c0..aaa3741 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -100,8 +100,8 @@ get_pcb_user_save_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size; - KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN); + KASSERT((p % XSAVE_AREA_ALIGN) == 0, ("Unaligned pcb_user_save area")); return ((struct savefpu *)p); } @@ -120,7 +120,8 @@ get_pcb_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size - sizeof(struct pcb); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN) - + sizeof(struct pcb); return ((struct pcb *)p); } |