From nobody Fri Jun 17 19:38:22 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 F3A7E85B0E8; Fri, 17 Jun 2022 19:38:24 +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 4LPq8b0MXYz3QQp; Fri, 17 Jun 2022 19:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494703; 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=eFgDgXX7g6y1IB1wWkqKNuR26g9W8sCEV3meu5kxdnA=; b=sNU82F6v7LsU3alOklGukgqJsD6CBCwZJMf8mUysCDj8ZArk76rqWwrXEzYpphS0jQXzpn LYqsky1U2ukSiJW/ia4nVqzdB5vo8RRgsQb4d4utZz0uHWF+o6sdmwHf5DZn+ziDbo2OCP Q6nBQeJL43+eHruJJXphAu1aa9hqNvjg3kDsyy+HzYgNdDVPTISRe8O6axjAB6D43aB1gl jwyLQZS17rqw4KQ5DrQzlzml42T/ow2kKf2BjvhBY48NEfFZggKMSosE5EtY2HcJ9FAGan ei6gIE9yo81XAShVpIOZbA0M/b/67RGIzl1JsoGF+wDNwdTeX0GXriePalG1og== 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 B7B4125AC8; Fri, 17 Jun 2022 19:38:22 +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 25HJcMX8014599; Fri, 17 Jun 2022 19:38:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJcMMZ014598; Fri, 17 Jun 2022 19:38:22 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:38:22 GMT Message-Id: <202206171938.25HJcMMZ014598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 99950e8beb72 - stable/13 - linux: Add ptrace(2) support on arm64 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99950e8beb724918b038d9982bdd233e26e2cef7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494703; 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=eFgDgXX7g6y1IB1wWkqKNuR26g9W8sCEV3meu5kxdnA=; b=Fn049LQ8030FW6ROufkvPL0GYylTjE025r1HTuN33k721s0c5fGo9Mh0/Eiv3DiCED/nyQ tlLEU8CsbFV+tKYJu4ukJIgHJksVv81GnrpO6SbJHFMS9MKEO0LQmWbTW3nJg0qYFClxcr s/x3+0vLxwPTjMxYLx92OyM7CZdNX1XEvKtN4rwfcahGysjYraYEci6KIbslU2auC6im62 CNOpd2Xq3qNmni4xYfa3eA17UWh/uRi3WeRmMUMByj+965UFGbJa8rrz6rUt2d1OiATsr3 Lc2IGrhTPLGk7JJFtzvvgtRHRny5eSOdA5aYSfoxTgRPGkm2jp5zHc9j9seoAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494703; a=rsa-sha256; cv=none; b=rGxY3f6tHtGatOTbBFIs+O1/AtzTWFTS01GkGIFkhI0rUEefJ1Yg8p+ltzDcaPCEHl+yo9 /KzEgoRguWyv4dV1CHOhzhthJjkF0m6wiaYvHAqZ0TtH9zmlo0607xMzHY9iDCW9oez8qk BLzVltMqIPF3f9aQNyWEIIpHPDjjD1O8yCIf1U9VTW5pqCGVwmky1aHPJy+tY5vpxNb/7S S1b20ve4xyqJez5vv2uwKjKDcLW3jbT4VJiJLcmrEfHBHHUtjCQ0y2jQ+Ang30QimS5DKI 4jq8xLmkUhtbq0WZ3HpORXXdnjksX9cXczfR1jQf2mCHNSVyGRhT0K0PWSPkOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=99950e8beb724918b038d9982bdd233e26e2cef7 commit 99950e8beb724918b038d9982bdd233e26e2cef7 Author: Edward Tomasz Napierala AuthorDate: 2021-11-07 08:22:41 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:37 +0000 linux: Add ptrace(2) support on arm64 This moves linux_ptrace.c from sys/amd64/linux/ to sys/compat/linux/, making it possible to use it on architectures other than amd64. It also enables Linux ptrace(2) on arm64. Relnotes: yes Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32868 (cherry picked from commit a90ff3c4bc901947a040717f39d5b3b8778047fe) --- sys/arm64/linux/linux_ptrace.c | 56 ------------------------------ sys/compat/linux/linux_misc.c | 2 +- sys/compat/linux/linux_misc.h | 2 +- sys/{amd64 => compat}/linux/linux_ptrace.c | 0 4 files changed, 2 insertions(+), 58 deletions(-) diff --git a/sys/arm64/linux/linux_ptrace.c b/sys/arm64/linux/linux_ptrace.c deleted file mode 100644 index a7d53470a12d..000000000000 --- a/sys/arm64/linux/linux_ptrace.c +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (C) 2018 Turing Robotic Industries Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include -#include -#include - -/* DTrace init */ -LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); - -/* DTrace probes */ -LIN_SDT_PROBE_DEFINE0(ptrace, linux_ptrace, todo); - -int -linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) -{ - - /* LINUXTODO: implement arm64 linux_ptrace */ - LIN_SDT_PROBE0(ptrace, linux_ptrace, todo); - return (EDOOFUS); -} diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 117b36056760..79b681ea8b62 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1024,7 +1024,7 @@ linux_common_wait(struct thread *td, int pid, int *statusp, } else if (WIFSTOPPED(tmpstat)) { tmpstat = (tmpstat & 0xffff00ff) | (bsd_to_linux_signal(WSTOPSIG(tmpstat)) << 8); -#if defined(__amd64__) && !defined(COMPAT_LINUX32) +#if defined(__aarch64__) || (defined(__amd64__) && !defined(COMPAT_LINUX32)) if (WSTOPSIG(status) == SIGTRAP) { tmpstat = linux_ptrace_status(td, siginfo.si_pid, tmpstat); diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index ceb140d3da75..bf8f3dd2f0cd 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -153,7 +153,7 @@ extern int stclohz; /* Linux syslog flags */ #define LINUX_SYSLOG_ACTION_READ_ALL 3 -#if defined(__amd64__) && !defined(COMPAT_LINUX32) +#if defined(__aarch64__) || (defined(__amd64__) && !defined(COMPAT_LINUX32)) int linux_ptrace_status(struct thread *td, int pid, int status); #endif void linux_to_bsd_waitopts(int options, int *bsdopts); diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c similarity index 100% rename from sys/amd64/linux/linux_ptrace.c rename to sys/compat/linux/linux_ptrace.c