Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2020 21:55:22 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365344 - head/sys/riscv/riscv
Message-ID:  <202009042155.084LtMbv030993@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009042155.084LtMbv030993>