From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343647542461.38615872132164; Sun, 7 Nov 2021 19:54:07 -0800 (PST) Received: from [::1] (port=37576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvjS-0000V3-Ct for importer@patchew.org; Sun, 07 Nov 2021 22:54:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhe-0005zW-QR for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:14 -0500 Received: from [2607:f8b0:4864:20::136] (port=33567 helo=mail-il1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhc-0002nk-9i for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:14 -0500 Received: by mail-il1-x136.google.com with SMTP id l19so15626102ilk.0 for ; Sun, 07 Nov 2021 19:52:11 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g/bcMnK09mA61YDjbq505/3gEhhtbTNE0YI5skGQUVE=; b=VXgU9VRhZ8275E6BaIIzfLAfEgPXUyfwjcW1Pe7Z343h32CdhBweZu6kD/f9sd22/0 05Yd4PhJOwmZXc8NT/qEAV+9Fs1Rd9AyAdaFxbwKi/TkgMC93M/DxC2rnlmQENzpBmsU J+c+CVaWQZ80HjgJE3ntY4f51kr0wqOTlz7PIGlYzp5wsuoG6VI7E6rwO7am4r9bdFip 2bdEUo4h2Mss9uS0VwBwcDcE2Fyyiur6CyrbFmLsFo8WprWTubFbr9JBV425c4p1LIqu GgKO9bBNcL++t7UwTWS30H5ZuwaY08/Pp21KTxbANf9UKhkPMrIuGUf1SY/MsgSehr37 VSfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g/bcMnK09mA61YDjbq505/3gEhhtbTNE0YI5skGQUVE=; b=jD1eKG84sM4tZB7XKQnq9pLxVvQh1DqskLf2Ki4huiiYqMD5bki5HxV+bdqRu5tiXd GKXME9TVGV/xykRIjfTkJPl/ZqHJqTbdt+0EHz5Q7bAELDHZDR+ZaMgIJYJnwr3zjqdU b5ZJelnW8IIv0mQwOjnZVCVI0oVLkz6C6nHhrtQCnlovyVcx2fY4b4PYJ0q2BYlnQXGA ba5qznYFZFHhK/zTpD1FBGswR5gaeNVW3nJWa9YtLehcBVVgpjwsx0/win7xM0YmZpOW b8rXagGmpBuZlf2ItxdOKtJyQXkD0iGqRMP/iBXi0tVu9cDXHeXyTjzWor5ZaNvZXvDN +2cA== X-Gm-Message-State: AOAM531FAoYmogMFBLxSct1HxFWcVqhZ6X2Qg1gw0w4lXUlyy2kO14BL fkpaevPQlKEC6jmqfehH6A7R5LiN/cKOuQ== X-Google-Smtp-Source: ABdhPJyykepfs483xaeygC4BTCRgShTNmEra46qhJZSAAf9KbtUqSqC4qsHzrMVkZElY7+bC1IhvUQ== X-Received: by 2002:a05:6e02:1bef:: with SMTP id y15mr43517342ilv.11.1636343530933; Sun, 07 Nov 2021 19:52:10 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 01/37] bsd-user/mips*: Remove mips support Date: Sun, 7 Nov 2021 20:51:00 -0700 Message-Id: <20211108035136.43687-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::136 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343648097100005 Content-Type: text/plain; charset="utf-8" FreeBSD is dropping support for mips starting with FreeBSD 14. mips support has been removed from the bsd-user fork because updating it for new signal requirements will take too much time. Remove it here since it is a distraction. Signed-off-by: Warner Losh Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- bsd-user/mips/target_arch_sysarch.h | 69 --------------------------- bsd-user/mips/target_syscall.h | 52 -------------------- bsd-user/mips64/target_arch_sysarch.h | 69 --------------------------- bsd-user/mips64/target_syscall.h | 53 -------------------- 4 files changed, 243 deletions(-) delete mode 100644 bsd-user/mips/target_arch_sysarch.h delete mode 100644 bsd-user/mips/target_syscall.h delete mode 100644 bsd-user/mips64/target_arch_sysarch.h delete mode 100644 bsd-user/mips64/target_syscall.h diff --git a/bsd-user/mips/target_arch_sysarch.h b/bsd-user/mips/target_arc= h_sysarch.h deleted file mode 100644 index 6da803a408..0000000000 --- a/bsd-user/mips/target_arch_sysarch.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * mips sysarch() system call emulation - * - * Copyright (c) 2013 Stacey D. Son - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#ifndef BSD_USER_ARCH_SYSARCH_H_ -#define BSD_USER_ARCH_SYSARCH_H_ - -#include "target_syscall.h" -#include "target_arch.h" - -static inline abi_long do_freebsd_arch_sysarch(CPUMIPSState *env, int op, - abi_ulong parms) -{ - int ret =3D 0; - - switch (op) { - case TARGET_MIPS_SET_TLS: - target_cpu_set_tls(env, parms); - break; - - case TARGET_MIPS_GET_TLS: - if (put_user(target_cpu_get_tls(env), parms, abi_ulong)) { - ret =3D -TARGET_EFAULT; - } - break; - - default: - ret =3D -TARGET_EINVAL; - break; - } - - return ret; -} - -static inline void do_freebsd_arch_print_sysarch( - const struct syscallname *name, abi_long arg1, abi_long arg2, - abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) -{ - - switch (arg1) { - case TARGET_MIPS_SET_TLS: - gemu_log("%s(SET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); - break; - - case TARGET_MIPS_GET_TLS: - gemu_log("%s(GET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); - break; - - default: - gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2= ); - } -} - -#endif /*!BSD_USER_ARCH_SYSARCH_H_ */ diff --git a/bsd-user/mips/target_syscall.h b/bsd-user/mips/target_syscall.h deleted file mode 100644 index aacc6ddf9f..0000000000 --- a/bsd-user/mips/target_syscall.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * mips system call definitions - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ -#ifndef _MIPS_SYSCALL_H_ -#define _MIPS_SYSCALL_H_ - -/* - * struct target_pt_regs defines the way the registers are stored on the s= tack - * during a system call. - */ - -struct target_pt_regs { - /* Saved main processor registers. */ - abi_ulong regs[32]; - - /* Saved special registers. */ - abi_ulong cp0_status; - abi_ulong lo; - abi_ulong hi; - abi_ulong cp0_badvaddr; - abi_ulong cp0_cause; - abi_ulong cp0_epc; -}; - -#if defined(TARGET_WORDS_BIGENDIAN) -#define UNAME_MACHINE "mips" -#else -#define UNAME_MACHINE "mipsel" -#endif - -#define TARGET_HW_MACHINE "mips" -#define TARGET_HW_MACHINE_ARCH UNAME_MACHINE - -/* sysarch() commands */ -#define TARGET_MIPS_SET_TLS 1 -#define TARGET_MIPS_GET_TLS 2 - -#endif /* !_MIPS_SYSCALL_H_ */ diff --git a/bsd-user/mips64/target_arch_sysarch.h b/bsd-user/mips64/target= _arch_sysarch.h deleted file mode 100644 index e6f9c00d5f..0000000000 --- a/bsd-user/mips64/target_arch_sysarch.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * mips64 sysarch() system call emulation - * - * Copyright (c) 2013 Stacey D. Son - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#ifndef BSD_USER_ARCH_SYSARCH_H_ -#define BSD_USER_ARCH_SYSARCH_H_ - -#include "target_syscall.h" -#include "target_arch.h" - -static inline abi_long do_freebsd_arch_sysarch(CPUMIPSState *env, int op, - abi_ulong parms) -{ - int ret =3D 0; - - switch (op) { - case TARGET_MIPS_SET_TLS: - target_cpu_set_tls(env, parms); - break; - - case TARGET_MIPS_GET_TLS: - if (put_user(target_cpu_get_tls(env), parms, abi_ulong)) { - ret =3D -TARGET_EFAULT; - } - break; - - default: - ret =3D -TARGET_EINVAL; - break; - } - - return ret; -} - -static inline void do_freebsd_arch_print_sysarch( - const struct syscallname *name, abi_long arg1, abi_long arg2, - abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) -{ - - switch (arg1) { - case TARGET_MIPS_SET_TLS: - gemu_log("%s(SET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); - break; - - case TARGET_MIPS_GET_TLS: - gemu_log("%s(GET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); - break; - - default: - gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2= ); - } -} - -#endif /*!BSD_USER_ARCH_SYSARCH_H_ */ diff --git a/bsd-user/mips64/target_syscall.h b/bsd-user/mips64/target_sysc= all.h deleted file mode 100644 index bf4c598b13..0000000000 --- a/bsd-user/mips64/target_syscall.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * mips64 system call definitions - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ -#ifndef _MIPS64_SYSCALL_H_ -#define _MIPS64_SYSCALL_H_ - -/* - * struct target_pt_regs defines the way the registers are stored on the s= tack - * during a system call. - */ - -struct target_pt_regs { - /* Saved main processor registers. */ - abi_ulong regs[32]; - - /* Saved special registers. */ - abi_ulong cp0_status; - abi_ulong lo; - abi_ulong hi; - abi_ulong cp0_badvaddr; - abi_ulong cp0_cause; - abi_ulong cp0_epc; -}; - - -#if defined(TARGET_WORDS_BIGENDIAN) -#define UNAME_MACHINE "mips64" -#else -#define UNAME_MACHINE "mips64el" -#endif - -#define TARGET_HW_MACHINE "mips" -#define TARGET_HW_MACHINE_ARCH UNAME_MACHINE - -/* sysarch() commands */ -#define TARGET_MIPS_SET_TLS 1 -#define TARGET_MIPS_GET_TLS 2 - -#endif /* !_MIPS64_SYSCALL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343773142363.43964730760854; Sun, 7 Nov 2021 19:56:13 -0800 (PST) Received: from [::1] (port=45936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvlU-00067L-5w for importer@patchew.org; Sun, 07 Nov 2021 22:56:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhf-0005zk-2k for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:15 -0500 Received: from [2607:f8b0:4864:20::d31] (port=41566 helo=mail-io1-xd31.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhd-0002nv-2p for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:14 -0500 Received: by mail-io1-xd31.google.com with SMTP id p193so17419316iod.8 for ; Sun, 07 Nov 2021 19:52:12 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FnZV5yZZtImm0a3Lr70JdB+t8rtGyZo6MRXcETRGQ/U=; b=m+N0bC0T/7jrW7Mm/HchCTGApQm/zAlLTi8wpSxBKm2LDwvhh0wRWeZGY9KBDGAXeh k77Z7UqsmuARYprJRpef8JxlnI38my7qD82hlLETcSaHil7acK9V7xmcieTSLrPKPv4G rz3sNvXbAIMKp0DYzQMA9yksaxom/BoDnR00bOPhyjahDye4cGKMSneDwoVlzOo4wWx6 2Mhj19j/fmaaLrgKHSuE3BgVNbIgJLJcBSU4QnIRekwy3ygn4fNmyBTB6TmJ7d+mhHtz THTrLSjGQfqa4gK/QJYVc/zcJnSeqsx7Mxc+Ih0tHMw16+QPCyppwVXlIA8SO2ePu/F0 ENhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FnZV5yZZtImm0a3Lr70JdB+t8rtGyZo6MRXcETRGQ/U=; b=3ZXA2NgcfZkHufJSjJPnxsolYnVaTW7zoOnNmjjTN5FPthEDvDTlvKpRvTqew8RP4f XscTcJzZ/mkAlGz3Rz8ToiTsRjRxnGF+b+JYPYWPzksHEazCSPjt7pRlnx6LqGb6qa0l JahedpdiIsoMhkbzcSUQQIvE1JstfhNNyWnrICO05XIy18ZCHBEKsxPbn4OQCzqHc/NF /rl/jVLCCiwCep9+SkqCtgiChRIycDVvAMqW32xn2C/+hDte5CbBwB7t50uoa32XqOH5 9ly39nsePQ/mZ0lGSIfNaaTfXHBF5MGkqdcWBJ/F/Hp9Ng9EdYTcL4iJCeRl1bCtzq1e zKLg== X-Gm-Message-State: AOAM530APaHkII0akNI1ll3IG4Sy+CJfbaCjDSTtanTEMbLxFbf8NQs8 P2BUGFIP5kb0gQv633mLdhle5ETQ5t4eUQ== X-Google-Smtp-Source: ABdhPJzPPagBpun2c0anJKbYboNkN8mwQm9hYemgvLGnnmGh2TgXA5GGG4Fo6ciT4bHf5t2eCnWS4Q== X-Received: by 2002:a02:a314:: with SMTP id q20mr5286302jai.104.1636343531764; Sun, 07 Nov 2021 19:52:11 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 02/37] bsd-user/freebsd: Create common target_os_ucontext.h file Date: Sun, 7 Nov 2021 20:51:01 -0700 Message-Id: <20211108035136.43687-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d31 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343774553100001 Content-Type: text/plain; charset="utf-8" FreeBSD has a MI ucontext structure that contains the MD mcontext machine state and other things that are machine independent. Create an include file for all the ucontext stuff. It needs to be included in the arch specific files after target_mcontext is defined. This is largely copied from sys/_ucontext.h with the comments about layout removed because we don't support ancient FreeBSD binaries. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_signal.h | 3 --- bsd-user/freebsd/target_os_ucontext.h | 35 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 bsd-user/freebsd/target_os_ucontext.h diff --git a/bsd-user/freebsd/target_os_signal.h b/bsd-user/freebsd/target_= os_signal.h index 1a4c5faf19..3ed454e086 100644 --- a/bsd-user/freebsd/target_os_signal.h +++ b/bsd-user/freebsd/target_os_signal.h @@ -1,9 +1,6 @@ #ifndef _TARGET_OS_SIGNAL_H_ #define _TARGET_OS_SIGNAL_H_ =20 -/* FreeBSD's sys/ucontext.h defines this */ -#define TARGET_MC_GET_CLEAR_RET 0x0001 - #include "target_os_siginfo.h" #include "target_arch_signal.h" =20 diff --git a/bsd-user/freebsd/target_os_ucontext.h b/bsd-user/freebsd/targe= t_os_ucontext.h new file mode 100644 index 0000000000..1d0c3c4e65 --- /dev/null +++ b/bsd-user/freebsd/target_os_ucontext.h @@ -0,0 +1,35 @@ +/* + * FreeBSD has a common ucontext definition for all architectures. + * + * Copyright 2021 Warner Losh + * + * SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause + */ +#ifndef TARGET_OS_UCONTEXT_H +#define TARGET_OS_UCONTEXT_H + +/* + * Defines the common bits for all of FreeBSD's architectures. Has to be + * included AFTER the MD target_mcontext_t is defined, however, so can't + * be in the grab-bag that is target_os_signal.h. + */ + +/* See FreeBSD's sys/ucontext.h */ +#define TARGET_MC_GET_CLEAR_RET 0x0001 + +/* FreeBSD's sys/_ucontext.h structures */ +typedef struct target_ucontext { + target_sigset_t uc_sigmask; + target_mcontext_t uc_mcontext; + abi_ulong uc_link; + target_stack_t uc_stack; + int32_t uc_flags; + int32_t __spare__[4]; +} target_ucontext_t; + +#ifdef TARGET_MCONTEXT_SIZE +G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE =3D=3D sizeof(target_mcontext_t)); +G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE =3D=3D sizeof(target_ucontext_t)); +#endif /* TARGET_MCONTEXT_SIZE */ + +#endif /* TARGET_OS_UCONTEXT_H */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343645556196.07091757790158; Sun, 7 Nov 2021 19:54:05 -0800 (PST) Received: from [::1] (port=37412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvjQ-0000My-2v for importer@patchew.org; Sun, 07 Nov 2021 22:54:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhf-00060H-Co for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:15 -0500 Received: from [2607:f8b0:4864:20::d34] (port=37850 helo=mail-io1-xd34.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhd-0002o4-SN for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:15 -0500 Received: by mail-io1-xd34.google.com with SMTP id k21so80909ioh.4 for ; Sun, 07 Nov 2021 19:52:13 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4/CwsutaIOyDt2WjHRLiQgEBPJ5vyd4yg3qN35Y9Ogo=; b=YicToWzSexndkpQoE7u/jETLTD4+gfvW2i099/jciU9HV9sE5nfmXOqMMiAiT4e35F A9l0O6rYvbFNc6tKrvb/6oOG2miMQiHTgOAgapkrRppoSngI/D+dJGHnhfBkNJ1hgHvC XQVbpLijy0gm7Du/nkI+QH/FrMnl0eFyiMa4aCPmAP3exIL69zv7938yeynJNca7NMCT GKIK90Rlpx8mp+wMX7I9j3rwT5AZYmqhfYwkLnqrELv/EZUT3X6yB//0+WfmQGqX+FvP O7tG82F0SXMeKQWyyVWEANq8YcntuTNVQusm/Yd/Dcwq0NnDbDTrMvZzR0k7lJanHAru UgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4/CwsutaIOyDt2WjHRLiQgEBPJ5vyd4yg3qN35Y9Ogo=; b=VFe37o/m0yOseunFmE8aaAoZBdsHXkjjCYz+jiZgwTvHvfjFdI0y9kleTna8Dp6aB3 i+FHKp/AvbjYwMhYexSGzv+YqloJUb0dfOy2F9zGh8dLxy2kx0WVZWaBMdGLaHU3oTCR JcK1iemvUh6fPpqxUH6G3EdVfhG5Nk9WLJ/V6ZiqMSWM89CdH2sKEHhvZM1dHc9XYXCw sK6uF345GQhWXNn9l5D3jYatJWptm6DiPpdzwMkLXKm+W8N+UeMDjheT+7sH4HdIAp11 qkuHxMQyMQUJnpXILUpP/IEytxAkph6/vm7LQx+AaNr3pQW3rjIJXuI3DWazKXBIYSB1 zFkw== X-Gm-Message-State: AOAM532zIkhjOPZ26S4LGrQj4zOPtCi9qXtzFAwnAhPp8HX/Prk74xsL J13k+8lPTv9ZUoZ3v+cmJAJ4J6E97otLNw== X-Google-Smtp-Source: ABdhPJyZse4gQcD7NeFqUEhTNrfbfHzyufmnvF3lCNeiR54F4YWMsfuKIL+6DyOMchpMA0fpbqCGiA== X-Received: by 2002:a6b:f706:: with SMTP id k6mr10431594iog.155.1636343532682; Sun, 07 Nov 2021 19:52:12 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 03/37] bsd-user: create a per-arch signal.c file Date: Sun, 7 Nov 2021 20:51:02 -0700 Message-Id: <20211108035136.43687-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d34 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d34; envelope-from=imp@bsdimp.com; helo=mail-io1-xd34.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343646006100003 Content-Type: text/plain; charset="utf-8" Create a place-holder signal.c file for each of the architectures that are currently built. In the future, some code that's currently inlined in target_arch_signal.h will live here. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/signal.c | 1 + bsd-user/x86_64/signal.c | 1 + meson.build | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 bsd-user/i386/signal.c create mode 100644 bsd-user/x86_64/signal.c diff --git a/bsd-user/i386/signal.c b/bsd-user/i386/signal.c new file mode 100644 index 0000000000..ac90323365 --- /dev/null +++ b/bsd-user/i386/signal.c @@ -0,0 +1 @@ +/* Placeholder for signal.c */ diff --git a/bsd-user/x86_64/signal.c b/bsd-user/x86_64/signal.c new file mode 100644 index 0000000000..ac90323365 --- /dev/null +++ b/bsd-user/x86_64/signal.c @@ -0,0 +1 @@ +/* Placeholder for signal.c */ diff --git a/meson.build b/meson.build index 26c58123e9..14b0bb2042 100644 --- a/meson.build +++ b/meson.build @@ -2888,7 +2888,7 @@ foreach target : target_dirs base_dir =3D 'bsd-user' target_inc +=3D include_directories('bsd-user/' / targetos) dir =3D base_dir / abi - arch_srcs +=3D files(dir / 'target_arch_cpu.c') + arch_srcs +=3D files(dir / 'signal.c', dir / 'target_arch_cpu.c') endif target_inc +=3D include_directories( base_dir, --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343647890581.1396986386677; Sun, 7 Nov 2021 19:54:07 -0800 (PST) Received: from [::1] (port=37722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvjS-0000aq-RG for importer@patchew.org; Sun, 07 Nov 2021 22:54:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhg-00061h-DL for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:16 -0500 Received: from [2607:f8b0:4864:20::d29] (port=41559 helo=mail-io1-xd29.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhe-0002oW-M8 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:16 -0500 Received: by mail-io1-xd29.google.com with SMTP id p193so17419359iod.8 for ; Sun, 07 Nov 2021 19:52:14 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rOISPYYKecMk71RBzznUZbzYo3FGryyldBKKzRc7muU=; b=4ULHoJ3ykdpdMFRGZq/Sz+CSGGZLQ5nyPEbJkKgIYEsI3Txr4+mxkYQ66lgur9hgU+ Fxl11zOK1S2eMNl5Luxpc8XXeHMPqSJWaAyqjoBvS7NFDpd7L0HcN/62osQxQ8pLTHs/ Cw8UI93IamYSyuFtykjozq9uNBWaXABR617xtHu9SwP2PQJ+uEOZhuwSavHH/40w2Eu5 XiUDykBLJi82mv5YW62HWSw+shijLSTVEXLSBYpnmRotjO9x0vUxC+5OVCunX7rT+s23 iN7AvRE61uwXg2gU4sTmyaJqQfQzk2kqqQ/1OB3Vz80akjyODjIYF3por7H5Hhy9yMKq vQww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rOISPYYKecMk71RBzznUZbzYo3FGryyldBKKzRc7muU=; b=uRXQNr/zXug2rxaGDNnmbVQnBMuOlGj4TT2LWSYTVIGCbZq3TC8iiEI46/bB633+7U hWguWWh/b5d+equZkFf8mfM7unIposARrv7PCXy35JVgl+j5bKNIjYR1dYZExikEK1SE COeMpXmaEUSlFzWvd2STIBU6hsI8t+OwYNmWMhMFCRxH4YaCkQZfu332QsCNxwB4Sp+N kGEJuNzOK8NbDAXWScwjrTZQ1oqE8u8fKujdGQL2OfX4VfvpyGJZrsBwKlaXeu9jdDkW gsU80LV08z4TDlrhRmSzenRdgFpcc1FL4tBnenPnRnH7D3ksK5RRbXT+hPydOyYH3f8S L+gQ== X-Gm-Message-State: AOAM532cX7xauq8TUBUTwyhqGq0zNHIDgBXYveDY9COLJLGhqW/BwDyG JzxRf1IXcOYblwIyrz3yBi/mqsOcGvuRXQ== X-Google-Smtp-Source: ABdhPJwh5gDOtmdq3GBnEIXd6tHKW2vKNQXjA7q4HvbKwY2LAsrS3QbwMk3Uqkzr3Ew+AE7N9uitWw== X-Received: by 2002:a05:6638:2186:: with SMTP id s6mr22138665jaj.138.1636343533517; Sun, 07 Nov 2021 19:52:13 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 04/37] bsd-user/i386/target_arch_signal.h: Remove target_sigcontext Date: Sun, 7 Nov 2021 20:51:03 -0700 Message-Id: <20211108035136.43687-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d29 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d29; envelope-from=imp@bsdimp.com; helo=mail-io1-xd29.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343650001100009 Content-Type: text/plain; charset="utf-8" In FreeBSD, sigcontext was retired in favor of ucontext/mcontext. Remove vestigial target_sigcontext. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index a90750d602..e262667bda 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -27,10 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size = */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ =20 -struct target_sigcontext { - /* to be added */ -}; - typedef struct target_mcontext { } target_mcontext_t; =20 --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343939692668.3775344567249; Sun, 7 Nov 2021 19:58:59 -0800 (PST) Received: from [::1] (port=54416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvoA-0003Qi-Nw for importer@patchew.org; Sun, 07 Nov 2021 22:58:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhh-00063r-59 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:17 -0500 Received: from [2607:f8b0:4864:20::d2e] (port=43715 helo=mail-io1-xd2e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhf-0002om-FY for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:16 -0500 Received: by mail-io1-xd2e.google.com with SMTP id z26so218265iod.10 for ; Sun, 07 Nov 2021 19:52:15 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YUhiVOQnmpNFSdmZg3CHyQkzJYfHEf7WcwU0TPM0Y70=; b=NNBR2W4KKRaa+vALqQtroaCEwpJ8TiTn3n58gVdQHZIv+EKT0VbPjjK9ozYkxYfrnA tDDQvTUU26MRdCChGuFMxyhXWi2mqZgpmcCvatPWZ8B8eIQ7fIG9ZqLFgueehvT71mES d9csfnGeFQ0cJCKLolb/cQH/LTnbuxvr20GIi0Gr/3blQHt5GBH5nrsJ/CwzLDqR5PAJ ufnlHcUucN22YJgC+XQSEq5BZ+A5us8+tRYG0vESjO31uXK75OgvKAXlcSWVzyTdaUSl B8drv4sueY0A5WfI1/9BaO4ZMVCfoPTMZMNj7cnQ3lBG7J1xfOzZDp2WfRaq5Wj7K3G7 M2DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YUhiVOQnmpNFSdmZg3CHyQkzJYfHEf7WcwU0TPM0Y70=; b=P6+jfIGa4gDwYxrQrECquFWT02iRmdF3eK/INHgaiWTR9OCjlPSjcgOGUtHoR91NDU ZnA7oP9mzPpEa0BNl+T4ircAFkspJO3ann05zAPNPfcvUC1dsC8RrCC5O3eA8hY7K/FC i8kXSLpGgOFTik6YuYp3Cr5PLjP2yQsmgK/q0eDvFUkPS6zcbZ6Pqy66iMGprepWn5Ox /owFZj2aag8Ec7QE716eSL5e/P7/Vi40jQXLZrySnXmcOXKqYnq2MNZOM6PhAKzrvDHk a7YufVtgrKR0MpGc0AfjH+CAvW8n7vtv6vlv7gxlHOJm3QoeERrjCETjC/VOrftsIbqW h7Bw== X-Gm-Message-State: AOAM532tA2xqq6kqrUbSkXXZs4/p7/qb4KynJSopllGfR83CkjhHfDSk FbjoXe4xMdmVTIOvOSXJJe4oXU51bkswUA== X-Google-Smtp-Source: ABdhPJwL92l/utPA1Id8kJWwVT9NbqH7IkBUV2vhLWXCHBBuXofMTHzx2UA+8rqnprp7pheOaYJfpw== X-Received: by 2002:a5d:8c8b:: with SMTP id g11mr10558808ion.116.1636343534337; Sun, 07 Nov 2021 19:52:14 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 05/37] bsd-user/i386/target_arch_signal.h: use new target_os_ucontext.h Date: Sun, 7 Nov 2021 20:51:04 -0700 Message-Id: <20211108035136.43687-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2e; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343940951100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index e262667bda..bf7263c4f8 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -30,14 +30,7 @@ typedef struct target_mcontext { } target_mcontext_t; =20 -typedef struct target_ucontext { - target_sigset_t uc_sigmask; - target_mcontext_t uc_mcontext; - abi_ulong uc_link; - target_stack_t uc_stack; - int32_t uc_flags; - int32_t __spare__[4]; -} target_ucontext_t; +#include "target_os_ucontext.h" =20 struct target_sigframe { abi_ulong sf_signum; --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343770011383.35080086700873; Sun, 7 Nov 2021 19:56:10 -0800 (PST) Received: from [::1] (port=45624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvlR-0005uR-0O for importer@patchew.org; Sun, 07 Nov 2021 22:56:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhi-00067Y-GV for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:18 -0500 Received: from [2607:f8b0:4864:20::d2d] (port=39487 helo=mail-io1-xd2d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhg-0002pB-Lt for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:18 -0500 Received: by mail-io1-xd2d.google.com with SMTP id c3so3968512iob.6 for ; Sun, 07 Nov 2021 19:52:16 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pUnz5WHUhswb5q8XxN9w41FLyhOSulO5CBUbhPFGoI0=; b=qwGOMW1Dg8qR53+mqolKe8WLRXeTbR4ysvm4UEsn4kvfjsTss38GQrmu5bI5RzZHY3 GCUzK7Cy5OoeuKDAxrj3MK33JVpt9k4ULMR0nOkVSRA+WZXJtPHXx+uA4YU9tXaBglGh Dj4FTsTkS5ajkSXdYlDFmzu1frDZjpkNbyiMZ60lE/fEvdiPoYN9cBlWKrYBAEVi0vDW qXI1T1sy6AuO3sWLHJlGaPxcbWhT9WOG6MXTSw/agW8Y+vjhJ1O7eBypdNuMvYJeVg1u 7jlTw7QH1Tpm7jfH30yiZCBgdwLDDYtTf5AyJk1U6FztruO3cvFEPDhJIClM+Cb8VdlD IoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pUnz5WHUhswb5q8XxN9w41FLyhOSulO5CBUbhPFGoI0=; b=dOzOiO3GsV7bm4Dq5WT9zvOPEUuUC8q6boqwnpinBXwc1zl6CW/EwYqEOReJupp0Kv 7SIViyjgz3zZD2UUxrmwvrz3BweBBdQDX0a4ujKSreCkNuMCyWG9T04v7ho/4oVJU8Ju XC5y7czTFkXBODBeT4PsKN+nO9RnrDnvlo1zFzto6CK3L1fLEjsV6N08UyBuZGzvKUvj p6jems1e6oHMgS483EcQLiMbjSfsvcHNc+UhN+FDFjhUD7XkqOxN3q8nRis/rcg+oPaj 9Nthzb+T6oxYF+Yz0X1vM5YdSxO75rcPkmDDrxutes8WR6UtiHME2paADsxYbO9n1+6c M2qg== X-Gm-Message-State: AOAM532L2FSJoEsKOkv6/cK+ll+xNTXQiyl7FJmL5PCCuCKfn/vtw7PI SqwIGMIy8wHcZ9vn127ja+MYWQeKCXeQOQ== X-Google-Smtp-Source: ABdhPJw6r2XM1yoZo5v44PkSWGYTA9Wgug1wVcwEu6uFokFY10hLPlQe08D01AmwmhMbQKV/2FtYQA== X-Received: by 2002:a5d:8e07:: with SMTP id e7mr4648231iod.148.1636343535417; Sun, 07 Nov 2021 19:52:15 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 06/37] bsd-user/i386/target_arch_signal.h: Update mcontext_t to match FreeBSD Date: Sun, 7 Nov 2021 20:51:05 -0700 Message-Id: <20211108035136.43687-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2d (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2d; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343770545100001 Content-Type: text/plain; charset="utf-8" Fill in target_mcontext_t to match the FreeBSD mcontex_t. Also tag the current size of mcontext and ucontext to enable size checking for i386. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index bf7263c4f8..701c6f964f 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -28,8 +28,54 @@ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ =20 typedef struct target_mcontext { + abi_ulong mc_onstack; /* XXX - sigcontext compat. */ + abi_ulong mc_gs; /* machine state (struct trapframe) */ + abi_ulong mc_fs; + abi_ulong mc_es; + abi_ulong mc_ds; + abi_ulong mc_edi; + abi_ulong mc_esi; + abi_ulong mc_ebp; + abi_ulong mc_isp; + abi_ulong mc_ebx; + abi_ulong mc_edx; + abi_ulong mc_ecx; + abi_ulong mc_eax; + abi_ulong mc_trapno; + abi_ulong mc_err; + abi_ulong mc_eip; + abi_ulong mc_cs; + abi_ulong mc_eflags; + abi_ulong mc_esp; + abi_ulong mc_ss; + + int32_t mc_len; /* sizeof(mcontext_t) */ +#define _MC_FPFMT_NODEV 0x10000 /* device not present or configure= d */ +#define _MC_FPFMT_387 0x10001 +#define _MC_FPFMT_XMM 0x10002 + int32_t mc_fpformat; +#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ +#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ +#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ + int32_t mc_ownedfp; + abi_ulong mc_flags; + /* + * See for the internals of mc_fpstate[]. + */ + int32_t mc_fpstate[128] __aligned(16); + + abi_ulong mc_fsbase; + abi_ulong mc_gsbase; + + abi_ulong mc_xfpustate; + abi_ulong mc_xfpustate_len; + + int32_t mc_spare2[4]; } target_mcontext_t; =20 +#define TARGET_MCONTEXT_SIZE 640 +#define TARGET_UCONTEXT_SIZE 704 + #include "target_os_ucontext.h" =20 struct target_sigframe { --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343775234843.7420755657372; Sun, 7 Nov 2021 19:56:15 -0800 (PST) Received: from [::1] (port=46222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvlW-0006Ic-7X for importer@patchew.org; Sun, 07 Nov 2021 22:56:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhl-0006GI-8l for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:21 -0500 Received: from [2607:f8b0:4864:20::d31] (port=34565 helo=mail-io1-xd31.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhi-0002pS-5r for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:21 -0500 Received: by mail-io1-xd31.google.com with SMTP id w22so2906641ioa.1 for ; Sun, 07 Nov 2021 19:52:17 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u970cXhT5ZzSUK7ShiWcU4teDFPc9gbTYz14X9qwV6Q=; b=Z5cNkfc+8qYuTIRQBHztdLN8ukDPPaal6Zzz4mMxjLXWj5sN3dvZbHBNPkTuNQ2i8H D00GJtArkapHbzB3uq8TJkT6ylN0Ct4CrGBMV09MkLYJt7HFPFibYGzW5BSZ+ZaWieNO DF+C7Vr73Dl6ISAzILgkgBFV8xL2jZ1ycWsWop/TGTZ6yW2Ac6Oy0jmmYLbAz1sFgFrk foWzqT6c8ReuZSUaNkCg0VlyVXJqyVL/GF7HiolT4WO8ROClMarl7I4JwcWIGQwpSIqf wEL/ADC5NyA6PK6Nb5VX3r62za+81V1c/sh7tV/bYeLf7mxZJzTXysTc5Tew1M6vFCNJ lYdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u970cXhT5ZzSUK7ShiWcU4teDFPc9gbTYz14X9qwV6Q=; b=nllGhjxJDt1q39ZbB1Axk+Mn3AA1JlOkUv/MFqj/JPoHa3jZrHZ6l6YFOjaY9I4g4t x8/FAK58ghFyPlL964x5Z7K6RJq/IpraOKHeOhv/2shxbolkH8B141c2TJOhHS8Ly8pd J6H+ifB/gOafiVPU/kWV/4uQzECAzTwPfuNeJbsaz58padS1OtLvHWm8AVDN66jDrnQO 3VhgNugpb4BgV7+heUrdw2bvR5FRxd42ObKyMmddkJen60s1gweh+UVhAJbp5zyWo2Z7 2MzpT5DCRxX719X4Pc0zg6K3bxCIS0NB4c2gI4Y8CNmE4nSYtUXpR2Qw3dzgskyfBDxO ylbA== X-Gm-Message-State: AOAM532bzuAl/mFlCh8zNV54RcCBajkK/wCsShJ3qyga7rq7PvzuOoPY 6cM9F0+gKG0EfZnkuFzZXxoBRcSsve/qtw== X-Google-Smtp-Source: ABdhPJzCSUBG6TBaWRgt3fMMXVVuo+2fYWl8DtICId5COPR69QZTHItMzyv42hMs8Pk2EQm1uUG60A== X-Received: by 2002:a5d:8242:: with SMTP id n2mr11062722ioo.170.1636343536370; Sun, 07 Nov 2021 19:52:16 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 07/37] bsd-user/i386: Move the inlines into signal.c Date: Sun, 7 Nov 2021 20:51:06 -0700 Message-Id: <20211108035136.43687-8-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d31 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343776625100004 Content-Type: text/plain; charset="utf-8" Move the (now stubbed out) inlines into bsd-user/i386/signal.c. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/signal.c | 56 +++++++++++++++++++++++++++++- bsd-user/i386/target_arch_signal.h | 43 +++++------------------ 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/bsd-user/i386/signal.c b/bsd-user/i386/signal.c index ac90323365..2939d32400 100644 --- a/bsd-user/i386/signal.c +++ b/bsd-user/i386/signal.c @@ -1 +1,55 @@ -/* Placeholder for signal.c */ +/* + * i386 dependent signal definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "qemu.h" + +/* + * Compare to i386/i386/machdep.c sendsig() + * Assumes that target stack frame memory is locked. + */ +abi_long set_sigtramp_args(CPUX86State *env, int sig, + struct target_sigframe *frame, + abi_ulong frame_addr, + struct target_sigaction *ka) +{ + /* XXX return -TARGET_EOPNOTSUPP; */ + return 0; +} + +/* Compare to i386/i386/machdep.c get_mcontext() */ +abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags) +{ + /* XXX */ + return -TARGET_EOPNOTSUPP; +} + +/* Compare to i386/i386/machdep.c set_mcontext() */ +abi_long set_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int srfla= g) +{ + /* XXX */ + return -TARGET_EOPNOTSUPP; +} + +abi_long get_ucontext_sigreturn(CPUX86State *regs, abi_ulong target_sf, + abi_ulong *target_uc) +{ + /* XXX */ + *target_uc =3D 0; + return -TARGET_EOPNOTSUPP; +} diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index 701c6f964f..982c7035c7 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -88,40 +88,13 @@ struct target_sigframe { uint32_t __spare__[2]; }; =20 -/* - * Compare to i386/i386/machdep.c sendsig() - * Assumes that target stack frame memory is locked. - */ -static inline abi_long set_sigtramp_args(CPUX86State *regs, - int sig, struct target_sigframe *frame, abi_ulong frame_addr, - struct target_sigaction *ka) -{ - /* XXX return -TARGET_EOPNOTSUPP; */ - return 0; -} - -/* Compare to i386/i386/machdep.c get_mcontext() */ -static inline abi_long get_mcontext(CPUX86State *regs, - target_mcontext_t *mcp, int flags) -{ - /* XXX */ - return -TARGET_EOPNOTSUPP; -} - -/* Compare to i386/i386/machdep.c set_mcontext() */ -static inline abi_long set_mcontext(CPUX86State *regs, - target_mcontext_t *mcp, int srflag) -{ - /* XXX */ - return -TARGET_EOPNOTSUPP; -} - -static inline abi_long get_ucontext_sigreturn(CPUX86State *regs, - abi_ulong target_sf, abi_ulong *target_uc) -{ - /* XXX */ - *target_uc =3D 0; - return -TARGET_EOPNOTSUPP; -} +abi_long set_sigtramp_args(CPUX86State *env, int sig, + struct target_sigframe *frame, + abi_ulong frame_addr, + struct target_sigaction *ka); +abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags= ); +abi_long set_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int srfla= g); +abi_long get_ucontext_sigreturn(CPUX86State *regs, abi_ulong target_sf, + abi_ulong *target_uc); =20 #endif /* TARGET_ARCH_SIGNAL_H */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343936415811.1018569830713; Sun, 7 Nov 2021 19:58:56 -0800 (PST) Received: from [::1] (port=54112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvo7-0003CK-BO for importer@patchew.org; Sun, 07 Nov 2021 22:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhl-0006Fw-66 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:21 -0500 Received: from [2607:f8b0:4864:20::d31] (port=46695 helo=mail-io1-xd31.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhi-0002pd-Dc for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:20 -0500 Received: by mail-io1-xd31.google.com with SMTP id k22so4065379iol.13 for ; Sun, 07 Nov 2021 19:52:18 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wZvh57AWzS8inwSMVn1OaBIlb06mOlklnUcQyFDbg60=; b=6WpU9QwjmkXfZxOST/jDl4a+upyfk5sH+yrWsqSbb92f229vKOMjy39Y+rmSxlyru/ Ixo4mjKwt/zJtatMgLmbyvsIVYDru/itWh856mSo9gbu3mGnIiCFfv6uaNEWzxzRnfwu dxYxAulgwydpRgAPOLCWl7574xyP3sWD6YZ3577up4PsW+5L0mBqe9Ro+6cX9K8tzzDO DkpJlLZfB3T0hT7cC/GBO3Y3mbJZKTyU87lPnZ+TYqpOZhMYz+kjWEBEtAoZ8RA4gjdw Hm4R0XcwL0PE0hiuZcIWFIG2s1M3AIBxHdgDW++G80Y3VY5aDD7PqmvWap42cHfx0frz ZUDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wZvh57AWzS8inwSMVn1OaBIlb06mOlklnUcQyFDbg60=; b=kcS9zG3XPIr5Exa43BHggknfLKZBfKXHKAeNxXn0fAHGtBMBpkvYiDNWcQgLsQ12fY er9fTZLE4y7O8H2OSjAF+2HFfbkfoaJ0PyiOgmZelOZizhRBljC5AgsKGSKBnwbDWe3o rv8q83yNcUny/FL43XzZPG9/Y6xcbDS4NV7ampokuNQ3YezOI0gL0K2fYugBRtVqu/vE K3za8AgJF+33sNK7T/yM7F+kDXJJCZm/LEWrAxyUVWXmAkjxJq45bRl+FNoVSWxR76fG n7OKSB+IFiLr+g3cpvUn/pTUJW7Htp6dZh7TRlAymfT6m7zKZfjr9EvM9ygh/OZkJSBT 4TZA== X-Gm-Message-State: AOAM533ThDjJ/VMOtCcL+soMdvdcAWDr3gnSQlstZU/fI9P5G1v33SkG /LtrNdLrM+7D/w3Lz4qY5HHqLmlYv89fbQ== X-Google-Smtp-Source: ABdhPJwa5WM/P+QpaX1KMqunIruOe9udsn/0/lXa7TbZtM4DDLxW9+qMFP07tG06tXQEcIYyY57Rng== X-Received: by 2002:a05:6602:2cce:: with SMTP id j14mr10796549iow.23.1636343537261; Sun, 07 Nov 2021 19:52:17 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 08/37] bsd-user/x86_64/target_arch_signal.h: Remove target_sigcontext Date: Sun, 7 Nov 2021 20:51:07 -0700 Message-Id: <20211108035136.43687-9-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d31 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343936808100001 Content-Type: text/plain; charset="utf-8" In FreeBSD, sigcontext was retired in favor of ucontext/mcontext. Remove vestigial target_sigcontext. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/target_arch_signal.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index 4bb753b08b..55f742b0a8 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -27,10 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size = */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ =20 -struct target_sigcontext { - /* to be added */ -}; - typedef struct target_mcontext { } target_mcontext_t; =20 --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343942849610.6688018757911; Sun, 7 Nov 2021 19:59:02 -0800 (PST) Received: from [::1] (port=54710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvoD-0003dp-S3 for importer@patchew.org; Sun, 07 Nov 2021 22:59:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhl-0006Ga-JN for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:21 -0500 Received: from [2607:f8b0:4864:20::12b] (port=33557 helo=mail-il1-x12b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhj-0002pr-AC for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:21 -0500 Received: by mail-il1-x12b.google.com with SMTP id l19so15626230ilk.0 for ; Sun, 07 Nov 2021 19:52:18 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ZNPpOkk6VPcljeu7Kbkpd5a4MaTSH5kT5BRcPYHMyg=; b=Yz3CQQYjHcrff2gHLY9MsR4yRKM5eK/0MsfFP8KOJrU46n/HFHn1+gdFK86Cx/ZDiC Bb3UA+Urq0d4BBMix63LpVQUOHfFBXY+Lhod/d1xCV7dWoo9TSQY5R4MbEm/npbKWfhm hDr5rDueCxbCPlsuUEbjF+8cuoDWpzjyOanm0m7z3OVllTE12txQg9c6fZrvTKz+oCNi PavAHOKv4lwRWHogw1/a55gH4dahYK34dpTyLqszOrVtPpz1YSkwpGGVbI3ORhlCOvuv be3Fw4obHtpXcK/5oTUwGCKwawrJ9x/GPDuxoaUwehxg03wLxdHiz1lTFCKhcHFqCg0U gNjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+ZNPpOkk6VPcljeu7Kbkpd5a4MaTSH5kT5BRcPYHMyg=; b=AxseirCbj68o8rC5MErbxrE8ZWK8rVxLRkzFucCdkhDraQQ01W3OO8J72xgZqzflyf FQypkX9BW1IGBZz8y4IojX5Sp4lI63NX/YzyYaOboxe8wTsSm4k3z+GHda6XBz9virlW xfVDqZ7hUlwuLobU/z+qopZWKZ0V2b5EncDnvcvB/KiE5p4dwHjqChfn6A6rK7VYT6j1 p+4o9P5uqJpeDK+BFnwUXhlG9gvQNcddIWBQM53hdwGLhJ8RDHOmmqPSWYvW3A4DZ83L eRVGP3lg0ABZ52ZakVdb1Zu1a7LeU4sfuGPojzh3OslBeCTrAbU01yo0KLAN0wliPWVO cGtg== X-Gm-Message-State: AOAM532IU6dfud6FUu1uoJqSS/i1hr0FaQq6/D+zZ5HS8pnJ0BgWxMoS v20/FFz+C7uYFbcG2iP9N7oSukvhaJWDKA== X-Google-Smtp-Source: ABdhPJwOtpoxumYUgvMUupeSpvwCCJwxSlV+IausWhpkkL8dkzImwI39M9IZlvxrdI0EcClUx+5l+w== X-Received: by 2002:a05:6e02:174d:: with SMTP id y13mr21717559ill.183.1636343538103; Sun, 07 Nov 2021 19:52:18 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 09/37] bsd-user/x86_64/target_arch_signal.h: use new target_os_ucontext.h Date: Sun, 7 Nov 2021 20:51:08 -0700 Message-Id: <20211108035136.43687-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12b (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12b; envelope-from=imp@bsdimp.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343945116100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/target_arch_signal.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index 55f742b0a8..e84aff948c 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -30,14 +30,7 @@ typedef struct target_mcontext { } target_mcontext_t; =20 -typedef struct target_ucontext { - target_sigset_t uc_sigmask; - target_mcontext_t uc_mcontext; - abi_ulong uc_link; - target_stack_t uc_stack; - int32_t uc_flags; - int32_t __spare__[4]; -} target_ucontext_t; +#include "target_os_ucontext.h" =20 struct target_sigframe { abi_ulong sf_signum; --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343775152259.4979867856921; Sun, 7 Nov 2021 19:56:15 -0800 (PST) Received: from [::1] (port=46202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvlW-0006Ho-6M for importer@patchew.org; Sun, 07 Nov 2021 22:56:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0006P3-Ce for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:27 -0500 Received: from [2607:f8b0:4864:20::d34] (port=46698 helo=mail-io1-xd34.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhl-0002q1-Gi for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:23 -0500 Received: by mail-io1-xd34.google.com with SMTP id k22so4065414iol.13 for ; Sun, 07 Nov 2021 19:52:21 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bx57Grx4Ho2QTHDmDapCkPzf47yXES68RJ3vL59z+xc=; b=aoulB3QOjs8yknezIbWDSAF18cLlLHCToc/1V9aY/NxM7excLnuhc87wAtLX11Snuh O/ILUsOPhr20pfZrb4lwOU5p1sqhg0NrRLw9X89R/8B1lQXiT3fkvcT7KNx2N8a46irA hnQEUyjqaAc5RvSf8cPDByHGLQOq7LifxS99Mx1BrWlN1R1JPl0iQeWaG6V1ovI9z70Y DDpwEnefOb6JcMw4gt4yuousMw9EaHh1SHUPxWwIf4pWVwrHCiJGdaofH6O9W7e6rMFN 0FB0QnMjW/25eBCXOyMilT7+q31hB4/BpashbOCyD19f7tfYX8NPhJyeRzOkBX6UJql/ kG8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bx57Grx4Ho2QTHDmDapCkPzf47yXES68RJ3vL59z+xc=; b=6un/HlvUWe2UYdpHUZ99yxtPrWQqvvjhYAND+BoMNfNKHjDaajj9OL+5OuWkdvBh3G AnDtjXvXR0h6JMvD8gkDno5GAi/gm4dYOXvrmF0Zz35NTpaz5Nq59Sk9ScGJJbXOtjRD WLDgTSfkABxER6pfn2c717rYcQAQwy6xJwAzlGS8DH8viw/yZueKKT18mPyiP7LUv51G jue6yUEXZ8Z0QPj1771GAnfrKErBHuKLtJW9nlNX7sZGZTewQ38ppTnP0ojYn5WdFbdO CnAwG/aW6gx6sRGhjZ2uX/gJuoA64oxN8c16z3pjl5JC/79Vvvk0xVdkmV4YITAYttpj HeNQ== X-Gm-Message-State: AOAM533oIPkJGq6zgKkYtCE63hqkulvqVg5OrfIOxhtZxJbYDXzIfodS nn0coqFf+WsryIOGlGWJjMzIm9Dy/cq99A== X-Google-Smtp-Source: ABdhPJzllnn02z39wmWmK/372UBZwqeluNpy5OZCtOM0hBuiIrvdb+2UTZRXOdSFtMVhe6Kgod0cHg== X-Received: by 2002:a05:6602:14d0:: with SMTP id b16mr8811887iow.181.1636343539251; Sun, 07 Nov 2021 19:52:19 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 10/37] bsd-user/x86_64/target_arch_signal.h: Fill in mcontext_t Date: Sun, 7 Nov 2021 20:51:09 -0700 Message-Id: <20211108035136.43687-11-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d34 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d34; envelope-from=imp@bsdimp.com; helo=mail-io1-xd34.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343776612100003 Content-Type: text/plain; charset="utf-8" Fill in target_mcontext match the FreeBSD mcontext_t structure. Also define the size correctly. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/target_arch_signal.h | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index e84aff948c..720e3939c3 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -28,8 +28,62 @@ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ =20 typedef struct target_mcontext { + abi_ulong mc_onstack; /* XXX - sigcontext compat. */ + abi_ulong mc_rdi; /* machine state (struct trapframe) */ + abi_ulong mc_rsi; + abi_ulong mc_rdx; + abi_ulong mc_rcx; + abi_ulong mc_r8; + abi_ulong mc_r9; + abi_ulong mc_rax; + abi_ulong mc_rbx; + abi_ulong mc_rbp; + abi_ulong mc_r10; + abi_ulong mc_r11; + abi_ulong mc_r12; + abi_ulong mc_r13; + abi_ulong mc_r14; + abi_ulong mc_r15; + uint32_t mc_trapno; + uint16_t mc_fs; + uint16_t mc_gs; + abi_ulong mc_addr; + uint32_t mc_flags; + uint16_t mc_es; + uint16_t mc_ds; + abi_ulong mc_err; + abi_ulong mc_rip; + abi_ulong mc_cs; + abi_ulong mc_rflags; + abi_ulong mc_rsp; + abi_ulong mc_ss; + + abi_long mc_len; /* sizeof(mcontext_t) */ + +#define _MC_FPFMT_NODEV 0x10000 /* device not present or configure= d */ +#define _MC_FPFMT_XMM 0x10002 + abi_long mc_fpformat; +#define _MC_FPOWNED_NONE 0x20000 /* FP state not used */ +#define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */ +#define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */ + abi_long mc_ownedfp; + /* + * See for the internals of mc_fpstate[]. + */ + abi_long mc_fpstate[64] __aligned(16); + + abi_ulong mc_fsbase; + abi_ulong mc_gsbase; + + abi_ulong mc_xfpustate; + abi_ulong mc_xfpustate_len; + + abi_long mc_spare[4]; } target_mcontext_t; =20 +#define TARGET_MCONTEXT_SIZE 800 +#define TARGET_UCONTEXT_SIZE 880 + #include "target_os_ucontext.h" =20 struct target_sigframe { --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636343942686912.8204550150344; Sun, 7 Nov 2021 19:59:02 -0800 (PST) Received: from [::1] (port=54708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvoD-0003do-Lj for importer@patchew.org; Sun, 07 Nov 2021 22:59:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0006PJ-En for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:27 -0500 Received: from [2607:f8b0:4864:20::12e] (port=45652 helo=mail-il1-x12e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhl-0002qB-Lr for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:23 -0500 Received: by mail-il1-x12e.google.com with SMTP id i12so15533473ila.12 for ; Sun, 07 Nov 2021 19:52:21 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JXp5/X8FRup4YPTNtkjA6+UNr6/HSMba1RzleezwTZc=; b=q6qWJjVXjlJ4UpUTip/FUv036mww5ap0HCwIp7bvzJ8+oL+D76+bVxhMjJiadvxoSf 0CRIX1EEqz6mHe1gVT9PI/TwQliWbLrBh47U2/J8Ig8C//Lnu13vJ6XfhXR7HBcR9z6+ 8cVj83xv2j9P4JP2u3kzsRHQS06YdkbvdjCT+0ulGGD6FSJoXG0rgkZsYHTMYg9yCkd2 mxfLfRPfdvJjn6pMCAZ51etNI6FlT447zDTPWQ8QzH1Lc6TzVYofeMJNnQyP/EEi/FQz h4xz90jZQj14DM4Nm3uz60xEQfmwO9Znn+dWpONVc7OiKkOPFJ6GMUKboXvTLx+FOFFO 41DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JXp5/X8FRup4YPTNtkjA6+UNr6/HSMba1RzleezwTZc=; b=7Cxhb0Q8blXJkrvCOlzeCluoFcyMDXQQ6xLrtYlDQD01DO1+mvqG3keRHOGs2Q+pv7 OQAuRt8K8nLEuQrEHzYd+PorsoxOWPIM7QWJXm8xLpm01s7w0YlMiZXyJ8wGnPJ39t0L nWiYkq8o5zfOBiNgdRW/u09kZKN49293iVcp1DDT7/++Cp9mXuKuWF21He4V1jVv4fFG HMmGUIPCB9w7u7k/atSnV4zucrF3+TYZwBeuI4QmMbb0TcOOFk8L7Mwd5SmMtztNxeAl Mtlx/YPx5yS8/QUzqf2Jb3jL139LGnyaxd+8omByKyZTb9KWQmBgoy7HqoeoHQ8Eu/yV hcAg== X-Gm-Message-State: AOAM531oloBc2JFbdpNCUosytK43W6/HfuaMd8EfeQjs8JAy/zmeV6G6 YVAMEnXCYJYFG5fTj+Aq1/bwkEbun1estw== X-Google-Smtp-Source: ABdhPJx7Ia+Z8PL4EmBlYp5Ns75+WwEpj61N1pNEl3nzm33wwXNgdBWH7zrZfa1X+IkT1gJZqYxSAA== X-Received: by 2002:a05:6e02:1a66:: with SMTP id w6mr28335978ilv.306.1636343540474; Sun, 07 Nov 2021 19:52:20 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 11/37] bsd-user/x86_64: Move functions into signal.c Date: Sun, 7 Nov 2021 20:51:10 -0700 Message-Id: <20211108035136.43687-12-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12e; envelope-from=imp@bsdimp.com; helo=mail-il1-x12e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636343943091100001 Content-Type: text/plain; charset="utf-8" Move the current inline functions into sigal.c. This will increate the flexibility of implementation in the future. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/signal.c | 56 +++++++++++++++++++++++++++- bsd-user/x86_64/target_arch_signal.h | 43 ++++----------------- 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/bsd-user/x86_64/signal.c b/bsd-user/x86_64/signal.c index ac90323365..8885152a7d 100644 --- a/bsd-user/x86_64/signal.c +++ b/bsd-user/x86_64/signal.c @@ -1 +1,55 @@ -/* Placeholder for signal.c */ +/* + * x86_64 signal definitions + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "qemu.h" + +/* + * Compare to amd64/amd64/machdep.c sendsig() + * Assumes that target stack frame memory is locked. + */ +abi_long set_sigtramp_args(CPUX86State *regs, + int sig, struct target_sigframe *frame, abi_ulong frame_addr, + struct target_sigaction *ka) +{ + /* XXX return -TARGET_EOPNOTSUPP; */ + return 0; +} + +/* Compare to amd64/amd64/machdep.c get_mcontext() */ +abi_long get_mcontext(CPUX86State *regs, + target_mcontext_t *mcp, int flags) +{ + /* XXX */ + return -TARGET_EOPNOTSUPP; +} + +/* Compare to amd64/amd64/machdep.c set_mcontext() */ +abi_long set_mcontext(CPUX86State *regs, + target_mcontext_t *mcp, int srflag) +{ + /* XXX */ + return -TARGET_EOPNOTSUPP; +} + +abi_long get_ucontext_sigreturn(CPUX86State *regs, + abi_ulong target_sf, abi_ulong *target_uc) +{ + /* XXX */ + *target_uc =3D 0; + return -TARGET_EOPNOTSUPP; +} diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index 720e3939c3..b39b70466e 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -96,40 +96,13 @@ struct target_sigframe { uint32_t __spare__[2]; }; =20 -/* - * Compare to amd64/amd64/machdep.c sendsig() - * Assumes that target stack frame memory is locked. - */ -static inline abi_long set_sigtramp_args(CPUX86State *regs, - int sig, struct target_sigframe *frame, abi_ulong frame_addr, - struct target_sigaction *ka) -{ - /* XXX return -TARGET_EOPNOTSUPP; */ - return 0; -} - -/* Compare to amd64/amd64/machdep.c get_mcontext() */ -static inline abi_long get_mcontext(CPUX86State *regs, - target_mcontext_t *mcp, int flags) -{ - /* XXX */ - return -TARGET_EOPNOTSUPP; -} - -/* Compare to amd64/amd64/machdep.c set_mcontext() */ -static inline abi_long set_mcontext(CPUX86State *regs, - target_mcontext_t *mcp, int srflag) -{ - /* XXX */ - return -TARGET_EOPNOTSUPP; -} - -static inline abi_long get_ucontext_sigreturn(CPUX86State *regs, - abi_ulong target_sf, abi_ulong *target_uc) -{ - /* XXX */ - *target_uc =3D 0; - return -TARGET_EOPNOTSUPP; -} +abi_long set_sigtramp_args(CPUX86State *env, int sig, + struct target_sigframe *frame, + abi_ulong frame_addr, + struct target_sigaction *ka); +abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags= ); +abi_long set_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int srfla= g); +abi_long get_ucontext_sigreturn(CPUX86State *regs, abi_ulong target_sf, + abi_ulong *target_uc); =20 #endif /* !TARGET_ARCH_SIGNAL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344095648668.4622109009412; Sun, 7 Nov 2021 20:01:35 -0800 (PST) Received: from [::1] (port=34662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvqg-0000ty-Ii for importer@patchew.org; Sun, 07 Nov 2021 23:01:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0006PC-Ex for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:27 -0500 Received: from [2607:f8b0:4864:20::133] (port=42716 helo=mail-il1-x133.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhm-0002qd-G7 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:24 -0500 Received: by mail-il1-x133.google.com with SMTP id y17so15551539ilb.9 for ; Sun, 07 Nov 2021 19:52:22 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NfUAHUW0Nh2J7SrWzMj/OqYpGUA/s6zV61PQbcFLFE=; b=OCsHhkjQd2BG0aNftGvJF9tJghGwdfOTKT3r63/Qq0fGMIWvXaNLR1NLUQsN+gNkf5 bQ9K2qkTPiRVLNYro2J9guMPevRb2evctdUa+T6RBZk7VeBnl27oirIWK1XsVJqOzoJy rvOUMzrT+5lSDotn/w5a7rWfRIUiKIMKXpvdYp20LnA7hvbtpHxvlmmYACAvRrMMlK4u LlDFdICiWKgL7xTpFDHsYWGdi2lpAmn2QZ/xaS+SqUkr3ueW153lreL4C0hUyjR15O/r 9UPrJ3jjzemIO1DOcKpfyUlpbX7iQD9+OSh6ahfg2X92VmbjRTa3Iblno8OvOgltzN7d y3Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+NfUAHUW0Nh2J7SrWzMj/OqYpGUA/s6zV61PQbcFLFE=; b=P2YXmN/60kiuypCVW0jyJJ5drOgVCyiFcYolPzjPYR8TXlzbaMkPB+BfNYR9UAjcjC HNCI0G2Ambu1NKR8agVkStVpvFfyes5yDJJhxa2HLJPkzWVm7LJpBb0W/dNdtPuyGWyw W9WN1kBNgYb6kIOM7VAi2/JPP+4AV/sv50R4tRgDyJLCaWYUpiVmKuMnnr9/psRT4GSD GEj4W6uwssEkFEaf/0QEAhCEzdJjz4KoXY8xNTsPowrUj+pJRRuZLV1G+y3GT1wzYH80 InsLuyTIPBh6DiP2t7r6l/kyoc/+1wJY8H3gFODNXzPNDu8FNvUy7XxyqT5kwXxunCis Df2Q== X-Gm-Message-State: AOAM530FrWSt5uK+/Yq5Qjxph9TyFiZcpiZJYOJrRxnYYtYf0Z5KeTAX 5GxrCA9tbGFbf2p19XHP03MAhHUUZVpDSA== X-Google-Smtp-Source: ABdhPJzAsgUa2hXcnoFk1De8IcHli9Tovs5Fg/XGg3HXNHbQLNx1o0IT1mJHbtB8o7YjRaW/x9MQzQ== X-Received: by 2002:a05:6e02:12c7:: with SMTP id i7mr46483103ilm.253.1636343541334; Sun, 07 Nov 2021 19:52:21 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 12/37] bsd-user/target_os_signal.h: Move signal prototypes to target_os_ucontext.h Date: Sun, 7 Nov 2021 20:51:11 -0700 Message-Id: <20211108035136.43687-13-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::133 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344096100100001 Content-Type: text/plain; charset="utf-8" Switch to the CPUArchState typedef and move target-provided prototypes to target_os_ucontext.h. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_ucontext.h | 11 +++++++++++ bsd-user/i386/target_arch_signal.h | 9 --------- bsd-user/x86_64/target_arch_signal.h | 9 --------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/bsd-user/freebsd/target_os_ucontext.h b/bsd-user/freebsd/targe= t_os_ucontext.h index 1d0c3c4e65..dd61aec7cc 100644 --- a/bsd-user/freebsd/target_os_ucontext.h +++ b/bsd-user/freebsd/target_os_ucontext.h @@ -32,4 +32,15 @@ G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE =3D=3D sizeof(targe= t_mcontext_t)); G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE =3D=3D sizeof(target_ucontext_t)); #endif /* TARGET_MCONTEXT_SIZE */ =20 +struct target_sigframe; + +abi_long set_sigtramp_args(CPUArchState *env, int sig, + struct target_sigframe *frame, + abi_ulong frame_addr, + struct target_sigaction *ka); +abi_long get_mcontext(CPUArchState *regs, target_mcontext_t *mcp, int flag= s); +abi_long set_mcontext(CPUArchState *regs, target_mcontext_t *mcp, int srfl= ag); +abi_long get_ucontext_sigreturn(CPUArchState *regs, abi_ulong target_sf, + abi_ulong *target_uc); + #endif /* TARGET_OS_UCONTEXT_H */ diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch= _signal.h index 982c7035c7..279dadc22c 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -88,13 +88,4 @@ struct target_sigframe { uint32_t __spare__[2]; }; =20 -abi_long set_sigtramp_args(CPUX86State *env, int sig, - struct target_sigframe *frame, - abi_ulong frame_addr, - struct target_sigaction *ka); -abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags= ); -abi_long set_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int srfla= g); -abi_long get_ucontext_sigreturn(CPUX86State *regs, abi_ulong target_sf, - abi_ulong *target_uc); - #endif /* TARGET_ARCH_SIGNAL_H */ diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_= arch_signal.h index b39b70466e..b4a0ebf2bd 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -96,13 +96,4 @@ struct target_sigframe { uint32_t __spare__[2]; }; =20 -abi_long set_sigtramp_args(CPUX86State *env, int sig, - struct target_sigframe *frame, - abi_ulong frame_addr, - struct target_sigaction *ka); -abi_long get_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int flags= ); -abi_long set_mcontext(CPUX86State *regs, target_mcontext_t *mcp, int srfla= g); -abi_long get_ucontext_sigreturn(CPUX86State *regs, abi_ulong target_sf, - abi_ulong *target_uc); - #endif /* !TARGET_ARCH_SIGNAL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344489481771.4678992283172; Sun, 7 Nov 2021 20:08:09 -0800 (PST) Received: from localhost ([::1]:54964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvx2-0006Zp-FA for importer@patchew.org; Sun, 07 Nov 2021 23:08:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhz-0006mE-0P for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:37 -0500 Received: from [2607:f8b0:4864:20::130] (port=35441 helo=mail-il1-x130.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0002rH-8U for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:33 -0500 Received: by mail-il1-x130.google.com with SMTP id w15so15558184ill.2 for ; Sun, 07 Nov 2021 19:52:23 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0zcqxxx9i9efPGyMNGiYlMMaZ7Z90otmzxtyKTD4u1s=; b=PEiLhvbuyBHQI6fCdnHPD85rbw3Z4Icy4QbFXykg75zO9rd4Wdb5hcJ+m5Qi16/STZ SOmB8JNZh+L7drh1OODImDxeXiMvAbmVPaFqHEqtOt6wPcvzmmT52ZdLhZSggLUzPLlW CAnD5Wj8QhTUuxg2E0aM7JLynHXvrUIg8SOmUN4vLP/WslyXtK9p2kiK1YuYqlB9ih2F Z7PPgdk9516WEBjcJT5Mg4fWQ+fl3BRltw69BbCx3oRnlcWTPA6FMkFWPdHgQnAL1l8C whTOcdQnvfKgSDfu2uoDtCpaQ4D2zlX9t5KzpgYGBFTr49WVw0BhLnLidMhWtlL+L26r SA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0zcqxxx9i9efPGyMNGiYlMMaZ7Z90otmzxtyKTD4u1s=; b=s46oblSVl5bYr4DbE7n+6JtoMDJTDlPhJdDkfGtE8nEhomToWqtBzQ3Mh520NDruiU fbO96DeYJ4vIpEe0Kz3jmtn1qMqjR1uNvknN2RaqPaH//75kp8q15R4QAB4H9CYQMWPh 0aDqgoFMQhTWvJcsUIB9n8F7Lb3EuqNzaDZ8cww3q4bKQVchdz1kyGXwzGop8DRerve3 1xLzmq3fVxhKphvQkt/rlypgbXk9w1v+CpLhUOEXA35GORr6xY3dMOCw9OEKYWXayCqC mwN1hDYWdKLgdbbn9lssBD758RBZNkuKwGG9nzv2atGmkcRJa58yK7s64dR52ghrL7T3 qGOA== X-Gm-Message-State: AOAM5325dyru8wNPAm11CZEWNQ8aMxskmLJvKiY6TT5UvulLuV0EzvMW 3M2GJUMmndtDyN0nEhS+TaGWkEB7UGN4MA== X-Google-Smtp-Source: ABdhPJyVmmFwrlZqX6CHgt0m94yv0c9XCf8BJmH3Eqj8T1WKYVjVe85r7xdrMRKzCWwmuKrOr2V13w== X-Received: by 2002:a92:9513:: with SMTP id y19mr51138902ilh.300.1636343542176; Sun, 07 Nov 2021 19:52:22 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 13/37] bsd-user/arm/target_arch_sysarch.h: Use consistent include guards Date: Sun, 7 Nov 2021 20:51:12 -0700 Message-Id: <20211108035136.43687-14-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::130 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344490695100001 Content-Type: text/plain; charset="utf-8" As part of upstreaming, the include guards have been made more consistent. Update this file to use the new guards. Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_sysarch.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsd-user/arm/target_arch_sysarch.h b/bsd-user/arm/target_arch_= sysarch.h index 632a5cd453..8cc6bff207 100644 --- a/bsd-user/arm/target_arch_sysarch.h +++ b/bsd-user/arm/target_arch_sysarch.h @@ -17,8 +17,8 @@ * along with this program; if not, see . */ =20 -#ifndef BSD_USER_ARCH_SYSARCH_H_ -#define BSD_USER_ARCH_SYSARCH_H_ +#ifndef _TARGET_ARCH_SYSARCH_H_ +#define _TARGET_ARCH_SYSARCH_H_ =20 #include "target_syscall.h" #include "target_arch.h" @@ -75,4 +75,4 @@ static inline void do_freebsd_arch_print_sysarch( } } =20 -#endif /*!BSD_USER_ARCH_SYSARCH_H_ */ +#endif /*!_TARGET_ARCH_SYSARCH_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344274741289.0216518349904; Sun, 7 Nov 2021 20:04:34 -0800 (PST) Received: from localhost ([::1]:43378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvtZ-0006q3-Er for importer@patchew.org; Sun, 07 Nov 2021 23:04:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvht-0006Ur-PX for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:29 -0500 Received: from [2607:f8b0:4864:20::d36] (port=40543 helo=mail-io1-xd36.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0002rV-6W for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:28 -0500 Received: by mail-io1-xd36.google.com with SMTP id r8so3005394iog.7 for ; Sun, 07 Nov 2021 19:52:23 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5K9w6Dgj9bW+v4mINR6IMzovYCKqh6rwlm+KG2b5Ybg=; b=rGwrx3XAvePrp0hsVAZQJa2kXVeuZdt/L3RIC83NzDWj68rDJJ3YEKI1AigXRWc02Z cta/X1+lLCSRlAQIzX+pEJoXPc8Xa1FCgs8QNfxcooObttj8O4wPnELzyDXcX2flxD7g 5vnJqiP1fShxpANdgYBX82niwAyXdA2N2xAr7XVBcdemjvURHjBXEIi0AZJTMYRoAY1z FD/UK1sYDSWn5b7IT6D+7tp220y1nV7gfOR92sn8dMXmFBZEXp34Zx0NSCzyfW4E/JXz XTIk/MkvL4oYkWFusqKGOp01OrpKOM8QQajk3ri+j9eNYHcIzZ4aP/jhWoDn7DNZweRs yvbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5K9w6Dgj9bW+v4mINR6IMzovYCKqh6rwlm+KG2b5Ybg=; b=qL6eCpvLXojIBkVzMav5mgLWGHSio9m56OysnLi3RdUbKVoMoFfIuo9LLCD2AeHIfZ t2nviViwOyqEo+CPoOcboKJX+KRnlveaLEERix0x+esGUMFOJ9PkcTPC0HM+j+VW/igX hN1Rd5pHhZHgsEI2zsA1Q1nHlXVaJ6pj4fYmIRmKfO1Fsw3ut1qf7L9jjNOMN0sZGZJ4 k4ZRHdoDC/tjNbI9Z84dLrR2yNS18jgrYme1g8mx/Jk/l45ZiC2IkoKgLPmz/B/h+kw4 WHrU3GixRp2dgpL5OXCm316zyUfgv7P2TLycXjoyJSfQJjao0lw6IEZOUeifPxIhwcNi 0qMw== X-Gm-Message-State: AOAM533j0/kHaKI5sZTJlf5pZ7czUWB2pIURCbMdEYfOC0eh8lUhiyMZ igKyVcPDXRpVMkREcHzfu6U1PgBm5Z7X+A== X-Google-Smtp-Source: ABdhPJwuJaQD5pspEKc7HbJ8ySQC7PwB9nzLF48aqRPIhUJp6NLCJmWBUJlrqceyOBaOIHwtqJZ9FQ== X-Received: by 2002:a05:6638:14c4:: with SMTP id l4mr22620451jak.66.1636343543102; Sun, 07 Nov 2021 19:52:23 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 14/37] bsd-user/arm/target_syscall.h: Add copyright and update name Date: Sun, 7 Nov 2021 20:51:13 -0700 Message-Id: <20211108035136.43687-15-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d36 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344276256100003 Content-Type: text/plain; charset="utf-8" The preferred name for the 32-bit arm is now armv7. Update the name to reflect that. In addition, add Stacey's copyright to this file and update the include guards to the new convention. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_syscall.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/bsd-user/arm/target_syscall.h b/bsd-user/arm/target_syscall.h index ef4b37f017..a5f2bb4e01 100644 --- a/bsd-user/arm/target_syscall.h +++ b/bsd-user/arm/target_syscall.h @@ -1,5 +1,24 @@ -#ifndef BSD_USER_ARCH_SYSCALL_H_ -#define BSD_USER_ARCH_SYSCALL_H_ +/* + * arm cpu system call stubs + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_SYSCALL_H_ +#define _TARGET_ARCH_SYSCALL_H_ =20 struct target_pt_regs { abi_long uregs[17]; @@ -31,6 +50,6 @@ struct target_pt_regs { #define TARGET_FREEBSD_ARM_GET_TP 3 =20 #define TARGET_HW_MACHINE "arm" -#define TARGET_HW_MACHINE_ARCH "armv6" +#define TARGET_HW_MACHINE_ARCH "armv7" =20 -#endif /* !BSD_USER_ARCH_SYSCALL_H_ */ +#endif /* !_TARGET_ARCH_SYSCALL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344578650723.0169505402617; Sun, 7 Nov 2021 20:09:38 -0800 (PST) Received: from localhost ([::1]:60378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvyT-0001kE-9b for importer@patchew.org; Sun, 07 Nov 2021 23:09:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhu-0006Zm-BL for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:30 -0500 Received: from [2607:f8b0:4864:20::136] (port=37389 helo=mail-il1-x136.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0002rj-94 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:30 -0500 Received: by mail-il1-x136.google.com with SMTP id h23so15532821ila.4 for ; Sun, 07 Nov 2021 19:52:25 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3XmuKD3L8C0RdT+vaSED8BhWG5EV9OjA2AgZ0ahq8Uw=; b=mk0AMUynlSIOwY6E4iZcT+o3omMwaOPb3annq6wPg3Dv5N4iScRMRnTAk09AQPFo50 BkkYtd6OSstbtSexk3cuHGOexe6E7Ud9W5MTJ/VcbCRVlMBuqGIdMwrayKvG+vY8WF3e XLhUgmZBQZ+yk16tmw6YfCuB65K2SfM+gRlgrYrRp+tMCll+J3shh4AHiLja7Da37Ps/ bFYhnMOBH/naiJa1v5Mf2rA/l98TMh0w8jaY91W0cAZvr3kl3E2tdkWTb2kfGsZAdo/V CfJ3JgSlgCbzohSbdneRDRt04rlXz3jzbwMw5Yd7rP3dHdNon05H8IVkfUs19cEVq/Vd wdXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3XmuKD3L8C0RdT+vaSED8BhWG5EV9OjA2AgZ0ahq8Uw=; b=xf+7Jdp2rm/wwfItSWtSClXamCSxe9zZFrr94kUppgUcjRb8WuJaWuePXky2GcCW4z 5io+jCoj3g4/mKunIbV2a/6hQui3E9XTLovSFLbI50CL4UTpzJhenhmUNrM9InoyEX/r oo8uVWdRKffSWoGaOV7eSiadMJ2kepl9oPi5/RYVG94JnmBBTiO2c8frRDEvdcLoAWSa 0sfHXhSWsS3a89gkRBo8/TMDD3lyT1CibtP9ln7+j6RNysan4tFpGanoB60G2FoTitL8 /YtbSMaVNqtE8O4z7W+qMU42Av7H6fy5kp1NbS7430kKNWNW6Dh3hhmTo+dQFS1u14JT iyTQ== X-Gm-Message-State: AOAM5301Zrc9xAarfTIGxLoZK2hGey51CHDDx4OYefhfgy4eoAticZ02 Qb3JjTKPz4JoZpSJgQwnyJ0rTm0IHQF/+w== X-Google-Smtp-Source: ABdhPJxswyzqBceC795HS1jZdv+zoQ/6RjTNYZaliWshEhlEG/c/u/2gf5TDDTRL7s0YlLoobKR8dA== X-Received: by 2002:a92:4b06:: with SMTP id m6mr21119978ilg.123.1636343544183; Sun, 07 Nov 2021 19:52:24 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 15/37] bsd-user/arm/target_arch_cpu.c: Target specific TLS routines Date: Sun, 7 Nov 2021 20:51:14 -0700 Message-Id: <20211108035136.43687-16-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::136 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::136; envelope-from=imp@bsdimp.com; helo=mail-il1-x136.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344580955100001 Content-Type: text/plain; charset="utf-8" Target specific TLS routines to get and set the TLS values. Signed-off-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch.h | 28 ++++++++++++++++++++++++ bsd-user/arm/target_arch_cpu.c | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 bsd-user/arm/target_arch.h create mode 100644 bsd-user/arm/target_arch_cpu.c diff --git a/bsd-user/arm/target_arch.h b/bsd-user/arm/target_arch.h new file mode 100644 index 0000000000..93cfaea098 --- /dev/null +++ b/bsd-user/arm/target_arch.h @@ -0,0 +1,28 @@ +/* + * ARM 32-bit specific prototypes for bsd-user + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_H_ +#define _TARGET_ARCH_H_ + +#include "qemu.h" + +void target_cpu_set_tls(CPUARMState *env, target_ulong newtls); +target_ulong target_cpu_get_tls(CPUARMState *env); + +#endif /* !_TARGET_ARCH_H_ */ diff --git a/bsd-user/arm/target_arch_cpu.c b/bsd-user/arm/target_arch_cpu.c new file mode 100644 index 0000000000..02bf9149d5 --- /dev/null +++ b/bsd-user/arm/target_arch_cpu.c @@ -0,0 +1,39 @@ +/* + * arm cpu related code + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#include "target_arch.h" + +void target_cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + if (access_secure_reg(env)) { + env->cp15.tpidrurw_s =3D newtls; + env->cp15.tpidruro_s =3D newtls; + return; + } + + env->cp15.tpidr_el[0] =3D newtls; + env->cp15.tpidrro_el[0] =3D newtls; +} + +target_ulong target_cpu_get_tls(CPUARMState *env) +{ + if (access_secure_reg(env)) { + return env->cp15.tpidruro_s; + } + return env->cp15.tpidrro_el[0]; +} --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16363441485831003.0395569538965; Sun, 7 Nov 2021 20:02:28 -0800 (PST) Received: from localhost ([::1]:37692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvrX-000311-Iq for importer@patchew.org; Sun, 07 Nov 2021 23:02:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvht-0006Wk-Im for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:29 -0500 Received: from [2607:f8b0:4864:20::d36] (port=37853 helo=mail-io1-xd36.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0002ru-59 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:29 -0500 Received: by mail-io1-xd36.google.com with SMTP id k21so81244ioh.4 for ; Sun, 07 Nov 2021 19:52:26 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5iIfFcYyYja/cPaQ9qdIgUErIUCnLNWxpKMyL/JDBtE=; b=NfHOezxAQZwlBSOYp7TJ/oP6B8i4eQo3lr7bpTG4WKbr33nsP+Gy4NKPo4poVrHD3V Dewd6RTtfPdgLtRqMr5/HS/zi8+Hkx/sZT4SGuTJg2A+gm4ooovXm5S7eRajkyMymcem lG+1RWxIjDs3V4kQmtzK2BYf7vueoZR9m2gNGo36mN8j4gQACnK4KJoZwu13uCTdkK9v nAFTI7J5Ie9g3cRjzVG4Eg/zRED041Q4zmjqR6zdGxnq66tPwhruziyNNq07Ah1jBBWi Zeia9MaWMBww3XKz9IqQtsSo7gKg8kH8ArCTWOP7YlSaBz4kCUfvzdZ6wWUoqCy/gJKt 1H6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5iIfFcYyYja/cPaQ9qdIgUErIUCnLNWxpKMyL/JDBtE=; b=rYQLn5zNjeEVkoEz4eeuFky1j1bXS+g9kjlK+3ozadCkCG2Mo0LO3ZIL70001IcZ7d JmwTjduzbzoC/OPsGoiUH6v3M8DmqYxX/76/m3XRdqU/ZcUZEcJj45/XqHIJq7qXuYb7 us5D3OPbBOB17FnpzCF5CRR92RDCkBEZQi1u1sTnoADt/IK41jTbPKJ7P2HWlmkTwqEU hFHrJOG1KT0CdMRtHEoTXG/kcqjD8JC5QHpPLHkyhDLP+COlVj9l/L5r7HAzj5q338ZB brC7sDuQMfSynd3scG+gWUADpTgRqgNTLGvwPl6u3cYe6gYgyXO7RjA9MMaKHX+eQYgd pdWw== X-Gm-Message-State: AOAM531LUuWsK6E1vOo/YvrwJSOBKiLM9hccZ8w66tEonVtiGtmZGNGi r989Y3b0YONdZYq1qs1RPe4/DMj+1jKgdA== X-Google-Smtp-Source: ABdhPJxfEchwduoayk4m5UPDHya/opL2QitujfBL0RA7Bguv24IG3p9wdBma/K7GH2JB3tBxXo/FzQ== X-Received: by 2002:a02:84ec:: with SMTP id f99mr21768957jai.122.1636343545147; Sun, 07 Nov 2021 19:52:25 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 16/37] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions Date: Sun, 7 Nov 2021 20:51:15 -0700 Message-Id: <20211108035136.43687-17-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d36 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Olivier Houchard , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344150717100001 Content-Type: text/plain; charset="utf-8" target_arch_cpu.h is for CPU loop definitions. Create the file and define target_cpu_init and target_cpu_reset for arm. Signed-off-by: Olivier Houchard Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bsd-user/arm/target_arch_cpu.h diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h new file mode 100644 index 0000000000..66215684d6 --- /dev/null +++ b/bsd-user/arm/target_arch_cpu.h @@ -0,0 +1,43 @@ +/* + * arm cpu init and loop + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_CPU_H_ +#define _TARGET_ARCH_CPU_H_ + +#include "target_arch.h" + +#define TARGET_DEFAULT_CPU_MODEL "any" + +static inline void target_cpu_init(CPUARMState *env, + struct target_pt_regs *regs) +{ + int i; + + cpsr_write(env, regs->uregs[16], CPSR_USER | CPSR_EXEC, + CPSRWriteByInstr); + for (i =3D 0; i < 16; i++) { + env->regs[i] =3D regs->uregs[i]; + } +} + +static inline void target_cpu_reset(CPUArchState *cpu) +{ +} + +#endif /* !_TARGET_ARCH_CPU_H */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163634442358542.48440386676418; Sun, 7 Nov 2021 20:07:03 -0800 (PST) Received: from localhost ([::1]:51796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvvy-0004NZ-KY for importer@patchew.org; Sun, 07 Nov 2021 23:07:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhu-0006ZR-8a for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:30 -0500 Received: from [2607:f8b0:4864:20::12b] (port=40560 helo=mail-il1-x12b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhr-0002sG-8g for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:29 -0500 Received: by mail-il1-x12b.google.com with SMTP id k1so15534654ilo.7 for ; Sun, 07 Nov 2021 19:52:26 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IOY3t4AaHZe80iw8hQcSliA4Md0iNA8hrA2Uy7U0qF8=; b=NWg8hvgygLV7X0Z/9/qbt0t5ljSc2gzeDWgm7opkV+uGJkXzMLznrT8wTv33qVwOdp zPLAxIV8jdoHISZnNed47lIE9ZD4MII+kL8X39zxIoFjEYuBu+JyV69zO561bDr/2X8e 67osp/w8G50t3cwkALg1Xe23r7qBz/t2p81+g+h4Fp/OhUngNUQVXgbNJT7/yFuH2+oo lX092XKuaArXt+StTBq/Y/jhRhtSCgAHC0dkAFHP8DCANZM8yX595WK0aiqvNUY4SUek vtjX7WlkN+SRNB5eZm8AIMazmHNk3Xo/4IaGxXx8+J8+4NKcEO0O23Cn1B1L6E+TXPCA Bc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IOY3t4AaHZe80iw8hQcSliA4Md0iNA8hrA2Uy7U0qF8=; b=YzR0KMHNK69Rk31H0VOCAnQkkU5I1FxXvvGLISHk5ucXwTY2vMYEhriII1lece1wXJ yyn4Q4APORnE2fmKxdR/sybvj70FTyd/E48i4/cXWaI1fqi8/SUgkO1X8+Oep5OS/pls RWZbykPGWYquC5IQhwqFZ8s2wQA/O9P1TyM1rfUT+M6BsOIH5aVS58UBmwoiajc1shQT 2B6rC7XAqy8mkZEzrx0wcgPb7roPL9cXP4bH2YGCJ/LRK19p9TiZOyCxbKWPDqq4+zgk cZ6pjp4yBYML871V9HYRDtAopcan6LDCGNWMogjMDHw2CN+wPGHMo8YcKoFat3Ry0rrD Oc0Q== X-Gm-Message-State: AOAM533xgmSQBEH+S5LKdsk6BMht0fte87BneuOdy5yNC9eOhYNe+0uu 3Y6hYRigsI+iR2KSaDebdGZt1+/Byt8Eog== X-Google-Smtp-Source: ABdhPJw/cdRn+Sqe7gkyp4UB07/FMKrikH07ryGYIjcP1TZzaplc474UYWhVo0Xtx8bZ+ZY0JjosaQ== X-Received: by 2002:a92:cd8f:: with SMTP id r15mr45348477ilb.278.1636343545975; Sun, 07 Nov 2021 19:52:25 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 17/37] bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs Date: Sun, 7 Nov 2021 20:51:16 -0700 Message-Id: <20211108035136.43687-18-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12b (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12b; envelope-from=imp@bsdimp.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344425358100001 Content-Type: text/plain; charset="utf-8" Implement target_cpu_clone_regs to clone the resister state on a fork. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 66215684d6..fa45d9335d 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -36,6 +36,14 @@ static inline void target_cpu_init(CPUARMState *env, } } =20 +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong ne= wsp) +{ + if (newsp) { + env->regs[13] =3D newsp; + } + env->regs[0] =3D 0; +} + static inline void target_cpu_reset(CPUArchState *cpu) { } --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344723317377.55693011421965; Sun, 7 Nov 2021 20:12:03 -0800 (PST) Received: from localhost ([::1]:39032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw0o-0006Ot-4h for importer@patchew.org; Sun, 07 Nov 2021 23:12:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhv-0006dC-CQ for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:31 -0500 Received: from [2607:f8b0:4864:20::130] (port=38899 helo=mail-il1-x130.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhs-0002sq-AU for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:30 -0500 Received: by mail-il1-x130.google.com with SMTP id f10so15558847ilu.5 for ; Sun, 07 Nov 2021 19:52:27 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GLFz+hfOtxy/QWMpxfsl9nCO3CdG/6n25bbQ+o+tB/w=; b=eiVxz+QmIfcs5KTbfm+88K3m7ThPM8mUsUBwt6WVFG4zSyMBNgw1YVplNdXmuqq72g RjJ0+w3DvBwS589N6brmmnnJeUgUpEHKBjMasoe2IxNeiciDb2Te4ftnRKGdrAMJHbeS wqW80D3yrpCNcx6qaFgcM6RFb5srYSeA/muLepPIBe6dpqQ3WwN3Vxvwh3rsIQ+lAMkv BlaL3mBdT1eKJa2a+z8ub84qeFza31350gE7sb9J0bqPZjXcuVi4Jw3gL7hnLhRNNzFo zA3KrmhtaNfdOFKfco7GGqy0AZ7VVSV5qc4ifCCoxLLJ6aWafLuHGjXn7cnq41qe8rXG B99g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GLFz+hfOtxy/QWMpxfsl9nCO3CdG/6n25bbQ+o+tB/w=; b=C+Eu9K463W+f7L6oeHxRSVlINRkxCv/HSS26Ln4J6/H77Lh389W19D0L+uDAukr+2L 3dnLTvmkTMHGYYekh1Td2U9PZ8YkgijyV8eN+uATykSfF4nJI6FZ38pqxlforOnvc2uh KQoMf1dHFitU7+dV0gNX/QXc/VmD3vFUMOA9Ksr1SSYnMRiXhMXdlHwSvGCfJtJHGQkr DYgwvK5VM8GX//EnFyb5JoN1dooZFovoO1T8yQU6x5S0AweThJQBAGST/k/LaIPcAMXG Jy1SVxGRy3rI8jqHFKSb5O29qMjdv3UH+WPa7/kVJX5M+1ui8kId1iRLaln1orHEz9AM GM6w== X-Gm-Message-State: AOAM530Y0auHGxWd0G82INqymbAYvZBShZKfov9tUkB/WGTAJHUXtJQV WeFA6BW6hEtmwW2hICk1YnJGblyP6nAV2w== X-Google-Smtp-Source: ABdhPJz3guPC/pEA9MvhgsmaJ6M7s8ZsdXEh6vzbmswT2Y8w6UKKMMnFPgDhEvp4TfxzFpOJt1evYw== X-Received: by 2002:a05:6e02:1c2a:: with SMTP id m10mr31678861ilh.275.1636343547065; Sun, 07 Nov 2021 19:52:27 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 18/37] bsd-user/arm/target_arch_cpu.h: Dummy target_cpu_loop implementation Date: Sun, 7 Nov 2021 20:51:17 -0700 Message-Id: <20211108035136.43687-19-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::130 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Sean Bruno , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344725384100001 Content-Type: text/plain; charset="utf-8" Add a boiler plate CPU loop that does nothing except return an error for all traps. Signed-off-by: Sean Bruno Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index fa45d9335d..2484bdc2f7 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -36,6 +36,28 @@ static inline void target_cpu_init(CPUARMState *env, } } =20 +static inline void target_cpu_loop(CPUARMState *env) +{ + int trapnr; + target_siginfo_t info; + CPUState *cs =3D env_cpu(env); + + for (;;) { + cpu_exec_start(cs); + trapnr =3D cpu_exec(cs); + cpu_exec_end(cs); + process_queued_cpu_work(cs); + switch (trapnr) { + default: + fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting= \n", + trapnr); + cpu_dump_state(cs, stderr, 0); + abort(); + } /* switch() */ + process_pending_signals(env); + } /* for (;;) */ +} + static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong ne= wsp) { if (newsp) { --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344335087554.9969151792912; Sun, 7 Nov 2021 20:05:35 -0800 (PST) Received: from localhost ([::1]:46298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvuW-0000XN-Op for importer@patchew.org; Sun, 07 Nov 2021 23:05:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhv-0006ed-FI for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:31 -0500 Received: from [2607:f8b0:4864:20::d33] (port=43721 helo=mail-io1-xd33.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvht-0002t4-7P for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:31 -0500 Received: by mail-io1-xd33.google.com with SMTP id z26so218576iod.10 for ; Sun, 07 Nov 2021 19:52:28 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=unoUheHOiBFwRIZBJ0G39ayIeTidxh9oy5cQLMJnocc=; b=Ji3jqYOgwzC2XJPxa8/28tjRiU8eTsUpTSkPO+A0KDSc1SJj4vMtSHnANEjjrqbi2M ad059Bm1NeloIKruBps43QkyJuuo9JmGQZ4vc2L4kP15hx/qYbkoz8UNkCg0qF0f+zbG 6snbx9XQO6B1sBlNvhZIacGb4YxDZLNTM6MIIY3mtEljwZnhXMhkVmhMvEMSG3u2IstP LLtmQN5zo2I2Xq7PRhpw1Cx7i+CWBWvvYin/pRPguA2WEeQy6ST3yW6/XQc0s93D5xIE nWZnpMl6rZkWVw8qoxCaLhBP5Uvo9t8eoZrg0L7wCqeKSFq2QqNm1cp1R1ggTDHSWQbp L9qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=unoUheHOiBFwRIZBJ0G39ayIeTidxh9oy5cQLMJnocc=; b=3DR+0k1P/ltTE3jZADXg589KH/daP4u+gnd9xE3LAEiPL9uDtCTsk8EGBfxXNcENCD ijA0X+uC9kVucrkXgbcQjK26bao51t14JQ+vGTIBk9x9avGZ44TC5cDmfTGSw9d8uCpH 1pTjzKxTEg+AuhInOEiY13jlzVaPkykt4fWErPPLW3jxVuGzZaBXyz8Y5+pw2ldyKDei kEXM5DaP0zHqpvy5jxaCDGroANbCm9xig8XGLw67jEQO3Js/D4GbQ8pg4Ayu+EuW2Bbv MX6zWjUJwO8BN5CDjHqOP/htGzEzzlRtf4S4jUb7KY3TXHKk0fsIGMvVFY5dl4i2ION1 4psw== X-Gm-Message-State: AOAM531VnLpBfTQItRJ0S4foIUfJgs//+8bWwx2jfBlB53ghsmOHMaa1 p6A6EJVuwSyFoSxxIUUdyaEnqp7+37ShBA== X-Google-Smtp-Source: ABdhPJwYYZXnyacGGGQms1ge3xdm18zvQZiRA/1RyxDx4bZI0F+JQ8PkmLDatFWKKgu5JBTtKCwhgQ== X-Received: by 2002:a5d:87c8:: with SMTP id q8mr11200624ios.117.1636343548005; Sun, 07 Nov 2021 19:52:28 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 19/37] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions Date: Sun, 7 Nov 2021 20:51:18 -0700 Message-Id: <20211108035136.43687-20-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d33 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d33; envelope-from=imp@bsdimp.com; helo=mail-io1-xd33.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , =?UTF-8?q?Mika=C3=ABl=20Urankar?= , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344336264100001 Implement EXCP_UDEF, EXCP_DEBUG, EXCP_INTERRUPT, EXCP_ATOMIC and EXCP_YIELD. The first two generate a signal to the emulated binary. EXCP_ATOMIC handles atomic operations. The remainder are fancy nops. Signed-off-by: Stacey Son Signed-off-by: Mika=C3=ABl Urankar Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 2484bdc2f7..9f9b380b13 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -48,6 +48,39 @@ static inline void target_cpu_loop(CPUARMState *env) cpu_exec_end(cs); process_queued_cpu_work(cs); switch (trapnr) { + case EXCP_UDEF: + { + /* See arm/arm/undefined.c undefinedinstruction(); */ + info.si_addr =3D env->regs[15]; + + /* illegal instruction */ + info.si_signo =3D TARGET_SIGILL; + info.si_errno =3D 0; + info.si_code =3D TARGET_ILL_ILLOPC; + queue_signal(env, info.si_signo, &info); + + /* TODO: What about instruction emulation? */ + } + break; + case EXCP_INTERRUPT: + /* just indicate that signals should be handled asap */ + break; + case EXCP_DEBUG: + { + + info.si_signo =3D TARGET_SIGTRAP; + info.si_errno =3D 0; + info.si_code =3D TARGET_TRAP_BRKPT; + info.si_addr =3D env->exception.vaddress; + queue_signal(env, info.si_signo, &info); + } + break; + case EXCP_ATOMIC: + cpu_exec_step_atomic(cs); + break; + case EXCP_YIELD: + /* nothing to do here for user-mode, just resume guest code */ + break; default: fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting= \n", trapnr); --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344835085973.743844878257; Sun, 7 Nov 2021 20:13:55 -0800 (PST) Received: from localhost ([::1]:45512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw2b-0002H4-Uv for importer@patchew.org; Sun, 07 Nov 2021 23:13:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhw-0006kl-Uu for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:34 -0500 Received: from [2607:f8b0:4864:20::129] (port=35435 helo=mail-il1-x129.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhv-0002tv-6l for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:32 -0500 Received: by mail-il1-x129.google.com with SMTP id w15so15558361ill.2 for ; Sun, 07 Nov 2021 19:52:30 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IfRWeGYD+0hbc23c7Edg1M5XjxcHd+iZ98b19hdHbHg=; b=h+lyCx3528JpeKv4Yln6Sy72OPZoCCxKjmTZXnrCALhSmdp992bgleJT+hCPqX/sz9 MYl78Ke1RwfdsixnA+UCmUU5kT5O6MufbwlbH9IqZZ/z16Wmuz/YuWLzCVfSm5NrNPyE 2mk4+cU5NjXFy4uexRJ+jS33UPnFwyBo8rKvm5WiJ4hqMw0I15RETcE+vijStdgrmX76 EjZ68O0172zpD/hWW0tkvOliS2hYbfo0exzuGjA1cLmV5vh5rA5ow2tviQxG4zp+tCdG zQraX6cJY7hcRuDOyPdCGi9X9C3pVoSDPkgpGMHbdZ1sjyCENDsAUff1IM73mpQVwrjw rw+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IfRWeGYD+0hbc23c7Edg1M5XjxcHd+iZ98b19hdHbHg=; b=1n5t4GG6f6+KoRPsmiHzuFB0aTTg3lnRNHuhfZAq+N8g0pLTlateb9pm0brY9HBnOr VV/qNQEtArQVinE1IX+V2IQASWeWVDYMGy+BYfb4mXP6UG6J4WcSEjCN+/aVuO4OPQ9W gpDJeWeb9pQ1tGVqMCGujMcqQR4MtW0F/J8OXlyL1c+eh79ozj4qJpxjhIwoXAsxZUz+ 00Bfw6v7d/SAHVGDpYdI9LXAHwkwBsuavIp7unH69A/Xz8/tY0Fuo7upkRnJKlD9Sric IHGvsiFyupy5Pmhmh+OggwSk7A8KPiex88qH4DlwJSBmTN9QOFyfJqrNZ4Lzf0dORAGS uyjQ== X-Gm-Message-State: AOAM531kFFbeFdl3VSBPxG+XwoWNHXKxJ/HzsBEOW9ZS7PQS2pvk+Z4o MBh6b8y01jvjCgdHJ4M1BGqqlSuXO/F+5A== X-Google-Smtp-Source: ABdhPJxLWqXcPZTsil6T1YcFNMubGoXM1Re1az4U8UfOiudO6PY3fIHS1zEVPBj/s3NBD+SLninLNA== X-Received: by 2002:a92:c80d:: with SMTP id v13mr54571731iln.175.1636343548913; Sun, 07 Nov 2021 19:52:28 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 20/37] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions Date: Sun, 7 Nov 2021 20:51:19 -0700 Message-Id: <20211108035136.43687-21-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::129 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::129; envelope-from=imp@bsdimp.com; helo=mail-il1-x129.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Olivier Houchard , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344836054100001 Content-Type: text/plain; charset="utf-8" Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data exceptions cause a SIGSEGV. Signed-off-by: Kyle Evans Signed-off-by: Olivier Houchard Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 9f9b380b13..905a5ffaff 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -65,6 +65,17 @@ static inline void target_cpu_loop(CPUARMState *env) case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; + case EXCP_PREFETCH_ABORT: + /* See arm/arm/trap.c prefetch_abort_handler() */ + case EXCP_DATA_ABORT: + /* See arm/arm/trap.c data_abort_handler() */ + info.si_signo =3D TARGET_SIGSEGV; + info.si_errno =3D 0; + /* XXX: check env->error_code */ + info.si_code =3D 0; + info.si_addr =3D env->exception.vaddress; + queue_signal(env, info.si_signo, &info); + break; case EXCP_DEBUG: { =20 --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344100235397.7529333510722; Sun, 7 Nov 2021 20:01:40 -0800 (PST) Received: from [::1] (port=35016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvql-00018B-6G for importer@patchew.org; Sun, 07 Nov 2021 23:01:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhw-0006kt-VT for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:34 -0500 Received: from [2607:f8b0:4864:20::133] (port=34374 helo=mail-il1-x133.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhv-0002tr-18 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:32 -0500 Received: by mail-il1-x133.google.com with SMTP id j28so15551727ila.1 for ; Sun, 07 Nov 2021 19:52:30 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=98BqBI8TmV8YvyFkZ3y+XgKQlmpyG8KzRCO1YXNy77I=; b=m2GUU55SRn7izQSOGfZhs5tHxX00bTz/xEf17iYq1jPVw+m6QZD3kofFabYA96lasQ DvMRq4KtjPrerKQl1f5JaOLrgcMpgM9fDnpl4HdYDrKLiyjOfgmgrGVbz6QAql57TVCx co5UcT6DyFO7jbJ3OHCA0zwvVIDLQ/ZZFkTmiI3aButqtMrSIc/wcBmCvZKdiBtbjWW8 vdHZ9piIBlHf9NIWJi5z0bHitLMOfgl2ENh57yQ7MFbYXZ4V/M2fFBQXNCn3OrXnJ2Yd 8hJkFdYHh4OdszAIy49jIE/mM7886+Hv0096vnJgITzQcf/Gzqq/iABSG825v0nGiebK YyTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=98BqBI8TmV8YvyFkZ3y+XgKQlmpyG8KzRCO1YXNy77I=; b=E6iF7gwn9QRTfMhkXbofHSb3iRfbAzNe0EvRBQ/42h5lSyhLMn6poQ6UJgg/zZjMVT TCxGEzG7IbVw3FYP52SEpEFe7HzKVqWo/xMewwyqHdVuTLZQiu0I/5bpZt6BkKC7UROZ DMcuPfu49JRO3BhPrMaGFhmlno5ieexV/2vBmQDSeBoVvf7U2jTwS8zwgfVI30BmKKsx 0rs97O3BzXo8odloO2OHk8HUS2t3YrOWJ/o84M/vm+vgSndwyeuK4JEUat9bZgXJvC2l fQuKj49LO694Ea2WCPVNe8monQ3dHL1PK85bdG188wgJQD7juFnnvd9UhzEmSKqT/g+e et4g== X-Gm-Message-State: AOAM531WtJ+bH0dLBvZVU/dFxB3MJFHf+kQK4VC+3wKh68JheU9JfKXe 15VDuYwvxUBfKghCy3EY9QQsm9X93J8WFA== X-Google-Smtp-Source: ABdhPJy+t1j0Okd4J9o0BDAMj6xolQTA/DGlL1kX9YOJoySpNpwpaCkYaXrkaOjG4JAZd92FIKNx4g== X-Received: by 2002:a05:6e02:20e4:: with SMTP id q4mr45550220ilv.71.1636343549810; Sun, 07 Nov 2021 19:52:29 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 21/37] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch Date: Sun, 7 Nov 2021 20:51:20 -0700 Message-Id: <20211108035136.43687-22-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::133 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344102343100001 Content-Type: text/plain; charset="utf-8" Implement the system call dispatch. This implements all three kinds of system call: direct and the two indirect variants. It handles all the special cases for thumb as well. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 94 ++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 905a5ffaff..c675419c30 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -40,6 +40,7 @@ static inline void target_cpu_loop(CPUARMState *env) { int trapnr; target_siginfo_t info; + unsigned int n; CPUState *cs =3D env_cpu(env); =20 for (;;) { @@ -62,6 +63,99 @@ static inline void target_cpu_loop(CPUARMState *env) /* TODO: What about instruction emulation? */ } break; + case EXCP_SWI: + case EXCP_BKPT: + { + /* + * system call + * See arm/arm/trap.c cpu_fetch_syscall_args() + */ + if (trapnr =3D=3D EXCP_BKPT) { + if (env->thumb) { + env->regs[15] +=3D 2; + } else { + env->regs[15] +=3D 4; + } + } + n =3D env->regs[7]; + if (bsd_type =3D=3D target_freebsd) { + int ret; + abi_ulong params =3D get_sp_from_cpustate(env); + int32_t syscall_nr =3D n; + int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8; + + /* See arm/arm/trap.c cpu_fetch_syscall_args() */ + if (syscall_nr =3D=3D TARGET_FREEBSD_NR_syscall) { + syscall_nr =3D env->regs[0]; + arg1 =3D env->regs[1]; + arg2 =3D env->regs[2]; + arg3 =3D env->regs[3]; + get_user_s32(arg4, params); + params +=3D sizeof(int32_t); + get_user_s32(arg5, params); + params +=3D sizeof(int32_t); + get_user_s32(arg6, params); + params +=3D sizeof(int32_t); + get_user_s32(arg7, params); + arg8 =3D 0; + } else if (syscall_nr =3D=3D TARGET_FREEBSD_NR___sysca= ll) { + syscall_nr =3D env->regs[0]; + arg1 =3D env->regs[2]; + arg2 =3D env->regs[3]; + get_user_s32(arg3, params); + params +=3D sizeof(int32_t); + get_user_s32(arg4, params); + params +=3D sizeof(int32_t); + get_user_s32(arg5, params); + params +=3D sizeof(int32_t); + get_user_s32(arg6, params); + arg7 =3D 0; + arg8 =3D 0; + } else { + arg1 =3D env->regs[0]; + arg2 =3D env->regs[1]; + arg3 =3D env->regs[2]; + arg4 =3D env->regs[3]; + get_user_s32(arg5, params); + params +=3D sizeof(int32_t); + get_user_s32(arg6, params); + params +=3D sizeof(int32_t); + get_user_s32(arg7, params); + params +=3D sizeof(int32_t); + get_user_s32(arg8, params); + } + ret =3D do_freebsd_syscall(env, syscall_nr, arg1, arg2= , arg3, + arg4, arg5, arg6, arg7, arg8); + /* + * Compare to arm/arm/vm_machdep.c + * cpu_set_syscall_retval() + */ + if (-TARGET_EJUSTRETURN =3D=3D ret) { + /* + * Returning from a successful sigreturn syscall. + * Avoid clobbering register state. + */ + break; + } + if (-TARGET_ERESTART =3D=3D ret) { + env->regs[15] -=3D env->thumb ? 2 : 4; + break; + } + if ((unsigned int)ret >=3D (unsigned int)(-515)) { + ret =3D -ret; + cpsr_write(env, CPSR_C, CPSR_C, CPSRWriteByInstr); + env->regs[0] =3D ret; + } else { + cpsr_write(env, 0, CPSR_C, CPSRWriteByInstr); + env->regs[0] =3D ret; /* XXX need to handle lseek(= )? */ + /* env->regs[1] =3D 0; */ + } + } else { + fprintf(stderr, "qemu: bsd_type (=3D %d) syscall " + "not supported\n", bsd_type); + } + } + break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344275548840.3241158750201; Sun, 7 Nov 2021 20:04:35 -0800 (PST) Received: from localhost ([::1]:43444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvta-0006sy-Co for importer@patchew.org; Sun, 07 Nov 2021 23:04:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvhy-0006mB-VW for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:37 -0500 Received: from [2607:f8b0:4864:20::d31] (port=35580 helo=mail-io1-xd31.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhw-0002uG-2A for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:33 -0500 Received: by mail-io1-xd31.google.com with SMTP id c206so15927811iof.2 for ; Sun, 07 Nov 2021 19:52:31 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rKLMBYjEYlw1VjEHepSl0BqgSbBEPtGPWDcDEzPgUqg=; b=cJXZ5UEBvURLY9C+HCVOQ6PhBsyhLuyZlDOhItVxfW5gUagn8P25kfL5smpvPzhg1j 8yMZDut/8s8mLYvjc4r2ndsxSYvSWXkOW+p82aNYJGAsNDEC+v9EpSG6aXrEQ3YxkrhZ RPZcft2vXDWBRM+ugjDqEFQPDhLuosq9pkf2ENKu7ctj07Re95Mv6V0R/DFGTRG1n4V9 IGttdSx3fcRmAA9WoLJ+mt8YcExDSlgb44h7xImQu3OgLZOWfal6BFJ441ZgBib5UWOc UUkoA7vWwy0K6KKmim7Ck4Ez/rV/Tb/33s34IKdVQCpEFCbnJCc1FZd/SHknUVgpEyO4 3ghg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rKLMBYjEYlw1VjEHepSl0BqgSbBEPtGPWDcDEzPgUqg=; b=yeFnhj4qzKopGS0a6vEzih9nKFPWvvT7baErxHkvvsrK87YCf7WTQDyn1pQWL/P6dk WVNcpPMkI3Qd8wr0EJ3NW25Xi93kba1MYr9YVlN+pv2srGYJGnBIhE8actsDi7MFMfA0 f49FcQS0pcAeryTO1JaT8aRBfqI5MRvj7cP1Hw9fhFcBTjw6zjP/rHJqBVZju0kmIe2T IFDZk1ID10JZbrCrV8tA/vc2vkHESt8uVbIwY02YrGqM7xNBzPl2iTdXmFFVzGWkOlvQ TUE5kMpjECvSYYOtm7zdo1ZQ17XNT/pJyi2VeeFwVN/6nbchFbHkyMPKkxCWsXcngQBR XhqA== X-Gm-Message-State: AOAM533OdNDlmP0GL2hNdO4Sv1G6Fs4wG06kZlH+s7OF3YtW0YXTd8Jq 9L76/4aJ8hFi1pFfIN41FlPhDAj9vhdSuA== X-Google-Smtp-Source: ABdhPJw7o9FR3RFWy6svo0UDVF9ltptU8k1K/5h0Zbz9/6BhrVlm6KXEtZfIVxE+OvqL6qNsOzD4nw== X-Received: by 2002:a05:6602:2c0d:: with SMTP id w13mr11266965iov.79.1636343550934; Sun, 07 Nov 2021 19:52:30 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 22/37] bsd-user/arm/target_arch_reg.h: Implement core dump register copying Date: Sun, 7 Nov 2021 20:51:21 -0700 Message-Id: <20211108035136.43687-23-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d31 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344276218100001 Content-Type: text/plain; charset="utf-8" Implement the register copying routines to extract registers from the cpu for core dump generation. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_reg.h | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 bsd-user/arm/target_arch_reg.h diff --git a/bsd-user/arm/target_arch_reg.h b/bsd-user/arm/target_arch_reg.h new file mode 100644 index 0000000000..ef5ed5154f --- /dev/null +++ b/bsd-user/arm/target_arch_reg.h @@ -0,0 +1,60 @@ +/* + * FreeBSD arm register structures + * + * Copyright (c) 2015 Stacey Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_REG_H_ +#define _TARGET_ARCH_REG_H_ + +/* See sys/arm/include/reg.h */ +typedef struct target_reg { + uint32_t r[13]; + uint32_t r_sp; + uint32_t r_lr; + uint32_t r_pc; + uint32_t r_cpsr; +} target_reg_t; + +typedef struct target_fp_reg { + uint32_t fp_exponent; + uint32_t fp_mantissa_hi; + u_int32_t fp_mantissa_lo; +} target_fp_reg_t; + +typedef struct target_fpreg { + uint32_t fpr_fpsr; + target_fp_reg_t fpr[8]; +} target_fpreg_t; + +#define tswapreg(ptr) tswapal(ptr) + +static inline void target_copy_regs(target_reg_t *regs, const CPUARMState = *env) +{ + int i; + + for (i =3D 0; i < 13; i++) { + regs->r[i] =3D tswapreg(env->regs[i + 1]); + } + regs->r_sp =3D tswapreg(env->regs[13]); + regs->r_lr =3D tswapreg(env->regs[14]); + regs->r_pc =3D tswapreg(env->regs[15]); + regs->r_cpsr =3D tswapreg(cpsr_read((CPUARMState *)env)); +} + +#undef tswapreg + +#endif /* !_TARGET_ARCH_REG_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345029303640.1855902715633; Sun, 7 Nov 2021 20:17:09 -0800 (PST) Received: from localhost ([::1]:51962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw5k-0006f1-A0 for importer@patchew.org; Sun, 07 Nov 2021 23:17:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi1-0006mP-Fb for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:37 -0500 Received: from [2607:f8b0:4864:20::133] (port=46784 helo=mail-il1-x133.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhx-0002uU-Tk for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:36 -0500 Received: by mail-il1-x133.google.com with SMTP id i11so6317544ilv.13 for ; Sun, 07 Nov 2021 19:52:32 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1ztRBQYqWrUwRLf6NQ4W8izvboRcDbY0eKrhIvHHz3I=; b=wwVNPKwXNB345Y+KHd7cYKOgZiQs1sO2mU5Ex5N/UF3nbBZyYf6TKAcADAJVMeBEQ/ KqD6UUBAW91rYSXH2QuD+isXhM0lJOwVp54xjsPVqK6zulvl/2ZwulNG/n4XcafLGIWt 6KRt3Q8mPhEWhlztuRx9iYD14GViRmsg1ydlnS2tnOO/x40R/XMITwTl1v32FPboh7Vh 4AZISkSek/VWeewYTr6mI/aBKlSy/SRqLAHnU7nnA16egI2Kd/TkHP7SiBdZmWbNKxx7 94iLA/CflVUDPtJzuXfhsLIRxLbD42Ihg+bGxz64vqk7K/aX0cbJ1MjYu4zPR5vJ6ncz cQkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1ztRBQYqWrUwRLf6NQ4W8izvboRcDbY0eKrhIvHHz3I=; b=q7uBbGqpPVZ3noyrAcBvH/TpkTbFkeApKhAazPn9V4OOpjG291gIG20rKQxvA4S5gP f87+E44UpsP2mA9AvkwLnTY8Hs1HuilH53j70Qua/mBQzFIKh2L2iL3A279dK5UjBOjt oB1Qhr5RO9AtiRzr7D3xbVEe7o1wzatjJLDXnvowxsuHLA/CfD3WSNFY4M2Q46vk2Rqh Iks7GXpBnEX7evjPyzIXrv5i7x/b+GK5XLl2U68YYzdwzsLVMHOiDAbwizRjqjfuZSXX Eka04KEtlxahQnA2nG6HPi57oklDtfTGEbCd8LUe36xMmrnxOWh7IrJc4MJB9Aicsw5O qhIg== X-Gm-Message-State: AOAM5317Hv7CotAEh7E0NbZIP1J90NcGKsTTd6x65g/TV1pUyCVq5CNg w1hbCedpg0RZ2PuIOOd6wa+cupcPw1jblA== X-Google-Smtp-Source: ABdhPJy+84jQWRggiXik/h53Z8l3sNekwDhj4LkVYixLAW+4hF+LklY/6bAFXCeLdKjpiHlSbrHjIg== X-Received: by 2002:a05:6e02:1a2d:: with SMTP id g13mr24650043ile.301.1636343551797; Sun, 07 Nov 2021 19:52:31 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 23/37] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space Date: Sun, 7 Nov 2021 20:51:22 -0700 Message-Id: <20211108035136.43687-24-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::133 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345029735100001 Content-Type: text/plain; charset="utf-8" Various parameters describing the layout of the ARM address space. In addition, define routines to get the stack pointer and to set the second return value. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_vmparam.h | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 bsd-user/arm/target_arch_vmparam.h diff --git a/bsd-user/arm/target_arch_vmparam.h b/bsd-user/arm/target_arch_= vmparam.h new file mode 100644 index 0000000000..4bbc04ddf5 --- /dev/null +++ b/bsd-user/arm/target_arch_vmparam.h @@ -0,0 +1,48 @@ +/* + * arm VM parameters definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_VMPARAM_H_ +#define _TARGET_ARCH_VMPARAM_H_ + +#include "cpu.h" + +/* compare to sys/arm/include/vmparam.h */ +#define TARGET_MAXTSIZ (64 * MiB) /* max text size */ +#define TARGET_DFLDSIZ (128 * MiB) /* initial data size limi= t */ +#define TARGET_MAXDSIZ (512 * MiB) /* max data size */ +#define TARGET_DFLSSIZ (4 * MiB) /* initial stack size lim= it */ +#define TARGET_MAXSSIZ (64 * MiB) /* max stack size */ +#define TARGET_SGROWSIZ (128 * KiB) /* amount to grow stack */ + +#define TARGET_RESERVED_VA 0xf7000000 + + /* KERNBASE - 512 MB */ +#define TARGET_VM_MAXUSER_ADDRESS (0xc0000000 - (512 * MiB)) +#define TARGET_USRSTACK TARGET_VM_MAXUSER_ADDRESS + +static inline abi_ulong get_sp_from_cpustate(CPUARMState *state) +{ + return state->regs[13]; /* sp */ +} + +static inline void set_second_rval(CPUARMState *state, abi_ulong retval2) +{ + state->regs[1] =3D retval2; +} + +#endif /* ! _TARGET_ARCH_VMPARAM_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344419852931.3051900149093; Sun, 7 Nov 2021 20:06:59 -0800 (PST) Received: from localhost ([::1]:51748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvvu-0004Lt-Dd for importer@patchew.org; Sun, 07 Nov 2021 23:06:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi1-0006mQ-Fu for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:37 -0500 Received: from [2607:f8b0:4864:20::130] (port=40565 helo=mail-il1-x130.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhy-0002uo-OS for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:36 -0500 Received: by mail-il1-x130.google.com with SMTP id k1so15534771ilo.7 for ; Sun, 07 Nov 2021 19:52:33 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F9IbbLGjnRnokIuDKxQfCzJoAx075CoGnpnzgfUmRKo=; b=2qZ/f0b5vjy9FB7MxofdG6VUphYeRx/TzkSxSPc7XVlmK/cSDm5vg9glvAhHoBbAu/ si2Oz/RkUnzUrz6fI/28dQUJbgyD0RPdxQwhSZ/zvNzlM8pCebkAI3sBxWKesPd8IQXq z34pHUvtx8/l9YTg6Lw+10OShyRB2UD2SVh5fvY5eWt3dz5Wt36QO0+JmJ1CPTs0LhEf UJ5c8CHFtBXCKvrYgJuZJvRXgk+d3gCpQ8vLrv3YHjwFRZkc5sdTPzJyZbXzYAfK1Rjr BHqKdHmYgKJ9IqGt7Er3OBommF310j+SmpiFMcvWdnPFj5e1Lzhg3dUvlsRLateu4Aqz zObg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F9IbbLGjnRnokIuDKxQfCzJoAx075CoGnpnzgfUmRKo=; b=PszBRT2pk19GbVKrAi04TVK4LnC6jRjvruvRi60OY5jS4DedwtWv+LeTM/OOmuP4S9 g/Xk4JrRLZsL8rZZf5qv7tJNwziZvfswLzH9w/WjQ5OAZZJ6+Ptv7bfJGkI84mtTO50q 17I1u0MTj763DQQDZpYco4cOdDgljKHjeuVWy1l+mYhbCXARULv8+s5aBwhYb5MLO2dP n3DauApJqQHhOBNbXVVBXF6FJXpwBhtNpSUI7xJM4mvO3DszZtv4EBGNcvSpkXMp5fXB GqrE3zoRoj6R5kaAsOwZKZa7CgR8RD1hrcT4icDbMnHXGGD1U5Fq0oYJmgBKWdateoI/ VF4A== X-Gm-Message-State: AOAM530kvndtjjxjMz/u6S7M6lo7/Z3ieInlNOzWaxhqbwsTlSbl85zi ImENaxGxKck41ysK87SAo06oXB/cm9SMdw== X-Google-Smtp-Source: ABdhPJyLE0Xgexq5Dkjad+xiMaMT1kwgTtkzwQwxDDZhnAxhGFDonwREIcjhwyWWMb6SO3ENZfYtCw== X-Received: by 2002:a05:6e02:1a4b:: with SMTP id u11mr28258468ilv.96.1636343552730; Sun, 07 Nov 2021 19:52:32 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 24/37] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm Date: Sun, 7 Nov 2021 20:51:23 -0700 Message-Id: <20211108035136.43687-25-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::130 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344421068100001 Content-Type: text/plain; charset="utf-8" Copy of the signal trampoline code for arm, as well as setup_sigtramp to write it to the stack. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_sigtramp.h | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 bsd-user/arm/target_arch_sigtramp.h diff --git a/bsd-user/arm/target_arch_sigtramp.h b/bsd-user/arm/target_arch= _sigtramp.h new file mode 100644 index 0000000000..5d434a9e7e --- /dev/null +++ b/bsd-user/arm/target_arch_sigtramp.h @@ -0,0 +1,49 @@ +/* + * arm sysarch() system call emulation + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_SIGTRAMP_H_ +#define _TARGET_ARCH_SIGTRAMP_H_ + +/* Compare to arm/arm/locore.S ENTRY_NP(sigcode) */ +static inline abi_long setup_sigtramp(abi_ulong offset, unsigned sigf_uc, + unsigned sys_sigreturn) +{ + int i; + uint32_t sys_exit =3D TARGET_FREEBSD_NR_exit; + uint32_t sigtramp_code[] =3D { + /* 1 */ 0xE1A0000D, /* mov r0, sp */ + /* 2 */ 0xE2800000 + sigf_uc, /* add r0, r0, #SIGF_UC */ + /* 3 */ 0xE59F700C, /* ldr r7, [pc, #12] */ + /* 4 */ 0xEF000000 + sys_sigreturn, /* swi (SYS_sigreturn) */ + /* 5 */ 0xE59F7008, /* ldr r7, [pc, #8] */ + /* 6 */ 0xEF000000 + sys_exit, /* swi (SYS_exit)*/ + /* 7 */ 0xEAFFFFFA, /* b . -16 */ + /* 8 */ sys_sigreturn, + /* 9 */ sys_exit + }; + + G_STATIC_ASSERT(sizeof(sigtramp_code) =3D=3D TARGET_SZSIGCODE); + + for (i =3D 0; i < 9; i++) { + tswap32s(&sigtramp_code[i]); + } + + return memcpy_to_target(offset, sigtramp_code, TARGET_SZSIGCODE); +} +#endif /* _TARGET_ARCH_SIGTRAMP_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344635427229.13969231743977; Sun, 7 Nov 2021 20:10:35 -0800 (PST) Received: from localhost ([::1]:35060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvzO-0003eX-DT for importer@patchew.org; Sun, 07 Nov 2021 23:10:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi2-0006op-BG for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:38 -0500 Received: from [2607:f8b0:4864:20::129] (port=39456 helo=mail-il1-x129.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhz-0002uz-2I for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:37 -0500 Received: by mail-il1-x129.google.com with SMTP id x9so15559212ilu.6 for ; Sun, 07 Nov 2021 19:52:34 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4oZ5iwXqrJmDcU+2qXHAQ++/SNnYAx62sujgKs8Ho4M=; b=PvUeTMgN885XhJuKwa4LoMcKbwULkKoBW0eTfmjnXuT0KtKY4bL4ZwKhqNkWLbyg2F yLnWWoSVBPunLqZA3wieBmnI/aIKLVCbMO8ouYrmntFh/9vCmAAtXYPsuNj2kW8B06D5 2v+2sboCWdWClzcac2u92UEDGl/xFyd+54tK/ZkAYUYsp2qiObysJ4dEbIpJibQd+cKn m/7AkpsImVe5k4Rd8f7oCHcFL7lpW2i6lc0X0VGRLZT1O+LBlF1ZNdmJSM/VbmaGMTb/ WQU7EXXrXzJamGWAe6zlovFiK+t6tWIJKkHlY0Roknfpg+XNEOtKu5O63tK9BQUY/s4n zgAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4oZ5iwXqrJmDcU+2qXHAQ++/SNnYAx62sujgKs8Ho4M=; b=N724P0oclTh0R0n9AJOEqvdOCLdxleB2j3eOcZmQLqwGyp4K1CXv162YTZfI5G09b1 QRAlLIuj4RdJLYgQg/rjpT2cZMO3fV/A5/8IhBw5Ffbi2dCBRQRUlzg+ULYKbUiqdVSR WQmLxNfplYNI/FW+BuvZg9mHbVSCyW+Idk15it7FAGeuKYprdmN3izrtIRt69Gu32boP Y1KlW5AeFxoy4RkANR6ljE8HOm3ajBzHQ/0LkVerEDebMMV0ifMsH2w8iXXRLokdpd2n lBXlPjIxVNzR3GjslzO/XMdYe+q3KzLsR9KOOe2yZqVRtpPVuHWI+ksEBAlhKo4RIpFh Ft0w== X-Gm-Message-State: AOAM533CmH+JGXAWx/272TUweXvW3jkiBWInTt/+mkPxTc227BeWvnh0 ldBzsbxzzEhXuv4G44l93ZhHPV+W/sOkSg== X-Google-Smtp-Source: ABdhPJz8xGzgiab25RBf/itPVeHqnz0njYapsXV1UTiJ3llF7+cP1k5Cgbx/pQEen50H7NATQvAXVQ== X-Received: by 2002:a92:dc0c:: with SMTP id t12mr46060285iln.198.1636343553575; Sun, 07 Nov 2021 19:52:33 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 25/37] bsd-user/arm/target_arch_thread.h: Routines to create and switch to a thread Date: Sun, 7 Nov 2021 20:51:24 -0700 Message-Id: <20211108035136.43687-26-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::129 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::129; envelope-from=imp@bsdimp.com; helo=mail-il1-x129.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344637272100001 Content-Type: text/plain; charset="utf-8" Implement target_thread_init (to create a thread) and target_set_upcall (to switch to a thread) for arm. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans --- bsd-user/arm/target_arch_thread.h | 82 +++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 bsd-user/arm/target_arch_thread.h diff --git a/bsd-user/arm/target_arch_thread.h b/bsd-user/arm/target_arch_t= hread.h new file mode 100644 index 0000000000..11c7f76583 --- /dev/null +++ b/bsd-user/arm/target_arch_thread.h @@ -0,0 +1,82 @@ +/* + * arm thread support + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_THREAD_H_ +#define _TARGET_ARCH_THREAD_H_ + +/* Compare to arm/arm/vm_machdep.c cpu_set_upcall_kse() */ +static inline void target_thread_set_upcall(CPUARMState *env, abi_ulong en= try, + abi_ulong arg, abi_ulong stack_base, abi_ulong stack_size) +{ + abi_ulong sp; + + /* + * Make sure the stack is properly aligned. + * arm/include/param.h (STACKLIGN() macro) + */ + sp =3D (u_int)(stack_base + stack_size) & ~0x7; + + /* sp =3D stack base */ + env->regs[13] =3D sp; + /* pc =3D start function entry */ + env->regs[15] =3D entry & 0xfffffffe; + /* r0 =3D arg */ + env->regs[0] =3D arg; + env->spsr =3D ARM_CPU_MODE_USR; + /* + * Thumb mode is encoded by the low bit in the entry point (since ARM = can't + * execute at odd addresses). When it's set, set the Thumb bit (T) in = the + * CPSR. + */ + cpsr_write(env, (entry & 1) * CPSR_T, CPSR_T, CPSRWriteByInstr); +} + +static inline void target_thread_init(struct target_pt_regs *regs, + struct image_info *infop) +{ + abi_long stack =3D infop->start_stack; + memset(regs, 0, sizeof(*regs)); + regs->ARM_cpsr =3D ARM_CPU_MODE_USR; + /* + * Thumb mode is encoded by the low bit in the entry point (since ARM = can't + * execute at odd addresses). When it's set, set the Thumb bit (T) in = the + * CPSR. + */ + if (infop->entry & 1) { + regs->ARM_cpsr |=3D CPSR_T; + } + regs->ARM_pc =3D infop->entry & 0xfffffffe; + regs->ARM_sp =3D stack; + if (bsd_type =3D=3D target_freebsd) { + regs->ARM_lr =3D infop->entry & 0xfffffffe; + } + /* + * FreeBSD kernel passes the ps_strings pointer in r0. This is used by= some + * programs to set status messages that we see in ps. bsd-user doesn't + * support that functionality, so it's ignored. When set to 0, FreeBSD= 's csu + * code ignores it. For the static case, r1 and r2 are effectively ign= ored + * by the csu __startup() routine. For the dynamic case, rtld saves r0= but + * generates r1 and r2 and passes them into the csu _startup. + * + * r0 ps_strings 0 passed since ps arg setting not supported + * r1 obj_main ignored by _start(), so 0 passed + * r2 cleanup generated by rtld or ignored by _start(), so 0 passed + */ +} + +#endif /* !_TARGET_ARCH_THREAD_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344094738255.76087106407704; Sun, 7 Nov 2021 20:01:34 -0800 (PST) Received: from [::1] (port=34614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvqf-0000sF-No for importer@patchew.org; Sun, 07 Nov 2021 23:01:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0006s0-NA for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:41 -0500 Received: from [2607:f8b0:4864:20::12d] (port=33560 helo=mail-il1-x12d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvhz-0002vK-Ii for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:38 -0500 Received: by mail-il1-x12d.google.com with SMTP id l19so15626568ilk.0 for ; Sun, 07 Nov 2021 19:52:35 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oLmdczkCWtTXgS+hIrrLVL8jr4D4Q93OjOn0dkypiZQ=; b=8IjHAEf0T/07Kc4SeBfB/3a/wPPO1ToXqK/JENPSlvi7Iae9ioWVBd/0IqAAsbRaW+ VOk8a5SEfF+2NOTYfbjXvZXvsEvMHOIqLSeoE1/1dD2ce0DMfYic3/0EzfJ8Bkl92N+e 7CTDh4K/eTFKU6+a7WUBdPfyejxPu+10TBtqEKa/SuKP8/r1syAyzQt5g0K/3qDmTZwY c4KgkeR+YFngMANhGR9YdoPbSbTQ6tUMs1WWkXHoqLbiz/iflpzBbUY0+LxlHvk7aiIM fQmzSh5rk8ERIq1zZ2kk4jPUWIipeq+pSwKPfwxMvvOhKczSRTq6996Mv3QG1ppFn17S yxwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oLmdczkCWtTXgS+hIrrLVL8jr4D4Q93OjOn0dkypiZQ=; b=B7+vKEmPdYbCiGvDes2RrAS9wkZyQ72VJsIhVK611/+wSkHjo5KGAXzUMRXsPYAWHf oQ70Q60dpsW0xjBj451kx/yJydRP4pQHi3QcjQgf4QXe2HTcCaTj2LdzNM4jU924UQpu WAXQ2saYV3TsZcGpW/tJ8sY6dpj4VYvNSx+lr76oLo/BjJVjeuZToMCpDQ3/oQU/4Rs9 2wbOH2NskvcV9NUmaRtcfyPpP1dzMzMXMeDe+WFAzzUDdr9pG8/148oRZ9fzHdgPYtmu Y7uukcTqW8+OYpipKkZHImVt41WopvGrkSQLWKrM949JUOSu/Zs1GfLu1Ng6snzEjia2 B3gQ== X-Gm-Message-State: AOAM531nT/HgiYD4VNiK4/FxO4lokdwebOjcYBdsFHcBDa4cVLbcvvZ3 2a9OfcYJVyrotezjtoin2T0SPSU/JvCBxQ== X-Google-Smtp-Source: ABdhPJyAY2xjK7jP6X5K+EirXHF14L+LHzRS7SfPwzzE1XRiVIofKYJQ5eXxYXBVgJ8/NownPWo8Ig== X-Received: by 2002:a05:6e02:174a:: with SMTP id y10mr9572350ill.68.1636343554472; Sun, 07 Nov 2021 19:52:34 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 26/37] bsd-user/arm/target_arch_elf.h: arm defines for ELF Date: Sun, 7 Nov 2021 20:51:25 -0700 Message-Id: <20211108035136.43687-27-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12d (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12d; envelope-from=imp@bsdimp.com; helo=mail-il1-x12d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344096124100002 Content-Type: text/plain; charset="utf-8" Basic set of defines needed for arm ELF file activation. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bsd-user/arm/target_arch_elf.h diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h new file mode 100644 index 0000000000..15b5c66511 --- /dev/null +++ b/bsd-user/arm/target_arch_elf.h @@ -0,0 +1,36 @@ +/* + * arm ELF definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_ELF_H_ +#define _TARGET_ARCH_ELF_H_ + +#define ELF_START_MMAP 0x80000000 +#define ELF_ET_DYN_LOAD_ADDR 0x500000 + +#define elf_check_arch(x) ((x) =3D=3D EM_ARM) + +#define ELF_CLASS ELFCLASS32 +#define ELF_DATA ELFDATA2LSB +#define ELF_ARCH EM_ARM + +#define USE_ELF_CORE_DUMP +#define ELF_EXEC_PAGESIZE 4096 + +#define ELF_HWCAP 0 + +#endif /* _TARGET_ARCH_ELF_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344898070912.1068330631686; Sun, 7 Nov 2021 20:14:58 -0800 (PST) Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw3c-0003xZ-T1 for importer@patchew.org; Sun, 07 Nov 2021 23:14:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0006sJ-Pr for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:41 -0500 Received: from [2607:f8b0:4864:20::12b] (port=38895 helo=mail-il1-x12b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi1-0002vU-8E for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:38 -0500 Received: by mail-il1-x12b.google.com with SMTP id f10so15558996ilu.5 for ; Sun, 07 Nov 2021 19:52:36 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8R82c+oSIU+sp8WqnJE/Io3vjzLSVpjkS5kzwk9Q/Pk=; b=RZEx6SDAu9e0UUOZnTNwtQqOun36orq0oaAKyxFxyCEqVaGD3BKeUFP34tO+y92SM+ Dz0ENh8cubvy+At8qCKd0SZI2eTd7WddFFO21bK3NULNM6n/EdZo65x1Wz4FK8xyhs9r z8G1Ny5GmXcGUYwrsCpqrW6msiaJkp0fhix5/I9g811kgrGNo95czm0G1HZeKbBP935M szrieI88P6v/Qm6YE5Vpu1iv8oVUWVa7dVVd0+TsqicAz3xum35uwh3Psdyoam6rwE8u sPMOfg8suh1BDC7mCAb4rfpGsFwyCWEDWncJV4qkuSWhWG+8rhox7oV670cqzmAwjm7o Imhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8R82c+oSIU+sp8WqnJE/Io3vjzLSVpjkS5kzwk9Q/Pk=; b=DO9fhxb5NjZLFmmSe1+QBM9nOFTZGSTWkGx3lvYmSi4Ar2RGXDNDXPyTniAXur3sXx /2k76n2LWLHGkcxEH53jnHIjG3K851aS0+j7v+k6i6piqceYVzRWMP7MUjbNIeQZCFF0 7P2C8CEA7QmK87EEayUNeJ6md9keOlO8lnnnDtXGjDtO3QFb4Uatfltepv+6xGkCF4Eu nwu5muK3PMkOXZvXhwxgDvorjr83puCaD792aKnQrSda/GGfQmOmSzHV8LOTR2z8iQbl TMvchtADxITUPLYeL07EkoqGRgNCQce+PpcMf9vl9UymbsTAQVqUZNQ/Mgnpbi3mwy4k psfA== X-Gm-Message-State: AOAM53373TanS6tvSldfS0c+kxlhVlfj9gU2PVI4ig6UCuKvcZeXxlYh 67PgScM/1VSm31Fp66X5kuvhb6x83WQ71w== X-Google-Smtp-Source: ABdhPJz4MCpHPM94oowND6IhOPPtrFsam50KbRGnaBD9RdzLjVCtj8LAWlUTpmTJrMX1rQXHlhmPRQ== X-Received: by 2002:a05:6e02:168c:: with SMTP id f12mr32457301ila.277.1636343555494; Sun, 07 Nov 2021 19:52:35 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 27/37] bsd-user/arm/target_arch_elf.h: arm get hwcap Date: Sun, 7 Nov 2021 20:51:26 -0700 Message-Id: <20211108035136.43687-28-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12b (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12b; envelope-from=imp@bsdimp.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344899185100001 Content-Type: text/plain; charset="utf-8" Implement get_elf_hwcap to get the first word of hardware capabilities. Signed-off-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 72 +++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index 15b5c66511..02d25b8926 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -31,6 +31,76 @@ #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 =20 -#define ELF_HWCAP 0 +#define ELF_HWCAP get_elf_hwcap() + +#define GET_FEATURE(feat, hwcap) \ + do { if (arm_feature(&cpu->env, feat)) { hwcaps |=3D hwcap; } } while = (0) + +#define GET_FEATURE_ID(feat, hwcap) \ + do { if (cpu_isar_feature(feat, cpu)) { hwcaps |=3D hwcap; } } while (= 0) + +enum { + ARM_HWCAP_ARM_SWP =3D 1 << 0, + ARM_HWCAP_ARM_HALF =3D 1 << 1, + ARM_HWCAP_ARM_THUMB =3D 1 << 2, + ARM_HWCAP_ARM_26BIT =3D 1 << 3, + ARM_HWCAP_ARM_FAST_MULT =3D 1 << 4, + ARM_HWCAP_ARM_FPA =3D 1 << 5, + ARM_HWCAP_ARM_VFP =3D 1 << 6, + ARM_HWCAP_ARM_EDSP =3D 1 << 7, + ARM_HWCAP_ARM_JAVA =3D 1 << 8, + ARM_HWCAP_ARM_IWMMXT =3D 1 << 9, + ARM_HWCAP_ARM_CRUNCH =3D 1 << 10, + ARM_HWCAP_ARM_THUMBEE =3D 1 << 11, + ARM_HWCAP_ARM_NEON =3D 1 << 12, + ARM_HWCAP_ARM_VFPv3 =3D 1 << 13, + ARM_HWCAP_ARM_VFPv3D16 =3D 1 << 14, + ARM_HWCAP_ARM_TLS =3D 1 << 15, + ARM_HWCAP_ARM_VFPv4 =3D 1 << 16, + ARM_HWCAP_ARM_IDIVA =3D 1 << 17, + ARM_HWCAP_ARM_IDIVT =3D 1 << 18, + ARM_HWCAP_ARM_VFPD32 =3D 1 << 19, + ARM_HWCAP_ARM_LPAE =3D 1 << 20, + ARM_HWCAP_ARM_EVTSTRM =3D 1 << 21, +}; + +static uint32_t get_elf_hwcap(void) +{ + ARMCPU *cpu =3D ARM_CPU(thread_cpu); + uint32_t hwcaps =3D 0; + + hwcaps |=3D ARM_HWCAP_ARM_SWP; + hwcaps |=3D ARM_HWCAP_ARM_HALF; + hwcaps |=3D ARM_HWCAP_ARM_THUMB; + hwcaps |=3D ARM_HWCAP_ARM_FAST_MULT; + + /* probe for the extra features */ + /* EDSP is in v5TE and above */ + GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP); + GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT); + GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE); + GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON); + GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS); + GET_FEATURE(ARM_FEATURE_LPAE, ARM_HWCAP_ARM_LPAE); + GET_FEATURE_ID(aa32_arm_div, ARM_HWCAP_ARM_IDIVA); + GET_FEATURE_ID(aa32_thumb_div, ARM_HWCAP_ARM_IDIVT); + GET_FEATURE_ID(aa32_vfp, ARM_HWCAP_ARM_VFP); + + if (cpu_isar_feature(aa32_fpsp_v3, cpu) || + cpu_isar_feature(aa32_fpdp_v3, cpu)) { + hwcaps |=3D ARM_HWCAP_ARM_VFPv3; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + hwcaps |=3D ARM_HWCAP_ARM_VFPD32; + } else { + hwcaps |=3D ARM_HWCAP_ARM_VFPv3D16; + } + } + GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4); + + return hwcaps; +} + +#undef GET_FEATURE +#undef GET_FEATURE_ID =20 #endif /* _TARGET_ARCH_ELF_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344785992140.8090157710194; Sun, 7 Nov 2021 20:13:05 -0800 (PST) Received: from localhost ([::1]:41632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw1o-000896-RL for importer@patchew.org; Sun, 07 Nov 2021 23:13:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0006sA-Nt for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:41 -0500 Received: from [2607:f8b0:4864:20::12c] (port=38896 helo=mail-il1-x12c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi1-0002vg-EJ for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:38 -0500 Received: by mail-il1-x12c.google.com with SMTP id f10so15559021ilu.5 for ; Sun, 07 Nov 2021 19:52:37 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I1XrwZ0o7hRgTEhkk9E1BQTq9616nNWJfCEFdNAWs4w=; b=iHtHR3+L3TPKMgvw29wWTsuJmwq/CPpAaT3lOZGdLFgE648Hpw3GP/8Cni2Xsh6A62 XfnGsxoFiLrEyxmfIwttGim2RCFqlXqiByVUPWdi7Gzd3Ydfp4vvUZq3lfXBjdvGUG8w CDTTAGDVf4FoGAw5bQwn8MjtlK+FW8gyypZh8zjR6AjNlNugiy7JE1O7rFzHfmzgbDHt Xhd+8q4m/hep/KNk7GoW5DwQQ0xRiTXOFeWEBCaPggEBmKqHl0qAny+D7k/hfFzZaaG1 evnMgOXLpPJTW4sNM+fcKmOvJJcgnL2fB9VbarW1p/UdeCPwRVDbxjLI/gi2LiHrqjw2 YoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I1XrwZ0o7hRgTEhkk9E1BQTq9616nNWJfCEFdNAWs4w=; b=p38x5JHMbl8VY72L8X5ReN0xe09a6CDweB6TbZb5sLLGwQaPLQrliEXaLx1Wz9aAJ1 A3F1acTbMVe4ZawcMuhLgW6QL2P55H/cMFVDs6j/wvVKnOsA4ev7REHQfNnZl1g3VNjv C+gOjHWthJlKoKXUdiOeKcV6/FIB8+M5MXp1BlCyR6Mf0so+3tyfhKG8It3Qxq4qxVNh EIb/SUDpMrKXXyjA7MejrbiiIIvLI5D2fXts67g03R4oYjkSeX79Bu3aY2CNLeTcF2Uf uxsWX04wlizGLeBkb2DprRPmCVDzhpl5WliwnKaR/3SMI/r/x/FIizOjuuTjhkoH2whp oR5A== X-Gm-Message-State: AOAM530quo/QB66OWDZTJ9d5yj6DWRWlLHXLGfsAH9dYMYei+ku2+LzG qZDMAsClQfU671o0nvUKJeu6dxuMfyu56A== X-Google-Smtp-Source: ABdhPJzngoF5WBay+ClD50mdExal44tbM6pudV5iaWjZXs7htVFEPy69H4qABd+0OTWl94gdBN0cTA== X-Received: by 2002:a92:c261:: with SMTP id h1mr33309867ild.291.1636343556337; Sun, 07 Nov 2021 19:52:36 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 28/37] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl Date: Sun, 7 Nov 2021 20:51:27 -0700 Message-Id: <20211108035136.43687-29-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::12c (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::12c; envelope-from=imp@bsdimp.com; helo=mail-il1-x12c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344788097100001 Content-Type: text/plain; charset="utf-8" Implement the extended HW capabilities for HWCAP2. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index 02d25b8926..4a0215d02e 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -32,6 +32,7 @@ #define ELF_EXEC_PAGESIZE 4096 =20 #define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP2 get_elf_hwcap2() =20 #define GET_FEATURE(feat, hwcap) \ do { if (arm_feature(&cpu->env, feat)) { hwcaps |=3D hwcap; } } while = (0) @@ -64,6 +65,14 @@ enum { ARM_HWCAP_ARM_EVTSTRM =3D 1 << 21, }; =20 +enum { + ARM_HWCAP2_ARM_AES =3D 1 << 0, + ARM_HWCAP2_ARM_PMULL =3D 1 << 1, + ARM_HWCAP2_ARM_SHA1 =3D 1 << 2, + ARM_HWCAP2_ARM_SHA2 =3D 1 << 3, + ARM_HWCAP2_ARM_CRC32 =3D 1 << 4, +}; + static uint32_t get_elf_hwcap(void) { ARMCPU *cpu =3D ARM_CPU(thread_cpu); @@ -100,6 +109,19 @@ static uint32_t get_elf_hwcap(void) return hwcaps; } =20 +static uint32_t get_elf_hwcap2(void) +{ + ARMCPU *cpu =3D ARM_CPU(thread_cpu); + uint32_t hwcaps =3D 0; + + GET_FEATURE_ID(aa32_aes, ARM_HWCAP2_ARM_AES); + GET_FEATURE_ID(aa32_pmull, ARM_HWCAP2_ARM_PMULL); + GET_FEATURE_ID(aa32_sha1, ARM_HWCAP2_ARM_SHA1); + GET_FEATURE_ID(aa32_sha2, ARM_HWCAP2_ARM_SHA2); + GET_FEATURE_ID(aa32_crc32, ARM_HWCAP2_ARM_CRC32); + return hwcaps; +} + #undef GET_FEATURE #undef GET_FEATURE_ID =20 --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345130182627.5323838233767; Sun, 7 Nov 2021 20:18:50 -0800 (PST) Received: from localhost ([::1]:57592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw7N-00021w-5t for importer@patchew.org; Sun, 07 Nov 2021 23:18:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi7-0006zB-Vp for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:44 -0500 Received: from [2607:f8b0:4864:20::d2e] (port=41565 helo=mail-io1-xd2e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0002w2-BQ for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:43 -0500 Received: by mail-io1-xd2e.google.com with SMTP id p193so17419938iod.8 for ; Sun, 07 Nov 2021 19:52:38 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xELoQ9MP23ZY0icqqnGEqd1dDOY3xpL6nxhgED/dCUI=; b=c2Xml1ebdKMSjPdrT89j/5iAd0LWTgZWFfP4cB50jBECq8YCkvyIaTKH6ylql7tt05 tM256MR+/MwcYu1pfqTYXC1JnaNsB2f2t9hU5CYMusLs31/4yZJpe03ps4WttqvAD8ym Cb5gR2gGP0Rhat+uNOLzC6hCVDjdsP0DM8KhhxzY9AilWNDLl/Ng+eZ/1GIIWac5Xarc rY9L8Zu9q4vevzJu3eC8PFhJ9v0djwBkx3vCFAEJjjcDrxwMtJ9RqjX0yhOgzzjF7B/+ 2L6ZqOPKSPei9PuAi4MeIFoZi8SPnDTyDF/ZxkW8BCY0a4grHL/FQ96L5uAlxm57Lbx0 w3KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xELoQ9MP23ZY0icqqnGEqd1dDOY3xpL6nxhgED/dCUI=; b=VTNE7WR01q8algcLuIeQWPDb+tfkPmK0B7qAVlQMTScenHrQiTmqbgsOLAybTBkMmo l6vgO8RW8mRi/T8+QBcjbi5wSakrzSw4x1Fl/1ZPBknKGD82E6q9huo/zTm9QLF52UhA dzjbu/R49AmY18S7gX+DX8UXLXmqOLTqyo2DKcYftpWlbbT24INh5kmGT8xW36gAJxhK 2igLsmx8S/ALh/Wpy/5QNVIk/J2hJT+Q7T2x3EVNh7OhwJ1QRo9LS8PMHI+uPNZhmeBh a57z5ByEig/QGVBLoxZA/xNPw1sG7/SOS/ZtvDXR1mqqi+2XFRi4SAHE+q44P+dLUbsj z7cQ== X-Gm-Message-State: AOAM532heqztEOg10jD4pLwZFC8vlvulNsytgpM42fGSRsdDBX+EOiXx WiPRQUk5SIlvew26ACpU58leCYgBIsI+Hw== X-Google-Smtp-Source: ABdhPJwKOy0qgXp9oVAhWeWwF/m6gle+rrE1GD3icAOwRusDYsAKa/poazBig+WN1Q988MSm4Z4BlA== X-Received: by 2002:a05:6602:2c46:: with SMTP id x6mr5697676iov.38.1636343557198; Sun, 07 Nov 2021 19:52:37 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 29/37] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack Date: Sun, 7 Nov 2021 20:51:28 -0700 Message-Id: <20211108035136.43687-30-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d2e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2e; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345132328100001 Content-Type: text/plain; charset="utf-8" Defines for registers and stack layout related to signals. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 bsd-user/arm/target_arch_signal.h diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_s= ignal.h new file mode 100644 index 0000000000..973183d99c --- /dev/null +++ b/bsd-user/arm/target_arch_signal.h @@ -0,0 +1,57 @@ +/* + * arm signal definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_SIGNAL_H_ +#define _TARGET_ARCH_SIGNAL_H_ + +#include "cpu.h" + +#define TARGET_REG_R0 0 +#define TARGET_REG_R1 1 +#define TARGET_REG_R2 2 +#define TARGET_REG_R3 3 +#define TARGET_REG_R4 4 +#define TARGET_REG_R5 5 +#define TARGET_REG_R6 6 +#define TARGET_REG_R7 7 +#define TARGET_REG_R8 8 +#define TARGET_REG_R9 9 +#define TARGET_REG_R10 10 +#define TARGET_REG_R11 11 +#define TARGET_REG_R12 12 +#define TARGET_REG_R13 13 +#define TARGET_REG_R14 14 +#define TARGET_REG_R15 15 +#define TARGET_REG_CPSR 16 +#define TARGET__NGREG 17 +/* Convenience synonyms */ +#define TARGET_REG_FP TARGET_REG_R11 +#define TARGET_REG_SP TARGET_REG_R13 +#define TARGET_REG_LR TARGET_REG_R14 +#define TARGET_REG_PC TARGET_REG_R15 + +#define TARGET_INSN_SIZE 4 /* arm instruction size */ + +/* Size of the signal trampolin code. See _sigtramp(). */ +#define TARGET_SZSIGCODE ((abi_ulong)(9 * TARGET_INSN_SIZE)) + +/* compare to arm/include/_limits.h */ +#define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack s= ize */ +#define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended s= ize */ + +#endif /* !_TARGET_ARCH_SIGNAL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345252329133.8803504207607; Sun, 7 Nov 2021 20:20:52 -0800 (PST) Received: from localhost ([::1]:33300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw9L-0004fh-4W for importer@patchew.org; Sun, 07 Nov 2021 23:20:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi7-0006z5-Vd for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:44 -0500 Received: from [2607:f8b0:4864:20::d36] (port=42835 helo=mail-io1-xd36.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0002wJ-E4 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:43 -0500 Received: by mail-io1-xd36.google.com with SMTP id x10so3288192ioj.9 for ; Sun, 07 Nov 2021 19:52:38 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qz2DLL0tx93vRkMGyLNPCCWpP2HVx1ms+ORRUByobBY=; b=6kERkSJ5C5WvQZulIoet5WKKZYaFQwEo1gwteXoWW2YNu40WSfPkRpB1JIktAQt/cA rdbZjcSbWEUZoKJWMdVDjfQN5zo5CYWaYXUlPq4PjHf9aWrR03mn8V6Vksu52CBVTSz9 EscsUoWBJQyGY2PnWBqpefO/L056TGW+6XGstXjPCzxszKFTaw+1gMtZJ/dkSTu9L8tf avs4bg0yoGu5l/RHdGWp7hX3cWWKGFk+a23nGWe1WviS503xT6BloiaeWs2C9RGsCpCC 2RCM/myK7vRVVu0KP/T1qeEXdJmJKeVF3oqEIUoXvDfh7EsdofUkO/uIhWGQaKSzh9Du hDQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qz2DLL0tx93vRkMGyLNPCCWpP2HVx1ms+ORRUByobBY=; b=BKh7v/VOl+Pp4DQjp1Tv6xqtdfTyJEVDAxqXD/GtotaCFxEB8cx8nY7tH2qlM/KuA1 joM1eP3fm6DYgFjMPrr890CqCa2QxVq1w2ORsKHhj7qosIgZW/jGnQ0iwh4Vhe+tVCoD e5CDzfASgWd2GEJKBqv4doTzLBDNa1LVhpWAVGb52zcunjnm2C5u0l3rbsXPc0E7RG4q a0AzAQYKBcPrRSKSqrb491m+9AoRp+93gh9c/xjOzBbNVl/lcZsGroJ2RFaa48A+M+Ru nsPgkYJLCZAmJgJtEU5rk+d716eblWggKwR9ObTeTHcLosZm9gRtLWHroRH3H6BblY9j 2jdQ== X-Gm-Message-State: AOAM531r3UbE8DXNW9PIggk9ixcCTxGEgfKiEfYnzwKDjGcCXnlan367 lnZQmT+y17wcjqLlYiJoa/Vfw0+BzHZEtg== X-Google-Smtp-Source: ABdhPJwlmtWfJ/R+w5Y3qSjnVidOoOBTozG3p2EM817YPRkkHeOIcJjFDLaoeZi4eh6reyq6xOts8A== X-Received: by 2002:a05:6602:2f15:: with SMTP id q21mr6064941iow.113.1636343558086; Sun, 07 Nov 2021 19:52:38 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 30/37] bsd-user/arm/target_arch_signal.h: arm machine context and trapframe for signals Date: Sun, 7 Nov 2021 20:51:29 -0700 Message-Id: <20211108035136.43687-31-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d36 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345254004100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_s= ignal.h index 973183d99c..9527335cc9 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -54,4 +54,32 @@ #define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack s= ize */ #define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended s= ize */ =20 +/* + * Floating point register state + */ +typedef struct target_mcontext_vfp { + abi_ullong mcv_reg[32]; + abi_ulong mcv_fpscr; +} target_mcontext_vfp_t; + +typedef struct target_mcontext { + abi_uint __gregs[TARGET__NGREG]; + + /* + * Originally, rest of this structure was named __fpu, 35 * 4 bytes + * long, never accessed from kernel. + */ + abi_ulong mc_vfp_size; + abi_ptr mc_vfp_ptr; + abi_int mc_spare[33]; +} target_mcontext_t; + +#include "target_os_ucontext.h" + +struct target_sigframe { + target_siginfo_t sf_si; /* saved siginfo */ + target_ucontext_t sf_uc; /* saved ucontext */ + target_mcontext_vfp_t sf_vfp; /* actual saved VFP context */ +}; + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345076826183.3899399965054; Sun, 7 Nov 2021 20:17:56 -0800 (PST) Received: from localhost ([::1]:54520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw6V-0008Pa-QC for importer@patchew.org; Sun, 07 Nov 2021 23:17:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi6-0006vh-QW for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:42 -0500 Received: from [2607:f8b0:4864:20::132] (port=45002 helo=mail-il1-x132.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0002wV-DJ for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:42 -0500 Received: by mail-il1-x132.google.com with SMTP id h2so15475271ili.11 for ; Sun, 07 Nov 2021 19:52:39 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wTJ+aNmLUuLgPbIqCfjTw0uGO5B5PIHdICe2l5V6Jhk=; b=At6Q16nSfw6xubgdSP7jv5+WuNGJnjyilld+vaUH6D/4kmfYjnoLaq5fm+yAkXki9S xddcTUQy/TI3LH0+Y7pVVGSLBqv/4kJ8I8OfF3Gs7lWelanHjWehQ1m9fPIcVbRIwPdC h48/xR6JIcCyBR9h3tOAEuuPRktzljDlO2bpxAcgeP0G1Q2LtuWp6JsAaIBkJbAK4vDi w3Bm4QM6vvAwfBK7Tl9RrdTUaiIBQ9pQyz29GYU703DZxrKkKOqf/MQYg5PMZzXKX9yq gs6q0Pl1CUi/FPE1etuGOpGUyz9nBVZ1Ftrq1e1PZ7Iz5wWAcr5IxYqHKxt3I3Ez5fPd nj2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wTJ+aNmLUuLgPbIqCfjTw0uGO5B5PIHdICe2l5V6Jhk=; b=3WKhfZxrpPGVmVRrAmvXhzM2WhDJmWeSDwjnHxXX1+wVv2QeXSbZnvUUMhCU6ZYWv1 tgdYjtJxOK8JemXkLU5a/nUu+K2PGLw00s6khMdYMOvJgS/NaReEV9tAV3ye2zP4Ld25 jrIctl30EUfJMDJfcYttIqXHX6EWvTaDW7YY/t4hDMrE8uMaNTFHiSKFHVbrgmNQQHcf hR/KbQmjd6T2O43iMZ4mhgbre+c/fkbAQKzfxUHlT/Ak5s6dzQJaCPZBIscecSzpuDMU 9nyNrNrPm4GlAwfioa5/T4PTHEb+IEgS6MmW2UU7u9Wjrp1DFPHeSmGaRtHlYuS7rKdv 5EIg== X-Gm-Message-State: AOAM5318XET/5sx7/pDL1eLoKIB0MM4G7TWSZz5sl62y+HOBVSurZfgt l/1WFEJU8jmfKHcaCSLwaV3bug7mHqW3Cg== X-Google-Smtp-Source: ABdhPJwNYreqhVlq+C8Xorb7NxcFCR2Ex+0JeIcvtKR0leJpDCq0dOCoiHTnwEbjzUr+53dM+bs59w== X-Received: by 2002:a05:6e02:1e0c:: with SMTP id g12mr50847960ila.86.1636343558939; Sun, 07 Nov 2021 19:52:38 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 31/37] bsd-user/arm/target_arch_signal.h: Define size of *context_t Date: Sun, 7 Nov 2021 20:51:30 -0700 Message-Id: <20211108035136.43687-32-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::132 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::132; envelope-from=imp@bsdimp.com; helo=mail-il1-x132.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345078243100001 Content-Type: text/plain; charset="utf-8" Define the native sizes of mcontext_t and ucontext_t so that the tests in target_os_ucontext.h ensure the size of arm's version of these structures is correct. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_s= ignal.h index 9527335cc9..f1844dbf22 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -74,6 +74,9 @@ typedef struct target_mcontext { abi_int mc_spare[33]; } target_mcontext_t; =20 +#define TARGET_MCONTEXT_SIZE 208 +#define TARGET_UCONTEXT_SIZE 260 + #include "target_os_ucontext.h" =20 struct target_sigframe { --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345325109414.3816249520196; Sun, 7 Nov 2021 20:22:05 -0800 (PST) Received: from localhost ([::1]:35466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjwAV-0006Cf-Ue for importer@patchew.org; Sun, 07 Nov 2021 23:22:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi8-00070n-BT for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:44 -0500 Received: from [2607:f8b0:4864:20::d32] (port=36642 helo=mail-io1-xd32.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0002xx-EI for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:44 -0500 Received: by mail-io1-xd32.google.com with SMTP id e144so17446095iof.3 for ; Sun, 07 Nov 2021 19:52:40 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OeOnvHCc2lg5sRstjwa89XicYu0PFuIOGrd2TLaUNlw=; b=Wit1wQA/xvMwxTN2yOyYJg7JMtwSwipR01hdkizigcgO1VwQyasnV6ssK1MJbVrVvh H+xNO1kaypudARdB8iXgSBB3JnF9sIFkgFcW3Xj36AciWwnR2aqXeiwAvvCc0hzT8myF MrokW1k9rDVuMGGCeOMFKFbS8LN0ltKUFOk9YSLB527UQUvtCW1LSUFlkeqGjVG/U2Zq Dvu6tcLtMO14gT5UwnzMIfZD0T8Lmg25Hc3sNgSME3KXofKZJ36u4DoPVLjZohRB+NuV NzCnLgWpSORK7/FeNyEVmH0m34ojYuWyeBUVULSTM0dIG3pFPEef3XC2X2ivOYggRFzY Nr7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OeOnvHCc2lg5sRstjwa89XicYu0PFuIOGrd2TLaUNlw=; b=LDt3moRLs0EOQ7ZCNLLrHBcXAjxF60ShNNkUSR+8UMpjOTWqRLml0tr8s7Qv7d6pfU ruWKnIz1suByjMZ1mJWp6YUBpOckI+mbmCazbGYaSbGYa6121qEr3LO+1Akx4oAtj8IE QT3K+oVqfalwQluEWBqkiOVEnAqHV+af8JHOvA7aBIU701m9xGfj+OBoqIfF167n/IG3 B4eCQveo9XYPySYzxuy1+E91X0to5axJjWcVggXWtUBBgavgiv6ypiQnPsCEYLUZo1M1 qooB+IqK2HqFetpkmK/bghLZgLaI/RpuD5457pm3iFW/SMQ0fQY5eM/0qDDnVJwg+9DN seLg== X-Gm-Message-State: AOAM532xewYMCoNSPtjeEri3FjwT5cH1SIEdjd1mFXoLtVJWRj7ar4Li oe/JXddWZgCFDeibJ8ytdMh+WNGVqghvDA== X-Google-Smtp-Source: ABdhPJy75qhii/YZkVWw4CX2YVSlf9mc5ISYtZwapQbYPT6aBjFZULcvCOoPAJbk6BfSoGtBf7Povw== X-Received: by 2002:a5e:d505:: with SMTP id e5mr11685739iom.217.1636343559773; Sun, 07 Nov 2021 19:52:39 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 32/37] bsd-user/arm/signal.c: arm set_sigtramp_args Date: Sun, 7 Nov 2021 20:51:31 -0700 Message-Id: <20211108035136.43687-33-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d32 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d32; envelope-from=imp@bsdimp.com; helo=mail-io1-xd32.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345327203100001 Content-Type: text/plain; charset="utf-8" Implement set_sigtramp_args to setup the arguments to the sigtramp calls. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/signal.c | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 bsd-user/arm/signal.c diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c new file mode 100644 index 0000000000..3c0db30a85 --- /dev/null +++ b/bsd-user/arm/signal.c @@ -0,0 +1,60 @@ +/* + * arm signal functions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "qemu.h" + +/* + * Compare to arm/arm/machdep.c sendsig() + * Assumes that target stack frame memory is locked. + */ +abi_long set_sigtramp_args(CPUARMState *env, int sig, + struct target_sigframe *frame, + abi_ulong frame_addr, + struct target_sigaction *ka) +{ + /* + * Arguments to signal handler: + * r0 =3D signal number + * r1 =3D siginfo pointer + * r2 =3D ucontext pointer + * r5 =3D ucontext pointer + * pc =3D signal handler pointer + * sp =3D sigframe struct pointer + * lr =3D sigtramp at base of user stack + */ + + env->regs[0] =3D sig; + env->regs[1] =3D frame_addr + + offsetof(struct target_sigframe, sf_si); + env->regs[2] =3D frame_addr + + offsetof(struct target_sigframe, sf_uc); + + /* the trampoline uses r5 as the uc address */ + env->regs[5] =3D frame_addr + + offsetof(struct target_sigframe, sf_uc); + env->regs[TARGET_REG_PC] =3D ka->_sa_handler & ~1; + env->regs[TARGET_REG_SP] =3D frame_addr; + env->regs[TARGET_REG_LR] =3D TARGET_PS_STRINGS - TARGET_SZSIGCODE; + /* + * Low bit indicates whether or not we're entering thumb mode. + */ + cpsr_write(env, (ka->_sa_handler & 1) * CPSR_T, CPSR_T, CPSRWriteByIns= tr); + + return 0; +} --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344576414627.8805255744542; Sun, 7 Nov 2021 20:09:36 -0800 (PST) Received: from localhost ([::1]:60284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvyR-0001f9-H4 for importer@patchew.org; Sun, 07 Nov 2021 23:09:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi8-00070c-8I for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:44 -0500 Received: from [2607:f8b0:4864:20::130] (port=35442 helo=mail-il1-x130.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi5-0002y3-U3 for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:43 -0500 Received: by mail-il1-x130.google.com with SMTP id w15so15558584ill.2 for ; Sun, 07 Nov 2021 19:52:41 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U3NE49HODa5ve+oXzRvqylTHNWY8RpTmmQhoDiFbJDo=; b=If5wLTNQHcW/v2Nq6mErBbK1M18ydWGBtAMfaJ2cO5j9RifgdDyGyowYVI0T+WEeph ZB5JbyLLAwQHa+HFFPaG+08Zfh/epC62mpyNdUC3bKzBySwYjPcmWQCM3AdLJS3bBsI7 fgJQnetiM6OwoxAQgc7ZJ1H6zOvC+QRITjSjkaX4bMS6zGK8ogeb6VAMXSFtLo0f8I2K Yg7Eq7DOY/+8S+q87mbQGG9PBdBq2PRBFwyG2Bv4OImj0LZ6hIF0p3f6rvioGK+NHdJO qbJWdoQX88APRkkF9ifzyzXziVjdJJFQcDNsJgJYNp65PqeG/FG71eFvYPUPFVkY7Fs9 Znkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U3NE49HODa5ve+oXzRvqylTHNWY8RpTmmQhoDiFbJDo=; b=jiI1JlXGLbNaxUI/CDZYBWvDDfxW1DTsj0BNDrQm7nUUW+TZK8IZXcBxhNuCjF2J7z wGvgwBrx9JgXjBgQoxx5Bmv6gm4YZdlevrhPSvJWcNk25qEk8ZfPJ7OdIaWZKfWCcti/ Y4ytAMEhJ0O2lVF/e4S1eqxCFvdBTcKb8kUAgDYUtqKIarVm83Kyq9z4M98zb2WR0PBS s44J6AB40WdJdptrLiu+Q0RQUEGymRncmujn0VxTCitCiAAVMDN9atH3ajSro3VptZab 9QDTtndiDgdKoKKduYDOI8bQo4/f4snpabGNP0VbkMs8ocPhVydQlxYKzLcsczlYfaXn Lnfw== X-Gm-Message-State: AOAM533s8Tj+30nuTS1Mq9IM5ZDvxozYBVyYraOmxDrBrLZC093ZJFud qcH3jdTZTtiIssiYqhJotivlfZOGJjXT4A== X-Google-Smtp-Source: ABdhPJzL6kakMTUq2pFbMI+pQ/96aPiPp8+OeYvOu2p7+sO906c7qAEbS2uYqtw9x1MbHw34Cl5rmg== X-Received: by 2002:a92:c8c6:: with SMTP id c6mr42754088ilq.54.1636343560668; Sun, 07 Nov 2021 19:52:40 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 33/37] bsd-user/arm/signal.c: arm get_mcontext Date: Sun, 7 Nov 2021 20:51:32 -0700 Message-Id: <20211108035136.43687-34-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::130 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::130; envelope-from=imp@bsdimp.com; helo=mail-il1-x130.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344576970100001 Content-Type: text/plain; charset="utf-8" Get the machine context from the CPU state. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/signal.c | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c index 3c0db30a85..93c9bfc0d3 100644 --- a/bsd-user/arm/signal.c +++ b/bsd-user/arm/signal.c @@ -58,3 +58,54 @@ abi_long set_sigtramp_args(CPUARMState *env, int sig, =20 return 0; } + +/* + * Compare to arm/arm/machdep.c get_mcontext() + * Assumes that the memory is locked if mcp points to user memory. + */ +abi_long get_mcontext(CPUARMState *env, target_mcontext_t *mcp, int flags) +{ + int err =3D 0; + uint32_t *gr =3D mcp->__gregs; + + if (mcp->mc_vfp_size !=3D 0 && mcp->mc_vfp_size !=3D sizeof(target_mco= ntext_vfp_t)) { + return -TARGET_EINVAL; + } + + gr[TARGET_REG_CPSR] =3D tswap32(cpsr_read(env)); + if (flags & TARGET_MC_GET_CLEAR_RET) { + gr[TARGET_REG_R0] =3D 0; + gr[TARGET_REG_CPSR] &=3D ~CPSR_C; + } else { + gr[TARGET_REG_R0] =3D tswap32(env->regs[0]); + } + + gr[TARGET_REG_R1] =3D tswap32(env->regs[1]); + gr[TARGET_REG_R2] =3D tswap32(env->regs[2]); + gr[TARGET_REG_R3] =3D tswap32(env->regs[3]); + gr[TARGET_REG_R4] =3D tswap32(env->regs[4]); + gr[TARGET_REG_R5] =3D tswap32(env->regs[5]); + gr[TARGET_REG_R6] =3D tswap32(env->regs[6]); + gr[TARGET_REG_R7] =3D tswap32(env->regs[7]); + gr[TARGET_REG_R8] =3D tswap32(env->regs[8]); + gr[TARGET_REG_R9] =3D tswap32(env->regs[9]); + gr[TARGET_REG_R10] =3D tswap32(env->regs[10]); + gr[TARGET_REG_R11] =3D tswap32(env->regs[11]); + gr[TARGET_REG_R12] =3D tswap32(env->regs[12]); + + gr[TARGET_REG_SP] =3D tswap32(env->regs[13]); + gr[TARGET_REG_LR] =3D tswap32(env->regs[14]); + gr[TARGET_REG_PC] =3D tswap32(env->regs[15]); + + if (mcp->mc_vfp_size !=3D 0 && mcp->mc_vfp_ptr !=3D 0) { + /* see get_vfpcontext in sys/arm/arm/exec_machdep.c */ + target_mcontext_vfp_t *vfp; + vfp =3D lock_user(VERIFY_WRITE, mcp->mc_vfp_ptr, sizeof(*vfp), 0); + for (int i =3D 0; i < 32; i++) { + vfp->mcv_reg[i] =3D tswap64(*aa32_vfp_dreg(env, i)); + } + vfp->mcv_fpscr =3D tswap32(vfp_get_fpscr(env)); + unlock_user(vfp, mcp->mc_vfp_ptr, sizeof(*vfp)); + } + return err; +} --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345421858889.5309940493327; Sun, 7 Nov 2021 20:23:41 -0800 (PST) Received: from localhost ([::1]:37828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjwC4-0007ol-JX for importer@patchew.org; Sun, 07 Nov 2021 23:23:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi9-00074m-8w for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: from [2607:f8b0:4864:20::d32] (port=34568 helo=mail-io1-xd32.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi6-0002ya-PT for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: by mail-io1-xd32.google.com with SMTP id w22so2907234ioa.1 for ; Sun, 07 Nov 2021 19:52:42 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GncYDfjxwlhtNC69qwkoQdNduf0of/aApvZ39YXAJoM=; b=MZjh9XbOL3nSD5GrxFCTTHblUVD7kYo+b0aqw6vqmdMG+KNb+gpniGELksu5JUwe6q 3TywRb2JIPcQ72jRUJCtG4yIKjHCZ05Mu7bnjj5rGmvvuNwzaCwK1S+6I/0wwqT75qUB nvYDg3idd9+tpsRwpZaRhPNYyibmOYNXaFTtgoBB75YmZxKWr7Z8wExWVdn3vdcoogLA +lPDN8bH5/dbmSzQUHqMfl6QIelz1frOqlNfrSkmqBHAzsX5oHYF0l13TFk67LDbosq7 dbj02bx1WSC9zF7hrhGwqKg2i3MTcD1AT0OsaqzTc4xHmJkOQt7+TrQHzAsMPZ6n6y2E GvCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GncYDfjxwlhtNC69qwkoQdNduf0of/aApvZ39YXAJoM=; b=XpzkeEhWUCeLXyR7s595RG9w1XK91MFF6YIC7qwKn+pwLOHfF3Q0bzIM0sj+BXYYh2 32n8QsqQSNDY5vlw6/utugG4p147H5HlhPO00jl5IPheZolI0R1sahPGyEyyqUiDPuoU zw9ADygg7xhm4z8kEkjRljza6C7pISlYn5pCF7/TClOwV1KtK3y8LTgoKen+mbxHAJs1 sN5CvzV7a9UFvsQTkoPvqcyCHEL46lRRxl/EW78yU+yPbgpwaZwC7iLZcfVeP6ZEiDfx /5h+3m1nLZvtz5vVNQCYfh/AU0ZyXR0KtVb87Y9++fzhScsvIrJfIEfTYfw9AGR3Sakv 8IBA== X-Gm-Message-State: AOAM533UnxgkynFjEjZo9WRk6O6gaqn4okG85DfxYbGt6hfDtQWWYvrI 8QN+9TaDjxvOa9ATwYHNhicF14ceqUYPsw== X-Google-Smtp-Source: ABdhPJw5dRmeBg31Ywv/z67GW9FozmVAXGBZWBL3mHCn1zW5GCseV+PxQmUVPDJydOHFQef25eCzlA== X-Received: by 2002:a5d:8c83:: with SMTP id g3mr11200078ion.24.1636343561515; Sun, 07 Nov 2021 19:52:41 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 34/37] bsd-user/arm/signal.c: arm set_mcontext Date: Sun, 7 Nov 2021 20:51:33 -0700 Message-Id: <20211108035136.43687-35-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d32 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d32; envelope-from=imp@bsdimp.com; helo=mail-io1-xd32.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345422987100001 Content-Type: text/plain; charset="utf-8" Move the machine context to the CPU state. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/signal.c | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c index 93c9bfc0d3..fb6228db6c 100644 --- a/bsd-user/arm/signal.c +++ b/bsd-user/arm/signal.c @@ -109,3 +109,79 @@ abi_long get_mcontext(CPUARMState *env, target_mcontex= t_t *mcp, int flags) } return err; } + +/* Compare to arm/arm/exec_machdep.c set_mcontext() */ +abi_long set_mcontext(CPUARMState *env, target_mcontext_t *mcp, int srflag) +{ + int err =3D 0; + const uint32_t *gr =3D mcp->__gregs; + uint32_t cpsr, ccpsr =3D cpsr_read(env); + uint32_t fpscr, mask; + + cpsr =3D tswap32(gr[TARGET_REG_CPSR]); + /* + * Only allow certain bits to change, reject attempted changes to non-= user + * bits. In addition, make sure we're headed for user mode and none of= the + * interrupt bits are set. + */ + if ((ccpsr & ~CPSR_USER) !=3D (cpsr & ~CPSR_USER)) { + return -TARGET_EINVAL; + } + if ((cpsr & CPSR_M) !=3D ARM_CPU_MODE_USR || + (cpsr & (CPSR_I | CPSR_F)) !=3D 0) { + return -TARGET_EINVAL; + } + + /* + * The movs pc,lr instruction that implements the return to userland m= asks + * these bits out. + */ + mask =3D cpsr & CPSR_T ? 0x1 : 0x3; + + /* + * Make sure that we either have no vfp, or it's the correct size. + * FreeBSD just ignores it, though, so maybe we'll need to adjust + * things below instead. + */ + if (mcp->mc_vfp_size !=3D 0 && mcp->mc_vfp_size !=3D sizeof(target_mco= ntext_vfp_t)) { + return -TARGET_EINVAL; + } + + env->regs[0] =3D tswap32(gr[TARGET_REG_R0]); + env->regs[1] =3D tswap32(gr[TARGET_REG_R1]); + env->regs[2] =3D tswap32(gr[TARGET_REG_R2]); + env->regs[3] =3D tswap32(gr[TARGET_REG_R3]); + env->regs[4] =3D tswap32(gr[TARGET_REG_R4]); + env->regs[5] =3D tswap32(gr[TARGET_REG_R5]); + env->regs[6] =3D tswap32(gr[TARGET_REG_R6]); + env->regs[7] =3D tswap32(gr[TARGET_REG_R7]); + env->regs[8] =3D tswap32(gr[TARGET_REG_R8]); + env->regs[9] =3D tswap32(gr[TARGET_REG_R9]); + env->regs[10] =3D tswap32(gr[TARGET_REG_R10]); + env->regs[11] =3D tswap32(gr[TARGET_REG_R11]); + env->regs[12] =3D tswap32(gr[TARGET_REG_R12]); + + env->regs[13] =3D tswap32(gr[TARGET_REG_SP]); + env->regs[14] =3D tswap32(gr[TARGET_REG_LR]); + env->regs[15] =3D tswap32(gr[TARGET_REG_PC] & ~mask); + if (mcp->mc_vfp_size !=3D 0 && mcp->mc_vfp_ptr !=3D 0) { + /* see set_vfpcontext in sys/arm/arm/exec_machdep.c */ + target_mcontext_vfp_t *vfp; + + vfp =3D lock_user(VERIFY_READ, mcp->mc_vfp_ptr, sizeof(*vfp), 1); + for (int i =3D 0; i < 32; i++) { + __get_user(*aa32_vfp_dreg(env, i), &vfp->mcv_reg[i]); + } + __get_user(fpscr, &vfp->mcv_fpscr); + vfp_set_fpscr(env, fpscr); + unlock_user(vfp, mcp->mc_vfp_ptr, sizeof(target_ucontext_t)); + + /* + * linux-user sets fpexc, fpinst and fpinst2, but these aren't in + * FreeBSD's mcontext, what to do? + */ + } + cpsr_write(env, cpsr, CPSR_USER | CPSR_EXEC, CPSRWriteByInstr); + + return err; +} --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636345493582146.07324368904847; Sun, 7 Nov 2021 20:24:53 -0800 (PST) Received: from localhost ([::1]:39948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjwDE-0000qM-IP for importer@patchew.org; Sun, 07 Nov 2021 23:24:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi9-00075j-ER for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: from [2607:f8b0:4864:20::d36] (port=38731 helo=mail-io1-xd36.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi7-0002yx-NG for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: by mail-io1-xd36.google.com with SMTP id v65so17432603ioe.5 for ; Sun, 07 Nov 2021 19:52:43 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iFpyi0tgMhKl7tXQoCZMXjFfUN+vnx/DUS2tS/nbmKU=; b=J7pmSwvkjH4XEANYsKD/29RXyn38qCq1l6p+vlTJeevZTKnbflldJuXXoj3b86b8Lo dsN+HhtFYCskGsWtghjZkdydI2x4c5ttckJaIXCItXRPAUVwKrC8rdUySE3LWoSnVi7w 4j0zDFzlsXJs8F5TS7+MKn+ujhP6li/sk8qtq0gwubnLrgGRnbhXXi2QL3v2NyQhN2mZ 7V17oCH3nkcy8foc4HCBgSQx2Ou78lB+Wzl6LGx7leu24AKnur5Fdtd3vycINEuHH6ZQ RQe0bl3Rd6fnDYk1C+CmIm5oGfL38tQwF4JqvVaf5r1PAjcWWeC7CjRQ+iyW5xjvLxF0 zNLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iFpyi0tgMhKl7tXQoCZMXjFfUN+vnx/DUS2tS/nbmKU=; b=QumiqZNXXf+wq99neRTaQ832hIvkRH8Ql96Qn9QFpPFIZuAPHch7NW7kGEUxMRbDAR xInXOVSUb14FFY3E8sj93/mfF368A8ZJy8TEs4akoSHWMvD8uLw44arMTadvAUv8Ckkf LOQOo/shZCGxQdXBYTdLLpLOoUBJE6SidR3pMf8y4BeCPq0EjLV80eUVOXzchJpfO3AA hAs1nq6kzoVawt0+K1hLN9/WXQ2ZLtsjLSe/kF4eOo5PaAMHztc/UQM745nOE8Ulbv2Z btUzY+TtrHuSpt4qL2nWISEG+Aw8AhNCOGkssf3M4LMe75KRso7UyUPA76elW8sxJCYp 8XLA== X-Gm-Message-State: AOAM5310DWPiQMox7OQdF6UAU6WZuijuuIlCUx0sIDFHO7ba1aobdCEC IpGEdhPKLCOOoerB00vGzm9zwakXXFESug== X-Google-Smtp-Source: ABdhPJwgO0HdVONrpceShzk/UUN95c/egUmUPnaAM7wXFncsMW5tzZwDoHfmG+rvoCmkpJL8k1Te6w== X-Received: by 2002:a05:6602:15d3:: with SMTP id f19mr11543128iow.211.1636343562551; Sun, 07 Nov 2021 19:52:42 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 35/37] bsd-user/arm/signal.c: arm get_ucontext_sigreturn Date: Sun, 7 Nov 2021 20:51:34 -0700 Message-Id: <20211108035136.43687-36-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d36 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636345495534100001 Content-Type: text/plain; charset="utf-8" Update ucontext to implement sigreturn. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/signal.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c index fb6228db6c..1478f008d1 100644 --- a/bsd-user/arm/signal.c +++ b/bsd-user/arm/signal.c @@ -185,3 +185,12 @@ abi_long set_mcontext(CPUARMState *env, target_mcontex= t_t *mcp, int srflag) =20 return err; } + +/* Compare to arm/arm/machdep.c sys_sigreturn() */ +abi_long get_ucontext_sigreturn(CPUARMState *env, abi_ulong target_sf, + abi_ulong *target_uc) +{ + *target_uc =3D target_sf; + + return 0; +} --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344721322842.3416991072118; Sun, 7 Nov 2021 20:12:01 -0800 (PST) Received: from localhost ([::1]:38866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjw0m-0006IO-Aq for importer@patchew.org; Sun, 07 Nov 2021 23:12:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjvi9-00077l-Td for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: from [2607:f8b0:4864:20::d29] (port=39485 helo=mail-io1-xd29.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi8-0002zK-Go for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:45 -0500 Received: by mail-io1-xd29.google.com with SMTP id c3so3969170iob.6 for ; Sun, 07 Nov 2021 19:52:44 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zU+m2dj4H6cVY5IXZl2McfoeKw+azePnbjkTpHB+KrU=; b=8N+E5L7KYKyhQ3CKu8U/oBBMPGBoz9yprQUf5HlujxyE7ErYlPrhOkjgBi+EW94UE0 sFAK7kJSTyBgpRZLcMRJPZusoFUgmgev0WMk+8+Jb/hLGdPg7jiYKrIRQBMOd7IwBxeX JYGHu8JMubOwL/wgR1SHbT/htAojTEQVYL/b7AVJ5azf4bqahTr+zbM2XBIo1TQH5PPu G3ghIgNw8oPaJ35NOakb0jp114GMIctXyTaHiMJP5iFkHfrH/o/nbac4et7HO3V3EPTw 1PmBjEZ2okNejwK4jJCC97cbfXBMAM28YPkmSx/JL2LuXrmsDaGqPTdh1LqggUE1wuzF CaeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zU+m2dj4H6cVY5IXZl2McfoeKw+azePnbjkTpHB+KrU=; b=UfDxC95FbYSgthAUa1/NydkXLVeJ+RY1os2KUgXLZ1sWtLVCpslEBby/izE+LiN7vj mZpj9MEpcHYRKbgVT2TlHr1helrAPGSnuKxY1XVmdru1xhgxpK8t7jgUzEyUCDedbVG/ attHljIwcYsd+9JGXxJjCE2fkZlclDHbJpwYTbmudlkPzP6Rujg2OyHqnls6H2+cIh5p 5xwkcnclOvEANAPIt36sEM2Ffr7V/F455vvKsRifyiVirSQJNN4APzCt3B19KwCkEA6b HP1i+ici54LFKbPpCZiLFoDKqF45XJ8WH+Ef4fyHEiBTkyJg8hWwwqGMqE1o2JvtMicE iWQA== X-Gm-Message-State: AOAM531EXnXHko2a8P6ZJzGaLPirCHzDVGVGiN6TSsmLDGANMufdgSGk J+RGnBvgcsA8NJ9XhPK5DWnTVTCyFf0ojw== X-Google-Smtp-Source: ABdhPJxsUKg1cIF96ekePZGSkqEC2hlatOETv4EkwHEZCLsLvsx6heKNqV2gPWu9QjegFPYwdiiO2Q== X-Received: by 2002:a05:6638:a2d:: with SMTP id 13mr21401774jao.12.1636343563364; Sun, 07 Nov 2021 19:52:43 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 36/37] bsd-user/freebsd/target_os_ucontext.h: Require TARGET_*CONTEXT_SIZE Date: Sun, 7 Nov 2021 20:51:35 -0700 Message-Id: <20211108035136.43687-37-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d29 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d29; envelope-from=imp@bsdimp.com; helo=mail-io1-xd29.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344723246100001 Content-Type: text/plain; charset="utf-8" Now that all architecutres define TARGET_[MU]CONTEXT_SIZE, enforce requiring them and always check the sizeof target_{u,m}context_t sizes. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_ucontext.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsd-user/freebsd/target_os_ucontext.h b/bsd-user/freebsd/targe= t_os_ucontext.h index dd61aec7cc..41b28b2c15 100644 --- a/bsd-user/freebsd/target_os_ucontext.h +++ b/bsd-user/freebsd/target_os_ucontext.h @@ -27,10 +27,8 @@ typedef struct target_ucontext { int32_t __spare__[4]; } target_ucontext_t; =20 -#ifdef TARGET_MCONTEXT_SIZE G_STATIC_ASSERT(TARGET_MCONTEXT_SIZE =3D=3D sizeof(target_mcontext_t)); G_STATIC_ASSERT(TARGET_UCONTEXT_SIZE =3D=3D sizeof(target_ucontext_t)); -#endif /* TARGET_MCONTEXT_SIZE */ =20 struct target_sigframe; =20 --=20 2.33.0 From nobody Tue May 21 22:59:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636344303929907.6086280488632; Sun, 7 Nov 2021 20:05:03 -0800 (PST) Received: from localhost ([::1]:45606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjvu2-0008Pe-RQ for importer@patchew.org; Sun, 07 Nov 2021 23:05:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjviB-0007CA-2c for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:47 -0500 Received: from [2607:f8b0:4864:20::d36] (port=34572 helo=mail-io1-xd36.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjvi9-0002zo-FX for qemu-devel@nongnu.org; Sun, 07 Nov 2021 22:52:46 -0500 Received: by mail-io1-xd36.google.com with SMTP id w22so2907273ioa.1 for ; Sun, 07 Nov 2021 19:52:45 -0800 (PST) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id x15sm876909iob.8.2021.11.07.19.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 19:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VTdt3uC+ttB19F3HtSXrERhSxFv3zvRil3LE5812gSQ=; b=CekGNyIce6XdthziiJgk/NHpe3zTL+GqsQetJo3+U0Za57P3l7w0yRXyqgbmbtFnwD tgXNS7M1NHTlcweoCp+mhdhkWek3ziv3IfQkIRfpwLI1WYVhEhY6F9arMuSetWfgFLhk W75W0npC573EGzJZT/p+198J3VNnuOqF+M5Eaqo76jfKxsFfw6bYNJGW2EtqI+G/nmdB 0xderTdRcsOswGdtlcpLm/FyhJsR+cXEYzSXmmynpusg0agJxfWASCcnqudbV9KMCAWI GsUzhSWbPGdE2NV5pPWUpI1sZIxTHNZrsH/kPoHQfzcHlYX5+0/QnTq4ssbvxr8LCE+t xSww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VTdt3uC+ttB19F3HtSXrERhSxFv3zvRil3LE5812gSQ=; b=pcSEdED2RAR8kIRyOI0zN4EY5JYP8tGc2Z8TTDyst78VMaFQ6WksxfkP91D0pKnMkI 9xBsv9CQ5KAqPbga+E0mjIGtS7uH493T821uE5kKdO5DJOZVjDikk79l2JXGVaz9tCdx WKBfdVvCXYU0UJ7mU2WyCZNZkL49n9BKLrDNQmMF0iWja3aAC1ZLArbB/ym3lWo3St0p yBYMj94jMP6ih79YC7J47ei082X/mhMibrevxsc/TSG9OXjk3FOISsxnjR+sxB3XfiyJ tzdMjjBMwAMkn1IgA6ZHvUNPsXhXJBOKVdRKHfBG0s6qF1NUEa58Yn7MaroDFxWfh2ws e6/A== X-Gm-Message-State: AOAM530v7ywJBG9LUlmOkhP/twp3tgg1v0aKD+ACeUjrSFUf6BDexGBl kVcHh1i6f77svN39kIatTFdiAOx88V/mOQ== X-Google-Smtp-Source: ABdhPJy6p764ECR0WIUF261YXMRgOfChCfxGVar0vHRFEe9bkKoa6IcJjrMgRBmp7uSyZFed2gSGBQ== X-Received: by 2002:a6b:7306:: with SMTP id e6mr3914401ioh.25.1636343564293; Sun, 07 Nov 2021 19:52:44 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v5 37/37] bsd-user: add arm target build Date: Sun, 7 Nov 2021 20:51:36 -0700 Message-Id: <20211108035136.43687-38-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108035136.43687-1-imp@bsdimp.com> References: <20211108035136.43687-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::d36 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Paolo Bonzini , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636344306036100001 Content-Type: text/plain; charset="utf-8" CC: Paolo Bonzini Signed-off-by: Warner Losh Acked-by: Kyle Evans Reviewed-by: Richard Henderson --- configs/targets/arm-bsd-user.mak | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 configs/targets/arm-bsd-user.mak diff --git a/configs/targets/arm-bsd-user.mak b/configs/targets/arm-bsd-use= r.mak new file mode 100644 index 0000000000..cb143e6426 --- /dev/null +++ b/configs/targets/arm-bsd-user.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=3Darm +TARGET_XML_FILES=3D gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-v= fp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-prof= ile.xml gdb-xml/arm-m-profile-mve.xml --=20 2.33.0