From owner-svn-src-stable-12@freebsd.org Sat Nov 2 19:46:40 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BCAC161A59; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4758hJ1GCGz461J; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E65A4C8; Sat, 2 Nov 2019 19:46:40 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA2JkdSH050085; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA2JkdjX050083; Sat, 2 Nov 2019 19:46:39 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201911021946.xA2JkdjX050083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Sat, 2 Nov 2019 19:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354260 - in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 kern riscv/riscv X-SVN-Commit-Revision: 354260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 19:46:40 -0000 Author: mhorne Date: Sat Nov 2 19:46:39 2019 New Revision: 354260 URL: https://svnweb.freebsd.org/changeset/base/354260 Log: MFC r340228-r340229, r340231 r340228 by jhb: Enable use of a global shared page for RISC-V. machine/vmparam.h already defines the SHAREDPAGE constant. This change just enables it for ELF executables. The only use of the shared page currently is to hold the signal trampoline. Reviewed by: markj, kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17875 r340229 by jhb: Drop the legacy ELF brandinfo for the old rtld from arm64 and riscv. These architectures never shipped binaries with an rtld path of /usr/libexec/ld-elf.so.1. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17876 r340231 by jhb: Enable non-executable stacks by default on RISC-V. Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17878 Modified: stable/12/sys/arm64/arm64/elf_machdep.c stable/12/sys/kern/imgact_elf.c stable/12/sys/riscv/riscv/elf_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/elf_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/arm64/arm64/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -107,21 +107,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_AARCH64, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); - void elf64_dump_thread(struct thread *td __unused, void *dst __unused, size_t *off __unused) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/kern/imgact_elf.c Sat Nov 2 19:46:39 2019 (r354260) @@ -119,7 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), int __elfN(nxstack) = #if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \ - (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) + (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) || \ + defined(__riscv) 1; #else 0; Modified: stable/12/sys/riscv/riscv/elf_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:33:02 2019 (r354259) +++ stable/12/sys/riscv/riscv/elf_machdep.c Sat Nov 2 19:46:39 2019 (r354260) @@ -84,10 +84,12 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, @@ -110,22 +112,6 @@ static Elf64_Brandinfo freebsd_brand_info = { SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); - -static Elf64_Brandinfo freebsd_brand_oinfo = { - .brand = ELFOSABI_FREEBSD, - .machine = EM_RISCV, - .compat_3_brand = "FreeBSD", - .emul_path = NULL, - .interp_path = "/usr/libexec/ld-elf.so.1", - .sysvec = &elf64_freebsd_sysvec, - .interp_newpath = NULL, - .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE -}; - -SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_oinfo); static int debug_kld; SYSCTL_INT(_kern, OID_AUTO, debug_kld,