Date: Wed, 12 Aug 2020 18:45:37 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364176 - head/sys/riscv/include Message-ID: <202008121845.07CIjbvT078573@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Aug 12 18:45:36 2020 New Revision: 364176 URL: https://svnweb.freebsd.org/changeset/base/364176 Log: Correct padding length for RISC-V PCPU data. There was an additional 7 bytes of compiler-inserted padding at the end of the structure visible via 'ptype /o' in gdb. Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25867 Modified: head/sys/riscv/include/pcpu.h head/sys/riscv/include/pcpu_aux.h Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Wed Aug 12 18:35:21 2020 (r364175) +++ head/sys/riscv/include/pcpu.h Wed Aug 12 18:45:36 2020 (r364176) @@ -48,7 +48,7 @@ struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ uint32_t pc_hart; /* Hart ID */ \ - char __pad[49] + char __pad[56] /* Pad to factor of PAGE_SIZE */ #ifdef _KERNEL Modified: head/sys/riscv/include/pcpu_aux.h ============================================================================== --- head/sys/riscv/include/pcpu_aux.h Wed Aug 12 18:35:21 2020 (r364175) +++ head/sys/riscv/include/pcpu_aux.h Wed Aug 12 18:45:36 2020 (r364176) @@ -46,6 +46,9 @@ * be a multiple of the size of struct pcpu. */ _Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size"); +_Static_assert(offsetof(struct pcpu, __pad) + + sizeof(((struct pcpu *)0)->__pad) == sizeof(struct pcpu), + "fix pcpu padding"); extern struct pcpu __pcpu[];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008121845.07CIjbvT078573>