From nobody Sun Jan 02 19:08:08 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A1FA191F246; Sun, 2 Jan 2022 19:08:10 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JRpLK0vyXz4Xpj; Sun, 2 Jan 2022 19:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B283817148; Sun, 2 Jan 2022 19:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 202J88hM057667; Sun, 2 Jan 2022 19:08:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 202J88XR057666; Sun, 2 Jan 2022 19:08:08 GMT (envelope-from git) Date: Sun, 2 Jan 2022 19:08:08 GMT Message-Id: <202201021908.202J88XR057666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0ceca7923f5b - stable/13 - Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0ceca7923f5bc0b17e3fd41b80f1904b23308014 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641150489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yaIx0AMiFywo64cMJNadrzvnCFEULkcT+P6YOtyApH4=; b=QJ+D8kJ7zKY4/gtbffSvPBAULJYnwjehJSOt3O5JWCVJJGtoorN73TrkIox8FU/SEVuG7k ZqpLUeTMmEvmcOl2D4+cykAWKhnr+V9bw8ejX+Y48BLqvtKZungNwEejTOSPpX8Jw3OdXQ ib0ilA3G1vK8I2+5QdUej8EFc/cGL8Vc8vkEmRIhqZZVSYs9gUf3ed9NzrkJzW9YA5jEig 8HPcgWFXjvm1YoqidcPinNyD+iCBKVHSR8TD1gkhnuK2B9Svb4Go4p91Mktd5rDON1bC4p l5nTLJLj0OWPSKeE7vRufa009iBvmjArIyL5UOp0b2HRB5qomzvhfCECNXTKzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641150489; a=rsa-sha256; cv=none; b=lXwSoxcOvcuRru3N0F1iPcU6vN2H2yfaGXfQcYV4d0Zw1IRyvnj40GCgLYEb6ubTN1G0ak PczaCItLU8GZIM7c5ZVkORPdhmdVoRqDabZPo27UFH5ybrlk03r+EdQDT5sfjmghLp0lBu QogeRtFmIWrzrGtS20Gp8ASpmXNYGLp/X83y0ehQLkbTU2xjhHYYZUvogv/8etfKFV47rO iRF7Rbb9u0WPUAbFWFvX5MKHyUc8Lm8aZq8IgPVbSoP9anPz0rbamQWWuYEwjV6rbWEqoo zMr/twhaQqdUJQ8fZSulksctiSPNtxd1rNIqX5nENOCN7wkxAao1SRU8cUOZGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ceca7923f5bc0b17e3fd41b80f1904b23308014 commit 0ceca7923f5bc0b17e3fd41b80f1904b23308014 Author: Dmitry Chagin AuthorDate: 2021-07-20 06:53:21 +0000 Commit: Konstantin Belousov CommitDate: 2022-01-02 16:43:00 +0000 Modify exec_sysvec_init() to allow non-native abi to setup their sysentvecs. (cherry picked from commit 21629e2a456446bff101813a16f8cba046f44176) --- sys/kern/kern_sharedpage.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_sharedpage.c b/sys/kern/kern_sharedpage.c index 6f14117abf39..335f49b7a9f6 100644 --- a/sys/kern/kern_sharedpage.c +++ b/sys/kern/kern_sharedpage.c @@ -308,27 +308,43 @@ exec_sysvec_init(void *param) #ifdef RANDOM_FENESTRASX ptrdiff_t base; #endif + u_int flags; sv = (struct sysentvec *)param; - if ((sv->sv_flags & SV_SHP) == 0) + flags = sv->sv_flags; + if ((flags & SV_SHP) == 0) return; + MPASS(sv->sv_shared_page_obj == NULL); + MPASS(sv->sv_shared_page_base != 0); + sv->sv_shared_page_obj = shared_page_obj; - sv->sv_sigcode_base = sv->sv_shared_page_base + - shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); - if ((sv->sv_flags & SV_ABI_MASK) != SV_ABI_FREEBSD) - return; - if ((sv->sv_flags & SV_TIMEKEEP) != 0) { + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + sv->sv_sigcode_base = sv->sv_shared_page_base + + shared_page_fill(*(sv->sv_szsigcode), 16, sv->sv_sigcode); + } + if ((flags & SV_TIMEKEEP) != 0) { #ifdef COMPAT_FREEBSD32 - if ((sv->sv_flags & SV_ILP32) != 0) { - KASSERT(compat32_svtk == NULL, - ("Compat32 already registered")); - compat32_svtk = alloc_sv_tk_compat32(); + if ((flags & SV_ILP32) != 0) { + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + KASSERT(compat32_svtk == NULL, + ("Compat32 already registered")); + compat32_svtk = alloc_sv_tk_compat32(); + } else { + KASSERT(compat32_svtk != NULL, + ("Compat32 not registered")); + } sv->sv_timekeep_base = sv->sv_shared_page_base + compat32_svtk->sv_timekeep_off; } else { #endif - KASSERT(host_svtk == NULL, ("Host already registered")); - host_svtk = alloc_sv_tk(); + if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD) { + KASSERT(host_svtk == NULL, + ("Host already registered")); + host_svtk = alloc_sv_tk(); + } else { + KASSERT(host_svtk != NULL, + ("Host not registered")); + } sv->sv_timekeep_base = sv->sv_shared_page_base + host_svtk->sv_timekeep_off; #ifdef COMPAT_FREEBSD32 @@ -336,7 +352,8 @@ exec_sysvec_init(void *param) #endif } #ifdef RANDOM_FENESTRASX - if ((sv->sv_flags & SV_RNG_SEED_VER) != 0) { + if ((flags & (SV_ABI_MASK | SV_RNG_SEED_VER)) == + (SV_ABI_FREEBSD | SV_RNG_SEED_VER)) { /* * Only allocate a single VDSO entry for multiple sysentvecs, * i.e., native and COMPAT32.