Re: Fix kernel stack alignment on riscv64

2022-02-23 Thread Mark Kettenis
> Date: Wed, 23 Feb 2022 14:18:40 + > From: Visa Hankala > > So far this patch has worked fine on my test system. Cool. I'm a little bit bothered by that 0x10 in the calculation, and maybe that can go now. But that is cleanup for later. Making the allocation explicit is progress. ok kett

Re: Fix kernel stack alignment on riscv64

2022-02-23 Thread Visa Hankala
So far this patch has worked fine on my test system. On Tue, Feb 22, 2022 at 06:41:31PM +, Visa Hankala wrote: > Index: arch/riscv64/include/frame.h > === > RCS file: src/sys/arch/riscv64/include/frame.h,v > retrieving revision 1.

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 07:04:23PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 17:45:26 + > > From: Visa Hankala > > > > On Tue, Feb 22, 2022 at 06:13:54PM +0100, Mark Kettenis wrote: > > > > Date: Tue, 22 Feb 2022 16:59:24 + > > > > From: Visa Hankala > > > > > > > > On Tue,

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Mark Kettenis
> Date: Tue, 22 Feb 2022 17:45:26 + > From: Visa Hankala > > On Tue, Feb 22, 2022 at 06:13:54PM +0100, Mark Kettenis wrote: > > > Date: Tue, 22 Feb 2022 16:59:24 + > > > From: Visa Hankala > > > > > > On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > > > > Date: Tue, 22

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 06:13:54PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 16:59:24 + > > From: Visa Hankala > > > > On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > > > Date: Tue, 22 Feb 2022 15:58:31 + > > > > From: Visa Hankala > > > > > > > > The sta

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Mark Kettenis
> Date: Tue, 22 Feb 2022 16:59:24 + > From: Visa Hankala > > On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > > Date: Tue, 22 Feb 2022 15:58:31 + > > > From: Visa Hankala > > > > > > The standard RISC-V calling convention says that the stack pointer > > > should be 16-

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
On Tue, Feb 22, 2022 at 05:31:31PM +0100, Mark Kettenis wrote: > > Date: Tue, 22 Feb 2022 15:58:31 + > > From: Visa Hankala > > > > The standard RISC-V calling convention says that the stack pointer > > should be 16-byte aligned. > > > > The patch below corrects the alignment of the kernel s

Re: Fix kernel stack alignment on riscv64

2022-02-22 Thread Mark Kettenis
> Date: Tue, 22 Feb 2022 15:58:31 + > From: Visa Hankala > > The standard RISC-V calling convention says that the stack pointer > should be 16-byte aligned. > > The patch below corrects the alignment of the kernel stack in context > switching and exception handling. > > OK? Is there a reas

Fix kernel stack alignment on riscv64

2022-02-22 Thread Visa Hankala
The standard RISC-V calling convention says that the stack pointer should be 16-byte aligned. The patch below corrects the alignment of the kernel stack in context switching and exception handling. OK? The diff reveals that curcpu is stored in an unnamed spot near the upper end of u-area when ru