svn commit: r365344 - head/sys/riscv/riscv

Brooks Davis brooks at FreeBSD.org
Fri Sep 4 21:55:23 UTC 2020


Author: brooks
Date: Fri Sep  4 21:55:22 2020
New Revision: 365344
URL: https://svnweb.freebsd.org/changeset/base/365344

Log:
  Round TF_SIZE up to the stack alignment (16-bytes).
  
  The kernel adjusts the stack by TF_SIZE and the RISC-V ABI requires
  that it remain 16-byte aligned.
  
  Reported by:	CHERI, jrtc27
  Reviewed by:	mhorne
  Obtained from:	CheriBSD
  Sponsored by:	DARPA
  Differential Revision:	https://reviews.freebsd.org/D26328

Modified:
  head/sys/riscv/riscv/genassym.c

Modified: head/sys/riscv/riscv/genassym.c
==============================================================================
--- head/sys/riscv/riscv/genassym.c	Fri Sep  4 21:48:36 2020	(r365343)
+++ head/sys/riscv/riscv/genassym.c	Fri Sep  4 21:55:22 2020	(r365344)
@@ -87,7 +87,7 @@ ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
 ASSYM(TD_MD, offsetof(struct thread, td_md));
 ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
 
-ASSYM(TF_SIZE, sizeof(struct trapframe));
+ASSYM(TF_SIZE, roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1));
 ASSYM(TF_RA, offsetof(struct trapframe, tf_ra));
 ASSYM(TF_SP, offsetof(struct trapframe, tf_sp));
 ASSYM(TF_GP, offsetof(struct trapframe, tf_gp));


More information about the svn-src-head mailing list