From nobody Sun May 5 09:24:31 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 1641628945866410.06091541828766; Sat, 8 Jan 2022 00:02:25 -0800 (PST) Received: from localhost ([::1]:37164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66gC-0007S6-Pl for importer@patchew.org; Sat, 08 Jan 2022 03:02:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66IQ-0005Hs-Vo for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:56 -0500 Received: from [2607:f8b0:4864:20::d31] (port=42727 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 1n66IL-0003Js-FX for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:48 -0500 Received: by mail-io1-xd31.google.com with SMTP id o7so10063314ioo.9 for ; Fri, 07 Jan 2022 23:37: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 w19sm613022iov.12.2022.01.07.23.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37: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=zybZPjB8nKU1WribOLJ/TrFoY2QK+pom/GELtkI+EXk=; b=MIKQBWRAOLTcjTYsIGUsn6z0jZpSiei9pliaseQhXcYhQHcfJT5C2LbHbGQYwnbgVL 58LfzwT+UTLshI9JDiJUDFdIr/wbYqOZ3rsxF0ZAVCXXCGWT7dTUuT0CAJxLtqGDhyge SoUKWA7a3autQPq0TRWXsb9BvUTeoX55nBYAi8R01o5vtE3l80lPs1Yq1dq5tH0bjiQB odOzXPjfm1IO5ZnCJXlxnrJ3sggH/zYqBwOQX4yyK4RL132iuLAVRg60qq28Ifp6kUEJ C3X0CHIyNTwZBrSyScy1OWnDsE++wyjdWm8cLXIparjs57dBQmbPzcf1r5i7k5upOYay SKRw== 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=zybZPjB8nKU1WribOLJ/TrFoY2QK+pom/GELtkI+EXk=; b=Iq6DOvicAG1vIW+I55pRObr0ryXZFLQY8vC3YWsFsZ+DtixVkGGZlFnMUnwtlwQvQ3 Jz2YY3QWATQJ+je1ngsJRfsjPCf1GsmadntmuMwSrbRAqW4bRofjDUWauOjNwBVzxYpd N/E2zZ9d235XGZT5egcY7T35gncr2Jv7u3iJM2NAsYDpydBYeVpBWAKaeE1B14dvcyUf xlAMTnrZaKZWipOvo9Yt73VfqABhylMfBTCaHDmDaoJeJAtYipIIJCtIdCK6IA6Ysj8D EcudPsN0OMqT6S6EnLQLGz6WLoxa4Y6pDCtPNcyKHrWyKqzXq5rSZbXSdGuKw/Rql+u8 XdXg== X-Gm-Message-State: AOAM533zn/AnEXNfGAGTOUaQRTjjXf3K72+x4Tye40EpSkACtRYkaAEr 0+50NDId+9VuogEsy243fSBQrR0/SLCsfRJR X-Google-Smtp-Source: ABdhPJwAuZ+H+KGwkPwod1D1275UtD34caBoTTLl0SD02m5azU0xSZl9ppSgthKRGeb8rkVwfMniRw== X-Received: by 2002:a05:6602:13c4:: with SMTP id o4mr32584418iov.152.1641627463714; Fri, 07 Jan 2022 23:37:43 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 01/37] bsd-user/mips*: Remove mips support Date: Sat, 8 Jan 2022 00:37:01 -0700 Message-Id: <20220108073737.5959-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641628947591100001 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 --- 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 6da803a408e..00000000000 --- 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 aacc6ddf9fc..00000000000 --- 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 e6f9c00d5f6..00000000000 --- 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 bf4c598b136..00000000000 --- 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.1 From nobody Sun May 5 09:24:31 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 1641630202233969.2434485965615; Sat, 8 Jan 2022 00:23:22 -0800 (PST) Received: from localhost ([::1]:44686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n670S-0007rz-S3 for importer@patchew.org; Sat, 08 Jan 2022 03:23:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005Jd-O2 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:03 -0500 Received: from [2607:f8b0:4864:20::d2e] (port=45054 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 1n66IV-0003K1-7n for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:58 -0500 Received: by mail-io1-xd2e.google.com with SMTP id h23so10031156iol.11 for ; Fri, 07 Jan 2022 23:37: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 w19sm613022iov.12.2022.01.07.23.37.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:44 -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=BqNi6fntG0ZGKoQuBAAKzElQ2KHXFVMfekNgaGGkf34=; b=tN1ZW4XnAaZDOcABUjHaiDx07fmQUjmIe65E9izTV6U1X+JAipFYpWBJefU//swq9N kf1DoOBMfCoGEGvrwsu1Yq5DFrvVjbw9jK0/nhq/awbi/JXkwN0GIBwBE0Vtx9mr5Bn1 m97tWmD34I4PPxSa2pHFfcZL1A56cp5sglvijkELRC1OydGbaJsNDKcRmsvxh9Zj8DXC 55i5ay5G/i3xwC3X4Dg77XXJ1XCRCDIECPXBQMr2uqG4s4CvRVpNoXI/uWpxZMNycz4Q apFuAeHPv+MqN6aMwT4k2zz8yktlzx52LjpwVJ+fig12Ri9bjYPPwbjtEtNl3pJ8xkeT lrfQ== 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=BqNi6fntG0ZGKoQuBAAKzElQ2KHXFVMfekNgaGGkf34=; b=LR9Oxnz7Ec88owrLCQQD05g6Bu7ZlNi26OyXqKn9AYoO7drg03XmAcH99ypBVf5ArI k5/NfZfiys97G3RoBFB3QF32CkgoJI2MjgIgPbB6rSoB5M2LPVO0OtrnoTkngzY7+uSR CFHLP9szXjHUF2ssE+jeqskwCzC4dOTZsy1lWeR+94NGHmxjExi76HlPCXhWI9ob/DqG uVdbZUAFUd1DaLpjz02BXwrqblgpUK/yk/pLe6F0ErhMhfyuwFAjC5nPAGUCoUx/9KZG 0oMBITqtIgCMaMc1fPbzJKv6h0UKlM8kAxDdiqilxvb1Rf0a/3o6HXMvLpFAGAHn5YzJ amjQ== X-Gm-Message-State: AOAM5304EZCqNlYcjzBMfnah6p6ccm1+hNhwclHjuFBfalkO6j00w4fN vPStrCPvQChM4JxKDHHlEtF0NPs1FLgJGvJ+ X-Google-Smtp-Source: ABdhPJx+JdOOYLuFjxQRO6bvzhnjjuvG4haECxQXuRZeS1RL0RjLjd8POBTNiR/FGpbHZsepCDdIig== X-Received: by 2002:a5d:8a0a:: with SMTP id w10mr31730136iod.90.1641627464641; Fri, 07 Jan 2022 23:37:44 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 02/37] bsd-user/freebsd: Create common target_os_ucontext.h file Date: Sat, 8 Jan 2022 00:37:02 -0700 Message-Id: <20220108073737.5959-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630204180100001 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 1a4c5faf19e..3ed454e086d 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 00000000000..1d0c3c4e651 --- /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.1 From nobody Sun May 5 09:24:31 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 1641627802792483.0455933587874; Fri, 7 Jan 2022 23:43:22 -0800 (PST) Received: from localhost ([::1]:34680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66Nl-0001WR-Li for importer@patchew.org; Sat, 08 Jan 2022 02:43:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66IV-0005I4-G5 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:58 -0500 Received: from [2607:f8b0:4864:20::d34] (port=42730 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 1n66IQ-0003K9-Pi for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:55 -0500 Received: by mail-io1-xd34.google.com with SMTP id o7so10063380ioo.9 for ; Fri, 07 Jan 2022 23:37:46 -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 w19sm613022iov.12.2022.01.07.23.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:45 -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=qQyeT4ATSzu88iMyeOafl0yabm+zECQCG8Im0X8yUyY=; b=Tufuf/IzDp1UdsKysWDSBm0sbV2wDEJnQN3MGH9DcStLMk+QWbOVvgQUF7rLaUhKUz cEQjn/h3VJS9sbNnZhyHBs97FSD6c0NtLS4RFDRgb5bNsEis1BdP+3L2qM2orR+1Gk4l uugSnewYR8TU/yt1M3qGD9betFGgz7vyOiozSnST0Nb9YXwAhdoqxo4Cz4FIw5L/nEAv L92nQ9d2RPBMs+DZRguTUQoNC06wPx5Net5xSnepUxPfuaNCKKKczC/zJ90hO5nHL2Td V4TszAKczGz6HbW6worGXbku3Nfv2SZGk4UlyZRR6lQFJyJszMTVF33NipSZy7sQkBTu zkOA== 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=qQyeT4ATSzu88iMyeOafl0yabm+zECQCG8Im0X8yUyY=; b=Jge4eTnWX3CJPoM8SSJszRe2iS5R5Bxx1Mi97+OgbyufI72OuGgYmyD0kyq1l39FWr OIEZO0hgKIjXlHI89K9jbllKsNpLi9aXcgXsDZYhhQ+QGZQcOxWNJe0RhnNz0Jpttrao adfQLlY7Hl84XdAfnNjG32jB+JcpXyryjjXQAPqgp77r7qGlQZFXsfAh1FziUCsdgZN1 aYX0grEuMd811S6p9hWPaZWQiWk3LUOti7UleNfHENwhluNLJgidOu4DnGNgh3GZ/wX4 YPIba7OTug6eDXWY/SbIz6kxJOzLgZhmiCcaiJVI1q0z3PbAy/OML1RRmCdisRxzLdPt 7B9A== X-Gm-Message-State: AOAM531xboYZiChFf5GsqcP6R9B2rHvwP5vGfgKU0fiZw+xahpe6jpGm ei62u5R868klbjQeO/bDFsTE3+KnWR4MJW4b X-Google-Smtp-Source: ABdhPJy7dFz0gO3vzF+46RW9RsSwGGfCpwcTtP9Ea4zBPYqD/yZIlshCsVXuWvgEYRLbx4sC+kXJcA== X-Received: by 2002:a05:6602:13d3:: with SMTP id o19mr31004447iov.4.1641627465720; Fri, 07 Jan 2022 23:37:45 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 03/37] bsd-user: create a per-arch signal.c file Date: Sat, 8 Jan 2022 00:37:03 -0700 Message-Id: <20220108073737.5959-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641627807959100001 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 00000000000..ac903233653 --- /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 00000000000..ac903233653 --- /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 53065e96ecf..c1b1db1e28c 100644 --- a/meson.build +++ b/meson.build @@ -2933,7 +2933,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.1 From nobody Sun May 5 09:24:31 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 1641629997590763.6117811296446; Sat, 8 Jan 2022 00:19:57 -0800 (PST) Received: from localhost ([::1]:35828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66xA-0001Ge-I8 for importer@patchew.org; Sat, 08 Jan 2022 03:19:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66IU-0005I3-9z for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:57 -0500 Received: from [2607:f8b0:4864:20::d33] (port=46624 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 1n66IO-0003KM-Ip for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:50 -0500 Received: by mail-io1-xd33.google.com with SMTP id x6so10010656iol.13 for ; Fri, 07 Jan 2022 23:37:47 -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 w19sm613022iov.12.2022.01.07.23.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:46 -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=SHR8E0XalFYH6WBW0i6lmI4bojXX/JfzdunUrlaEzCM=; b=zs6YvjhsYRmac1pPQEeIlTkGIBi6Ln/gKKeCMKE+fJenUQRc55n4hxwTON8AhIeg+e 4szRuCKKMJY7MakX3+u7kWYxjbi7lBu/JFUfnvj4Ir52PsBySm+fY7Hchd4VYcChlv8C 0HwzPbTFKbNAKMJEZOGlSIKFII06FpJvoONIWth+NImBf4wn5txxewaZrDKvWRpzFab4 JvHv8wJfVRttyoOScReaeh8oygQ/Phv6bXrmr4P3q2D6SEIcktLy03nUOyzbgcc4m1o/ +bWGEifnGsRwvMB8S9k7CfDQcYxuJG7Eeg021xdKxuVqbcCWaBRENW0tJYDB0nSlKKa0 lwXQ== 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=SHR8E0XalFYH6WBW0i6lmI4bojXX/JfzdunUrlaEzCM=; b=K8etbayzDqe31f/59zVaydOb3cCM7h2GdUxHfWJCdy9l3Rmcj/PFcX5QGs1nCcEY9h XaPvmYbtd37DvT1xnGxH86dG+Vp0QFgsTWUqL/D8M77ONPJbidxv2Gc/QvmEBI1ucacg b4g+WcXkO2eqSehiwaqN+D6WyjgkGgu2D6tzXNgJ+0TFkAw8zIvdB/llHM8sdiXx19xw 8UcDRstmKGnJ8ss8zRH9WJoKPclbSgOUJJ4Dnau+EFuIufUmSsrepMfa5KS/N76wFW/T T0dZbCMT+cBw03260jUjcytv29OLHqotnQ6MvAAb0Hb0GR+LFlBh6Frwe6WSOs4aYRT+ 3m6A== X-Gm-Message-State: AOAM531yIPXtMtF9Z73J5Bs3ACWqB9HysLPxRPRzfAUyZ2i3nMCR6/SV F/CR784UBV+SfLNdGxbqvF1AleziPQHNe7Mx X-Google-Smtp-Source: ABdhPJz3VdQbiO+mlpA20EkP/JGgrvwcbD1CLP0+8cHwhiacQ/LxLEoEX21+Xk0vfRBwfntrirf55A== X-Received: by 2002:a5d:8244:: with SMTP id n4mr31879224ioo.27.1641627466710; Fri, 07 Jan 2022 23:37:46 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 04/37] bsd-user/i386/target_arch_signal.h: Remove target_sigcontext Date: Sat, 8 Jan 2022 00:37:04 -0700 Message-Id: <20220108073737.5959-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629998564100001 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 a90750d602c..e262667bdab 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.1 From nobody Sun May 5 09:24:31 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 1641629554654287.05613717575136; Sat, 8 Jan 2022 00:12:34 -0800 (PST) Received: from localhost ([::1]:54266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66q1-0002an-N4 for importer@patchew.org; Sat, 08 Jan 2022 03:12:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66IU-0005I1-8W for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:57 -0500 Received: from [2607:f8b0:4864:20::d32] (port=44546 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 1n66IQ-0003KU-69 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:52 -0500 Received: by mail-io1-xd32.google.com with SMTP id h23so10031219iol.11 for ; Fri, 07 Jan 2022 23:37:48 -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 w19sm613022iov.12.2022.01.07.23.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:47 -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=/jy48HkNUaUaZfPXMlTQ3cZWu/LfzAMp6hpZ/Zmo3lU=; b=HhQ4MSsQAsgHQLXrXodnrzhUS9aeCyIDZyVs92J4CKB0wTWwEpn5v94xhLp47QWEU6 S5cs36ES8a3slGJBA8iGSWU3wbGtDTkpSq6qSkzCQGs11wqipWoeYxb/m3eQmjtnM6KX cRHgCDov19LlNvkJ51mWbBvSqE/bhFJHGOMTMqX9qJKQu0u/6Nm0dUeJO+eExwdKqy+w guw3/fn9JV+QKM/jhqiq31jwAHGGO90Pw27on4UKRh/KkMt/BsAebY91aUE3xi5JqOvc eFzK/P5J4oKyqEOE0LoMDltj+MVccan/xNQJuyc8ZWA07HG1N6OeQviwyg5rPWH0N2ms uaow== 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=/jy48HkNUaUaZfPXMlTQ3cZWu/LfzAMp6hpZ/Zmo3lU=; b=GAF0KrLYI8mN4N0SFMESlEgOIeQqMGC/Iw/rROiwVNlgGYANLAGdPDKxklvSxLaZoZ j/+QHZc0GCeqP9a/nFJJzciSd67tahTpPn7fSxVbQcdahXVEYc+eOJHJY5S3QXRCUsIa joZX3wFNcHk8uOcAClnZ+SkD/U62aGdIPo2LofwsoZfLSadWaRGa2Jx6qKquJwRoipM3 jW5WLkOZaJFKnoLyZzwsWCXzbGD67f0auFvGqmIw4hoZhgzdBZtKq8oknWN4fomIc5PF +g0PiP0pOD+jACfLgdQsGeE5PFWh6zbZfXXL+xKE8aVK1xafzLMpRbz3znoj8J/rzTfy rJug== X-Gm-Message-State: AOAM530wGI+j/oYnM3gw39KrTrVskyco3kTolWrSls0v2MkxlL4x9PAz FyPt6lKoLxIkReqGW3AzwNSk45pG6oB+e4RZ X-Google-Smtp-Source: ABdhPJyOjGJJGRb5qOJCS2PKkfDxvf/uM7VDVhmMRoh1yyYDcg3diowGiHuyhIaZ0fQojMNiad1OXQ== X-Received: by 2002:a02:b11d:: with SMTP id r29mr34055740jah.71.1641627467559; Fri, 07 Jan 2022 23:37:47 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 05/37] bsd-user/i386/target_arch_signal.h: use new target_os_ucontext.h Date: Sat, 8 Jan 2022 00:37:05 -0700 Message-Id: <20220108073737.5959-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629555577100001 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 e262667bdab..bf7263c4f8d 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.1 From nobody Sun May 5 09:24:31 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 1641628153878824.0065076469799; Fri, 7 Jan 2022 23:49:13 -0800 (PST) Received: from localhost ([::1]:43256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66TQ-0007ow-DB for importer@patchew.org; Sat, 08 Jan 2022 02:49:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005JZ-NQ for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:03 -0500 Received: from [2607:f8b0:4864:20::d31] (port=45624 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 1n66IV-0003Ko-7w for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:58 -0500 Received: by mail-io1-xd31.google.com with SMTP id i14so10073925ioj.12 for ; Fri, 07 Jan 2022 23:37:49 -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 w19sm613022iov.12.2022.01.07.23.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:48 -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=0CJ1Uc7NVwXMrqtZuM2QHU3pj5pozei2EyzxXFFoWco=; b=SHfDJFDUazC125ItvH8AGmqOx7Uay+jM5nMBTaXg8PB/gTZkdNfm74nUWe5QXVBaX+ PZQuUZg14bf56BL3OTFpHw7oUdA3exKbY+fxb/0CACoumPcUsd70AlL30ONYxC47sbPS w2TR3JtiFzgDD40OVLzGwAEIZIEwo40ZKYVj5gpr5o8elxfvWLpeHSiqCMc/de8+7DDt jxbYVC41yyFwbu513SJx6jXjxiNv9m3/0UX7DtHjFMEFSW1qGgi902ikv7Q+bXny2XfU T9bvXLY6TEcf8XTvDpfY0ujEx+5OB/vDovmNFKRNFSbormy2hoxIQPoy0jAuAEbj4MbW 7NoA== 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=0CJ1Uc7NVwXMrqtZuM2QHU3pj5pozei2EyzxXFFoWco=; b=RKSJraRmW9ylMpMY/xm0j2w8U4H7HOH0M/QusXZ0Y1x30wkR4NpsiaRIc6zuccNvRT I1dP9+D1Uhrz+YJ0hCVv9dAjxKFH0kpLBH1WG/4AQIEiGnCXCZ9ROzlVl2LX6sD8IOUC 1paGteHEXqQ/R9vcmSkgu601k3W8h4y1nXMokQA/z//CGTcUpqFy46hGKeNTrshFVJFh sUJwJ9QCBce4J84CXU/zaNkU/1KGWfAlU2mP6HmuXTcxMK0RhehKsDmfubLq3g0acP7s lwc1xDrrN//Bbl0fiv4q/AP6MWzwnIreddxubEiQBKUbUE6RhtKTvgoLXGqu0SKYNr4Q eivA== X-Gm-Message-State: AOAM532RVTuSsdc3XCaKWhMhbTrhdEdfxHgjaw9+2T6BeLd9w5IHWAKz M6PvDptHFfCDbEYTJVlTuSc/Q+diqwBV81+q X-Google-Smtp-Source: ABdhPJwQXjIoM8U1AntRSkZ8gob+PzHWpdo/JZsiLTcDLPnFVRYR0+d0gNFntGW82OZ02r56eaL+gA== X-Received: by 2002:a05:6602:2c4b:: with SMTP id x11mr5978442iov.12.1641627469062; Fri, 07 Jan 2022 23:37:49 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 06/37] bsd-user/i386/target_arch_signal.h: Update mcontext_t to match FreeBSD Date: Sat, 8 Jan 2022 00:37:06 -0700 Message-Id: <20220108073737.5959-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641628156089100001 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 bf7263c4f8d..701c6f964f8 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.1 From nobody Sun May 5 09:24:31 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 1641630393979218.59224572729659; Sat, 8 Jan 2022 00:26:33 -0800 (PST) Received: from localhost ([::1]:53280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n673Z-0005R0-10 for importer@patchew.org; Sat, 08 Jan 2022 03:26:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005JW-MY for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: from [2607:f8b0:4864:20::d2a] (port=34394 helo=mail-io1-xd2a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66IU-0003L2-0U for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:57 -0500 Received: by mail-io1-xd2a.google.com with SMTP id j1so207546iob.1 for ; Fri, 07 Jan 2022 23:37:50 -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 w19sm613022iov.12.2022.01.07.23.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:49 -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=V+Cl1Da8qxWzFQYHoMpffHhzKgcajhVImOHitRup9JU=; b=pg/Ci6EsstG96xupGGV3+iK2w1vcfeS9/iq9RYv6RuEzprptHmrIHvQ6T5xuprooaR X5ovHKCIQTdf19Qr/TBeHwUVX9pghvq75ryoguZNXkX6O3QZcCfXCT0LuXMVfO0a+bqj pqk+Bq/fS+/jvUXFoMq6LcNEEFY0V9Xy6CKpYxFoK4T42c85SaEI5yR2oorPxsWQHHOH cMRZDWo8L1iXTTaleL0I74uqNHH4szwYGOl94OpMHx60Mw2X8mvPuvKcklVHjfPiA+XN 58CFUTihVaS9L6U+zt51xXUSxDGfuYs2BujEzp7a4w4nIwBlaRvjgkaWQ2PyR2+FAY1e 3nxg== 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=V+Cl1Da8qxWzFQYHoMpffHhzKgcajhVImOHitRup9JU=; b=pUGRVGPmwxvmrdH8ktWp65m7nBP7+1H/T82eBwKNsdYWz5cCGblahhjVwJTBBg5wj8 1vlcI06lUnm16VJMlGKDKHBlVxu/mTebiDASHw1fINPSiJFt/ZeSSw9LQoPH8omAnaXg fwHpmlXVTbgOQkmXthEU0hN51va7RQ0ovYCoVZ+rEY4qoC4U8bYT+q7RBXPzgRxZkiN/ Ukg+/Kj7kyQFJlwhUme0PJiH78OF0Uml0p1f4CjwYU6X9lQN+TERwV0HIjvfvRLHGCUh KWHqjWAV1kTY3kyDv0Y3xLPmfPSqz6MMu/fnN+talc/gJYD1cnTuHl9PX63k9JGq7+qO N4Qg== X-Gm-Message-State: AOAM531E3ohX+NDz0iU0oaph6koi4I6vmxjSeMCwJQ+JavudFs+2W/x0 WgbVZqos/gxcbdacCl9yHyAtlCfxW6J9lvZ4 X-Google-Smtp-Source: ABdhPJzVDaaR1rMWpVrLyKeeLbB0+UUocqL0UgMMMUQUZMKr3mmWrW5Fuq2xBw+ILG/lKnV23ofjZQ== X-Received: by 2002:a05:6602:2e11:: with SMTP id o17mr32004168iow.172.1641627469902; Fri, 07 Jan 2022 23:37:49 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 07/37] bsd-user/i386: Move the inlines into signal.c Date: Sat, 8 Jan 2022 00:37:07 -0700 Message-Id: <20220108073737.5959-8-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2a (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::d2a; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2a.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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630394997100001 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 ac903233653..2939d32400c 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 701c6f964f8..982c7035c75 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.1 From nobody Sun May 5 09:24:31 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 1641628862425839.6456685802676; Sat, 8 Jan 2022 00:01:02 -0800 (PST) Received: from localhost ([::1]:33208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66en-0004YD-Et for importer@patchew.org; Sat, 08 Jan 2022 03:00:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005Ja-NE for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: from [2607:f8b0:4864:20::12b] (port=35603 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 1n66IU-0003LF-AU for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:56 -0500 Received: by mail-il1-x12b.google.com with SMTP id b1so6516840ilj.2 for ; Fri, 07 Jan 2022 23:37:51 -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 w19sm613022iov.12.2022.01.07.23.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:50 -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=XDeeTs/ZwISiL/2qknbpHkl3Yjz2NvR7d+xYIi8TXws=; b=Ql5oNOcEn/6JvsMBf2wGZHXMwA2kxy32V6QjiHcbI4AMu27MQVEz4xuP6faM8ZyjwF DVuxmWjEZONYCMCITEevrZhTOQBfXQ7b5ed8+rtl2izIKyjzfBKvR5tVad+9nOr/nQhx D5kpqpvPxbl9gPmC0Man15KgwABbvboDrJKwlBuiEMNEyIu4LyMTlsDra2UZbbA7dOXk Yqw0uMQ/FlOQL3Hmcu1LDpRxJGHDl4Nj/atFlW8gAoSM/53VROCSUBKTALX12J8rmvBM /TT86fZ2VL1pi5K5XQxxgYo6QJGkJboUglMi12MsR1El0o5rPZtYQ05k/4NhUc6ruuvZ odcg== 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=XDeeTs/ZwISiL/2qknbpHkl3Yjz2NvR7d+xYIi8TXws=; b=NE1YwZuZLfMJTIjJTUCzvgKVIstifsabKO/Pssk8e5tZPAZjyjV9yMJI9jaEXUcF84 +A9bVxg31fQVY/HDKMxamXLN1m9bFOQZcqJen2oDtUf/0M4h293z1AfD+/SzWXZ0vwmQ t0gi0HQBu9axhr+pv9GJF5NwWkgGR3JXFOlHM9ma7jCzBLWFvvgz9amEqDYJJ33HfCZj hRG4GK+WWDEBeb9wS1zo/EyP6tH0wzeI8PfH4kWKRc7Ebu08BFQGYJxLwmyBU0PEMuA3 MLYP2fCkkfwxbY1J+nyI5iIyUjB8TI2zswi6U4lAFkppzIY9MugXraIuDAuaUJwOLrWQ H+8w== X-Gm-Message-State: AOAM531Jaz+uE7w2UoDWxMcWgbBkS9t3EjpgpPaYRxy7fqiZqQ4quOaG 4XNNAKuAuVxy9UiLf697Bj6pnE2UoL1uNtbH X-Google-Smtp-Source: ABdhPJy+VCmZwBPLCgX9vgaqJrIymoFl2MwV+qiI5UT2Ig4HNO7CF1WPouhyYdB6O/9DmTEgIJSGPQ== X-Received: by 2002:a05:6e02:1bc5:: with SMTP id x5mr31494703ilv.255.1641627470799; Fri, 07 Jan 2022 23:37:50 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 08/37] bsd-user/x86_64/target_arch_signal.h: Remove target_sigcontext Date: Sat, 8 Jan 2022 00:37:08 -0700 Message-Id: <20220108073737.5959-9-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641628862979100001 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 4bb753b08bb..55f742b0a8c 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.1 From nobody Sun May 5 09:24:31 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 1641629993658605.067180620346; Sat, 8 Jan 2022 00:19:53 -0800 (PST) Received: from localhost ([::1]:35638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66x6-00018C-AA for importer@patchew.org; Sat, 08 Jan 2022 03:19:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005JS-Jr for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: from [2607:f8b0:4864:20::131] (port=33577 helo=mail-il1-x131.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66IU-0003LO-B8 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:56 -0500 Received: by mail-il1-x131.google.com with SMTP id o20so30869ill.0 for ; Fri, 07 Jan 2022 23:37:52 -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 w19sm613022iov.12.2022.01.07.23.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:51 -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=LuLB1GCaE27UYhebE8MEe7wQj0GNFAlmAIMZ+t4rYog=; b=rmhy6MmztDwLR6K8HP0DJCWbyWNsectKMkBk0Kce3mJPQVacAPxDXp+9EO1VwhTHGO 9BfxfSj6EVAb/YIOKOpHZcT9vEx1MhTuBPba3CMh1cshNXWDOLpXTiDUhNRNSCKt5U5O 6YO2E8EGiVvfUFaFnqwCF5yNW4eeRHz6FtOWvviBB9ctQfI7M5qHPx8RtCRu3UbYGiKk 4T0cJ+goijz2eRFKVHfGr+Pe7JzEqruITUwrG4ZTPUlXq7S04GDQoKE2NxROflIKD9qF yTyBHWTR14N4iZ3yrmkMgc9SbrIatWX5R5kIiy8rEB/wxZPa8bJCSezfi7477+D7Q5h6 5CmA== 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=LuLB1GCaE27UYhebE8MEe7wQj0GNFAlmAIMZ+t4rYog=; b=B9eduI9mNkIc/cdAGJ74kclUdO/swhCEr28d0ezu1jPVZdbiB7Eihx0kV0nBn4bkrA 40T1L5pmMxjBJd4QPqun61tuS8mHvXm+zwz3Qnyc7MJsiT2WDs3JK7sxe8QCcr12G7x6 DfV1LUlru+XXHEIVj+tR+fMDKqOsDNDtXW7RkYCCtyR+KCe7aGvtfIycwwTYn/r3lRR/ C23jrbl5aqHnJ0HJf1ji5vJMmPbq/LcdkWoexvwK7GRuVXi5cJrKVhkgHkMDwNUdNKpG JWRT7DU/NMEq2BplmHr/fW/ukjh2wkompPogbr/gwb3lhtrDiqGu9eZcQ3lp56pAPSVo 711A== X-Gm-Message-State: AOAM532Sl6JXmSj8UPC0sIZCeEJKwhr4fhK4wHxw4TJIKZyWChbPfqsM WYfuNAxZrkObHIz1hdtZMMQ5x42AzWB5Lycp X-Google-Smtp-Source: ABdhPJyMQxavm3Q1NeKZA9S3jAu0rcWPW/XqrTGGnKSJi4A5Q7rMttmvXjyOzDJR8H0/UZZYumOq7g== X-Received: by 2002:a05:6e02:1c06:: with SMTP id l6mr1361840ilh.239.1641627471664; Fri, 07 Jan 2022 23:37:51 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 09/37] bsd-user/x86_64/target_arch_signal.h: use new target_os_ucontext.h Date: Sat, 8 Jan 2022 00:37:09 -0700 Message-Id: <20220108073737.5959-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::131 (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::131; envelope-from=imp@bsdimp.com; helo=mail-il1-x131.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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629995530100001 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 55f742b0a8c..e84aff948c5 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.1 From nobody Sun May 5 09:24:31 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 16416284727659.648665857270089; Fri, 7 Jan 2022 23:54:32 -0800 (PST) Received: from localhost ([::1]:52868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66YZ-0006kk-GV for importer@patchew.org; Sat, 08 Jan 2022 02:54:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005JT-LI for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: from [2607:f8b0:4864:20::130] (port=45021 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 1n66IU-0003LX-Lv for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:57 -0500 Received: by mail-il1-x130.google.com with SMTP id v18so6462782ilm.11 for ; Fri, 07 Jan 2022 23:37:53 -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 w19sm613022iov.12.2022.01.07.23.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:52 -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=oojTYNevouJD4FnDtUcg1HziLTiCetAlphOi7JaWgjk=; b=4jeUIZT8GI3JngGBBaki91c2ARK5a3WBVaJ5ytitQ000lcVRK/5YbE1G0ezBmevRMJ iYCvWju5nnheRZJgGGl98JmfMGO0XbqbsNPYfW7I8lzZqo5pr04NeU9wBj685VmMyrlI OGQOd5I3IP5O7ZTNTVPrr5GVGEqBOOQa+2vqaRxJUbyyZrzpXJKFJU3lK4sjaxkEK8gR VBpVvqDRUB/d3fU29pWfgRBHpvlnDXtk2C5ar8vsnz4HHpJy1UTH6JnqmAigNupbtxjd YSXpaAX8eQlxWkfpZV0Eyvg72vfa7mErgFe0PNt58z2Sya+Gie10VaqSIs2eMC9xJjbk amTA== 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=oojTYNevouJD4FnDtUcg1HziLTiCetAlphOi7JaWgjk=; b=SzeddEq5+WsdZzWtFFuRxcKIdi5ATs1q51CRd4f4G8spRuSzIde2g/iBYt/8o0QUXf z/5JQ1dna7SHwtERvBlGBYYr93Gq7CjOg0D56GIXuetPTtq9BXhk8QxhyHOdYnGjQyTd U7kdRiCCE0wT23+ljomjldmLolpZ27RoMpoaM8lpuWRue9LwwvqJTR17+PnqqIyfHw3y si/foJuUkYgNT1otsns5RpVN6ynD/+dqmLLJtO7RPBWxuFUClqJbyydBkMSJttdFxuVv nmuCRjTNRhyI3VjHwdeNrq3Jx78mGk7hYwtrdtCgxqZ96la5hNYp8UaZVW1+yTwDWKdI nAYw== X-Gm-Message-State: AOAM531WZCp4DRakxZZZV6Y5f8cawaizSaZF3P2/GSqjUKPMvD3erwM6 jpdg1hJ7pcXzNDV2zVjMSDLgL1ES0ILpy+mE X-Google-Smtp-Source: ABdhPJwchiISq2NN9os5/iWHjOAj93r3uEwGGiAmeVfKCJxThMmZ+Q1j8H9SarBW0SU6XnJcI3qa5A== X-Received: by 2002:a05:6e02:1708:: with SMTP id u8mr26671086ill.308.1641627472552; Fri, 07 Jan 2022 23:37:52 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 10/37] bsd-user/x86_64/target_arch_signal.h: Fill in mcontext_t Date: Sat, 8 Jan 2022 00:37:10 -0700 Message-Id: <20220108073737.5959-11-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641628474616100001 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 e84aff948c5..720e3939c31 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.1 From nobody Sun May 5 09:24:31 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 1641629333238460.8895573339603; Sat, 8 Jan 2022 00:08:53 -0800 (PST) Received: from localhost ([::1]:47902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66mS-0006Qx-09 for importer@patchew.org; Sat, 08 Jan 2022 03:08:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005JV-Md for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: from [2607:f8b0:4864:20::d2f] (port=43843 helo=mail-io1-xd2f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66IU-0003Ll-MC for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:58 -0500 Received: by mail-io1-xd2f.google.com with SMTP id l3so10038392iol.10 for ; Fri, 07 Jan 2022 23:37:54 -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 w19sm613022iov.12.2022.01.07.23.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:53 -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=BTfsxNM9ad3sFK6UU28aM7rb4iv/9BYwnwzFoeMZ6WY=; b=K5PfPAWntw7Oo0tXZy0HmNOrVmm+yBbcsWvJcFnEgtR8gMK//eSP3bx8BkwY4TxIr2 +xonyzjeM/MYS8SmNy54pkUswLT/JZZnl85Tj7nVyAXVrkKnHNf0JIH3mWkO/B5jFUPd BNvVrG/83LHqaUITaM/+DD/N3JZP4+Q2DA0SK+/nLx4WdTShJcE9cQKSzCOvcjMBhjFk zfxvVmOzal7DSidSwehhyJ8LGHPpxdHq9i8yXFtzed6ZvE1kuM6sjSssXmW7w5g52Emo eFbU6reQOHSKD9UMqGXT8IkaeXnxuQXQ/NeU9lEH1WFKpwCf6uisid6fPS0E1P2bYjZB RK8A== 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=BTfsxNM9ad3sFK6UU28aM7rb4iv/9BYwnwzFoeMZ6WY=; b=Oa9p2hfqDzZcqKHvCmWKEtX6CJkHe3K7cOD2zk6R/fAQM52Mg6JKDJzMA3IfO+HGqU 8/Lf8YlYri+P6lb4TYn3EeV4FIyOQ4CKnVzA8jnlEt9Azxa3T7mR1eeB2qmS79fwwbe2 5BR5OqnxWDP7alb7BEA2srAC9mH/91MmpQMkRwilEYlUj7KcLoqgS2E5VaZzIaxIclHP LCX2C6VwLRjXpFdUJMaz37cHzLxPby9xh3o0dj6kriTOV6DSQ0FxBU1Il6wunpxs16OI Z6PiaTWMJWxe3x+NG6PeDeSPIzlw4q7hu7EmHgPpc5kI6rpOzPwsIqK6sHBCE43yO+GA Jk9Q== X-Gm-Message-State: AOAM531Tsl/lnDoqsXAVHSO3oLWNRSxtAc+uxKvGzekExI/1CtPCC3lw Liy5zVisiiW98pzDzt/jBi2JI+hEqomFoosy X-Google-Smtp-Source: ABdhPJzn27Gs5NogZBYep67u7habEeouDBsI1KkuLQNOqSR+zV2XBkyZe5gmjcISTixclihClC3s+A== X-Received: by 2002:a5d:9844:: with SMTP id p4mr31469971ios.109.1641627473416; Fri, 07 Jan 2022 23:37:53 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 11/37] bsd-user/x86_64: Move functions into signal.c Date: Sat, 8 Jan 2022 00:37:11 -0700 Message-Id: <20220108073737.5959-12-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2f (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::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629334294100001 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 ac903233653..8885152a7da 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 720e3939c31..b39b70466ef 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.1 From nobody Sun May 5 09:24:31 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 1641630239024336.1464877140437; Sat, 8 Jan 2022 00:23:59 -0800 (PST) Received: from localhost ([::1]:46450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6714-0000gZ-0B for importer@patchew.org; Sat, 08 Jan 2022 03:23:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0005Jb-NT for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:03 -0500 Received: from [2607:f8b0:4864:20::12b] (port=43820 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 1n66IW-0003MC-2Q for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:37:59 -0500 Received: by mail-il1-x12b.google.com with SMTP id d3so6453013ilr.10 for ; Fri, 07 Jan 2022 23:37:55 -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 w19sm613022iov.12.2022.01.07.23.37.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:54 -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=0CqTPJq/tJ7F8T2WyiTYooNJL76c+e8K9lgdH6FKRTc=; b=maDlcgx3gK9QtAq4NoQzdvaKSSaESa5JHzqDKyP6Hs/5mbLOhLrNp5MQ9M/Ikhy0Cp rZGNx8Mfr1NdGKxIDXrbHFtfY9So2QBnUFz6tRgQypLGv/rkZQ09xTfbWrGZxdtfql21 snf4APVrGKASFyb6BXRyS1lBldRj4D5T1cAAZLd/VsTmYHIcRhOW8pJ8JZX6oeJWnHdR s1/aqAr/woRZlDPdFju67zPhFekt91tsRThFLkAA+d5hIMsSHTCDmrOa4YdVvgehsTJQ BKWdARQ8AgLQmUKKo7NMSYtaOxWaZJ3Shl52zKS1lB1ZhrSBs9qjGP4OmEAat7pnzEQG J3dA== 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=0CqTPJq/tJ7F8T2WyiTYooNJL76c+e8K9lgdH6FKRTc=; b=NIqJHihhD7xKp9xNMSsAxjfOWL0nf26NXdqLvzNio7x1R77eTxT347aSeia4/K1VIM GWjKRU7a28lQwMWTCc1k4vaPUJ6TFtwwC1NGOVClXYahLDWwgdUtW/RJk6wzaIkgE9gM yDFY/IXhbyP3wRu8/uQ80irfro1u5zupq/pPRAdjN+UmBGVfN2NgZCvw4ARMXxg8uTg8 XHx9UO5EGtQLkgQVYp38pfcI5YtZCsLm8vK0p0zcjks1JaDCYXpttNluaqxXeLHvULLR GOD4WPZdjZC3lNZMrliKLg/8hp6lfX0Vc2+7ISdWi+7qDcTKglWDyuquXcmDSfhvlCyv 8Dlg== X-Gm-Message-State: AOAM531cqUCpo/zPKH/3YXGuKzGmEPlvLpld+ctVkKbHRCW1dYmX+wNI 1+kBntwi5Ryv3Fcu/RVo5PlhgRz/mQxrAAa+ X-Google-Smtp-Source: ABdhPJwEy8K6ONN12zBymJqdUNNyA/mEjSQ+LRlFIdOYIAywhJ3kFJ9VX09WRRut7308JkECKA49OA== X-Received: by 2002:a05:6e02:1033:: with SMTP id o19mr32312874ilj.267.1641627474334; Fri, 07 Jan 2022 23:37:54 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 12/37] bsd-user/target_os_signal.h: Move signal prototypes to target_os_ucontext.h Date: Sat, 8 Jan 2022 00:37:12 -0700 Message-Id: <20220108073737.5959-13-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630240106100001 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 1d0c3c4e651..dd61aec7cce 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 982c7035c75..279dadc22c7 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 b39b70466ef..b4a0ebf2bd5 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.1 From nobody Sun May 5 09:24:31 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 1641629045580407.18574573000615; Sat, 8 Jan 2022 00:04:05 -0800 (PST) Received: from localhost ([::1]:41844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66hn-0002B9-DR for importer@patchew.org; Sat, 08 Jan 2022 03:04:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ic-0005Js-Hi for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:08 -0500 Received: from [2607:f8b0:4864:20::d36] (port=41727 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 1n66Ia-0003Mc-5P for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:01 -0500 Received: by mail-io1-xd36.google.com with SMTP id y18so10100404iob.8 for ; Fri, 07 Jan 2022 23:37:56 -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 w19sm613022iov.12.2022.01.07.23.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:55 -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=mZBnE033yruOj+6+f3yOKrn/YgX/XwTkzCLoSaIb1ZM=; b=AKiLWI/cL8f4kLeRdGVVgrZK6k3G69gBbcyuVJxz/S1KIKHayC2lM5BYPfbf0T4Bxu qjyMVL5lVd70sCQSP3JG5iflIv4q10kbDwyI+KdO9Y16g+y7kewfg2dcMgegNj0HyQCy FBWCm3eA26+2Pf+3apl+NWB3T458ma9V6hFK6vMMDJtmECNzwb+Cll5P92Xitr9Fl7zB 7qCuvEzTgvQ9UDV+werTNNbmbfXi4TjsY/aSi3l5ATRXXFsMerbssROtgWSE+4gsX9bn JuLvUh9ve9ioRueqOaFFbPe4oietQMA7Mf0IhTL0G6jE09eemBsRhoUZblQPOqmzXt48 dbag== 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=mZBnE033yruOj+6+f3yOKrn/YgX/XwTkzCLoSaIb1ZM=; b=dUFXlAt3gLHH6XDLu2iEusDSudhRR2cJOcARAXIHdW27EQf7WkwQN4CT29SVU7/IT1 wYwnY0qMiildWkBwK4bJs54B/App7marFLNLs7SPoq/mRoJrAmu6ZWIaMKGECOykiuic Z0lDkK0cG2qSPS7E0SRi8Ew0hkiHBhEvq9ZCMByiyEbYC1aLgNnyjarmvc62O1C1Ho9R PUGed7y+naft4ApniBHjOWnRIskE4n0l4Mk6fC/0rD37ejEXpussUKMkH6H8/BkRnxDO KZHxGi9gAi8nmH/YkORN636xE/WSENzcxVQoo7olwVaZFeiMMCIW/CFronX6TINvfT6j xhhQ== X-Gm-Message-State: AOAM5311tnJeVQQpky7SM6wOXKh/umoxfYO+UAWCuibBtaqDoqqz2MNP U/+WwhOSbnMO+x99cWM1qt+G0uTVhCVsHFHA X-Google-Smtp-Source: ABdhPJxbDqp1hWqU2X9l+8w+gUAFoHdtMT4t8MGQ9iDymheGG8yKXO0w+dHwBlxiTZ47VDQEQ1DEAg== X-Received: by 2002:a05:6638:160d:: with SMTP id x13mr30818617jas.120.1641627475714; Fri, 07 Jan 2022 23:37:55 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 13/37] bsd-user/arm/target_arch_sysarch.h: Use consistent include guards Date: Sat, 8 Jan 2022 00:37:13 -0700 Message-Id: <20220108073737.5959-14-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629046362100001 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 632a5cd453a..8cc6bff2077 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.1 From nobody Sun May 5 09:24:31 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 1641629694471924.8241105321425; Sat, 8 Jan 2022 00:14:54 -0800 (PST) Received: from localhost ([::1]:57464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66sH-0004m8-E3 for importer@patchew.org; Sat, 08 Jan 2022 03:14:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ie-0005K1-I2 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: from [2607:f8b0:4864:20::12d] (port=43822 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 1n66Ia-0003Mn-64 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: by mail-il1-x12d.google.com with SMTP id d3so6453053ilr.10 for ; Fri, 07 Jan 2022 23:37:57 -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 w19sm613022iov.12.2022.01.07.23.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:56 -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=0H+m4LDBE01vFVrI9/EJo5rUemEcZhwntbPVg9Vpa6c=; b=osC5SJXbPxU4OcvFO+TIWLUT6Lh1U6of1ZgrJWeGnERvW5BPtQwEyoucQfmN7FSZP1 0JYcoV1j13BCoFo8BD3lYXDYXnLkNy4Gd5fIyymUB+7hT7fwKrA8HNGeQBH3HToOVVwF 5wzdL/z/93gWGj9QeOS4DSwDOgw+d1Lo13PSfFa3ce2BniMTMXpyjOw5AUIZ+4FTdKdo X0wBeC3G7AjRVkpNKeXDoVX5bx32+ykd6MTnUDwa/FvRZ0C6+WMwwiydJEXVHcjjv88f IFU9bG3O9AGh0ANcYTzyfLJarqC9DFUjMaJC21+vOKKgpKsAM+yp8pqR8l8K04eYFPF/ VHBg== 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=0H+m4LDBE01vFVrI9/EJo5rUemEcZhwntbPVg9Vpa6c=; b=siRNw37YDKi2UVNyg9IBBbn41yZ2F46iUi2Usb6KSv2Wx7Wx6MoOgg2sks3ECRisUB hDXAGV9skl1EjGuOaxuou41T4L90WYDVuZY/O8TspHj3mXprN7XKJNLNnUh5dg/kN8O/ 9CE7BxhpSAfiygixLNpJQ8bLZrH1pHTQp+VdyTQTqiI6HPV3v03y1oMyOm5yw83lUL86 8PFuHyxDk21161le9RMEbTmZ+b26THfUS+FZwO8l7kFmgbTZr0IaNn2roE33gmcUZrNd favTfr/4wGjefxLN0MUgp3cLaG3s5Rzo+UylQ7p4g+BfyZQ6fZX3efiKkX9yYRfxoUHA dGJA== X-Gm-Message-State: AOAM530UbP2O/9U+Ir7kcXCv5xvQhtX1gW2vkRuQofpPU68lSwalccZG kcr0Pr6EEKoGE03mm9rkjf1bDOMoEokF3/Nq X-Google-Smtp-Source: ABdhPJwHHwgzafTWPB7iMYAZ0fGjjUj7/QXs7K1MwEKmJu7tWDI0ysKtXLgcqgHPnYuZLTyYeE82hg== X-Received: by 2002:a92:dc8c:: with SMTP id c12mr29411185iln.43.1641627476596; Fri, 07 Jan 2022 23:37:56 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 14/37] bsd-user/arm/target_syscall.h: Add copyright and update name Date: Sat, 8 Jan 2022 00:37:14 -0700 Message-Id: <20220108073737.5959-15-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629696654100001 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 ef4b37f0178..a5f2bb4e011 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.1 From nobody Sun May 5 09:24:31 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 1641630523964391.3660532402911; Sat, 8 Jan 2022 00:28:43 -0800 (PST) Received: from localhost ([::1]:34600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n675e-0003Na-QG for importer@patchew.org; Sat, 08 Jan 2022 03:28:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ie-0005K0-I8 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: from [2607:f8b0:4864:20::134] (port=35612 helo=mail-il1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0003O5-D8 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:04 -0500 Received: by mail-il1-x134.google.com with SMTP id b1so6516983ilj.2 for ; Fri, 07 Jan 2022 23:37:58 -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 w19sm613022iov.12.2022.01.07.23.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:57 -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=dGk1mYR+ompm1xLOR0KlYLZIRg9T3SJe9aFkUo7qUu4=; b=wmlIVybvJUbsOoVR96K7OED2nZ1tfRqeux+dLGSv0kC1xfM09erl/Gn4PgrBok5/P/ GUY13Ss247fCHaUDNzW413lka65fzdvnRZiCgYhi0HnnTXrkUGsn8d2sSvledw0u0kdC qGoLPY9RRrdDvxh1Lr9z0c+RPudIb2jMHiOX0nD7LqsbkptHOysMDj4lQAl5mlGEpO73 15u6BbqtXSOsvIgqZ/WPfFuPhBRdCRj2s5OGT43jDWeIl4ddej8MHe3ugZY9swPdJSOx LBaJTUia33EC5IUnZDN6C+Y+zGSepazySgZhwBihwUycD3qbhvIbAF3DoA88S/R7e337 aJ7A== 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=dGk1mYR+ompm1xLOR0KlYLZIRg9T3SJe9aFkUo7qUu4=; b=Ndw1qcNde7GBCZSZ94IClUK4fMXPx2C6BdFd1UXJe+ZMxAptkzJXDdibG69f+OZsdO DrOfR7np3iPU+PHzrzNppCA7qurxvH+i2dXXHuf6jb+iGYVwc/8JzD8PlqJg7Xrv4lKo DNq4Z9vFKGrfOG4izHOt3L7L6em/26bryTEki2LhiFmYTbAAAu9x3jEKbM1ohhjcRydB cyp6oQ/emLeGotmNiIcuIzj/YVnlNGWhKtCAF8dvpqH6GjnhKwFn1mgxxDOrzWfERzxC GDD7WQ5SCHl30hRVgGD8YOH3M59xyozanNzRVkWvphfiMghoOkvxB1MYYEtIfz/j7s8Z jjlA== X-Gm-Message-State: AOAM532ku3K3BgPLUeYehysGZ/sZgs5++HcWdbEjSOULk9D0RiuNYMAG bgZJMY6aSI7ZiRC0owKDZqt57PE78LZ+ea54 X-Google-Smtp-Source: ABdhPJyu9uu+FLYhxyBiRuXFuSAlHui2GVSQ5AA67MbiRvecRt4N04KxF4irbqaIIvnDJ+n+IBTBuA== X-Received: by 2002:a05:6e02:1c85:: with SMTP id w5mr27470309ill.27.1641627477738; Fri, 07 Jan 2022 23:37:57 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 15/37] bsd-user/arm/target_arch_cpu.c: Target specific TLS routines Date: Sat, 8 Jan 2022 00:37:15 -0700 Message-Id: <20220108073737.5959-16-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::134 (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::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630525954100013 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 00000000000..93cfaea0986 --- /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 00000000000..02bf9149d54 --- /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.1 From nobody Sun May 5 09:24:31 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 16416295430518.087487759140913; Sat, 8 Jan 2022 00:12:23 -0800 (PST) Received: from localhost ([::1]:53320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66pp-0001xh-KH for importer@patchew.org; Sat, 08 Jan 2022 03:12:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ie-0005Jx-HU for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: from [2607:f8b0:4864:20::d2a] (port=36580 helo=mail-io1-xd2a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ia-0003OG-DA for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:02 -0500 Received: by mail-io1-xd2a.google.com with SMTP id p65so10131350iof.3 for ; Fri, 07 Jan 2022 23:37:59 -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 w19sm613022iov.12.2022.01.07.23.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:58 -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=gArjWzJ2yPQBZYD392wz0jyhocYmDAdMk+rJb0d1s7I=; b=LjC4ZTWgJnRR454lFakfKma0IZHlA7ZFYTa0sHMXYoJVOcJT5I1qOU5yRe3oYkDj7G a0DiaVZ7RMsU/Ee8THxEYbI8kb1RYa/c4YsEeDFFXbGCCakoiZqWEleOH1wgWPCe4lH8 cGxxdhbl8tIIwCJmezXR6KhkoO8Cn4lzx1z6ARntnH/Td37X862IfnR39CLk0h4dlSwc psy7HMks98jgQA4fZbsAooqEF0ZcGIEEf+n79at3wDh7ssiSToW07R7hJvxz9iDzG1ja ShDWlj2vgdbJrvuEg8YNi/wL/7NApxlnpnsu0fJXeDwQHxTcpEmLdNns05V4P8QcOnXL +tIQ== 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=gArjWzJ2yPQBZYD392wz0jyhocYmDAdMk+rJb0d1s7I=; b=jshfZpZG3lbaf+zj9NJVQKQvqwe18xnrO1vWUVQQBk5hNNM0MX+n4GhTjI8fETiBOG qQSDX3geMJNVnRzeCVKtCPlOuBChcqsQauMKdyFyzN1n6H+LRC9wOBM51LjBlSHhzrMv 1wia37jc87nwzvXu/0NJca6YJkgeyEogReN7aVdGJxzFEqgNP2SGgPmnaFb97zR8f5s8 iFaN7RFsdsd4gjcCN3dS+UoBVciXS80b/r6VdIgE71fpLB0aBX8z/aya7aMICpXIcUvF hksB6y1toZHN2ZbQHx42zOojBzke0fkY+CGnFKRQ2oB/KBIrFgduvoRM+hU7zoVB8uKN BdLA== X-Gm-Message-State: AOAM531ogdocJ0oVHIfR9CaOVkhUDx8+cZ5TlPu2ibL4jg2AiWxoSkpF lgTZx5uDTyLOJDalmQ3e+PtArRnCg/zhZ4LV X-Google-Smtp-Source: ABdhPJxTNLnXB1dH12MSXGZ1+E2Vr2ubDEWSPvMcoQYiBGVXWJUh3vOQu7pNxVLj5Wo+FyXEB/p/MQ== X-Received: by 2002:a05:6638:d9:: with SMTP id w25mr31278007jao.123.1641627478702; Fri, 07 Jan 2022 23:37:58 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 16/37] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions Date: Sat, 8 Jan 2022 00:37:16 -0700 Message-Id: <20220108073737.5959-17-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2a (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::d2a; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2a.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629543695100001 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 00000000000..66215684d6f --- /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.1 From nobody Sun May 5 09:24:31 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 164163042223134.82369493026283; Sat, 8 Jan 2022 00:27:02 -0800 (PST) Received: from localhost ([::1]:56008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6741-0007GR-5B for importer@patchew.org; Sat, 08 Jan 2022 03:27:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ih-0005K6-W8 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: from [2607:f8b0:4864:20::12e] (port=39663 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 1n66Ic-0003OP-9L for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:05 -0500 Received: by mail-il1-x12e.google.com with SMTP id o1so6332785ilo.6 for ; Fri, 07 Jan 2022 23:38:00 -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 w19sm613022iov.12.2022.01.07.23.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:37:59 -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=3nePtE5ZTuo2h1AKS5faGNz7Ftuxfg1QV7jdqmeDiQY=; b=l5hvCeEfckp2u2f1C1KhtD/tVLhthtkiJnRex4IvEMCWPmTJOQ1QYqa+s0fr7bwfWt 5KwpqEzjQNT42WxQ9kyaoPFRDfB4YY0wxRPUraeTU0CBuifNoq6ag6+mRatnjLrcEN0T PSEDWLVkygwVDTNKwYImHn/DV7oUG4RHwXPJ3E2DoybezGLuYobmrQIdVbCQKcm2qOtw lO3tkU1I/tLCR3usanRW8oYaTSK/EMLJhvxLJJ5h3+DCpsRDPgqN6pBL2hzN4ZCnNrZC 2TkgGnGxiB7B7ckvIPTRCiVR/WL2LTjgWE2kdR7O2DQXb5BH6QuTLOvvaN/VlXGFIxY5 gyEQ== 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=3nePtE5ZTuo2h1AKS5faGNz7Ftuxfg1QV7jdqmeDiQY=; b=mkcYxjgQni3LdAMIZlxz9XeuqLkOwyNrgZ1FSDG7T+uF+DKuWU3gswxinVhvOLIwcb oIDlVPWhFGzqAwgC/3DuDhYMykbGCSnpN6Arn+hyTlZowINtzkCqWUOO1XW4q7ThufeW gqUCk9OKxfHT+/jir0DR3asOYy7mANs17vVCIJjSSn+LtxrC3u708OJXp32o4AXzqi7A DcCCs4rHk3B4RbBI4r0/uvMgv5HmrzX984ovSGrlXcqk7l/7lpV5oi6UqS42ZAp/7trG 8SYdAR+Hqiz9/h9xw62e5RAfNB/C33d2VGyqsJ0xj38CyVHLY+RkIakk3qVFJJTAVGaE extg== X-Gm-Message-State: AOAM530HIlI2dWe09XQozK7+vEFrVvJpOw1KE3v1goQoTxyhGtUO+Awr cTDFaLxOMDB5Zy96X/QOehEZ8lVL2poPPgak X-Google-Smtp-Source: ABdhPJxAAUoHezTAirx/IiF37/gjwNMuD7KauWfOuz9Bb+WoCg2PQZcqp2cOlHtLPDo3KkrVUsmVCQ== X-Received: by 2002:a05:6e02:1d92:: with SMTP id h18mr30648155ila.314.1641627479588; Fri, 07 Jan 2022 23:37:59 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 17/37] bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs Date: Sat, 8 Jan 2022 00:37:17 -0700 Message-Id: <20220108073737.5959-18-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630423206100001 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 66215684d6f..fa45d9335d6 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.1 From nobody Sun May 5 09:24:31 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 1641630045933144.83212900501724; Sat, 8 Jan 2022 00:20:45 -0800 (PST) Received: from localhost ([::1]:37720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66xw-0002b3-VQ for importer@patchew.org; Sat, 08 Jan 2022 03:20:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ih-0005K7-W8 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: from [2607:f8b0:4864:20::d2f] (port=41721 helo=mail-io1-xd2f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ic-0003Pc-9N for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:05 -0500 Received: by mail-io1-xd2f.google.com with SMTP id y18so10100596iob.8 for ; Fri, 07 Jan 2022 23:38:01 -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 w19sm613022iov.12.2022.01.07.23.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:00 -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=++7dSM6FOSmYgDBj5XseBjuyEkBOfEOXIVkqPoKsD28=; b=uMfFRUX95Eqn6hNLJh0tz2++CanMMADMxmtrqMeW9UXk88mrJmF1sW5Ddf2Z9u8FxJ 8O1ZOpc9wUIHdmcjhmkQnZ29VMuisjQcPXD2qrdFT5kUm/VGHagvYhpOT26kvSYxzXTG 5IrSQJ6sCJ8zt3tDM8WATPQW9qAc4pusGXF5KWoJkW3MDM89POVep0Uh45ypiLNB6FGm TYvtpxCOCbsCysZO1R8RcIWPzit6LXQI5KY1c33EpbPIasvJe4NstB3UnDefoTkXDMnI WP97Hnt2j8fo5saFUk7cJJvg5twktU9OIFPAo4iSdeeCNo7lRpKLkz/SNw+YBjWKFhP2 NNQg== 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=++7dSM6FOSmYgDBj5XseBjuyEkBOfEOXIVkqPoKsD28=; b=rpXkYz2HA3UMNvJZyP8koRFbghhE6WA38/j8PVQr6j+xIQXMaMaUMB9l3CY0QxOGPg hlyzj5FZSf5XKOyUy6aBBuF75TNC1xAAYZQME8t51cjicDrh9Di52CAXUoBUF11BEKGU p0RTQ8If/qiztTyWWXjwT1BBY9HonwzSIdiL4kbjMFY+Wkkw7U7URhmJ4LGPbAGe+Be0 3QXXmD/O846zP+ZPDKJfZdAkKtq/SxzH/8LKwe/NjiMok81DHKdMh1lLLotRMMmUxEP6 ci/6EDMUH5SwYFl/hpUIlIRMdk81sGKOP7P+fV5Dwx1tiCQydLAm0RL+Rt6D6mbfXMfH N8Gg== X-Gm-Message-State: AOAM533YnjkLBpUJucEr0GGmaXl/8+v2/4qhK6U1m/nCrPxCDjkM90oR 2w9l0kSZs79bbMXyBtth0Govg2HpF5ek3cgi X-Google-Smtp-Source: ABdhPJxNehLA6zndt5JJYSIRcAPE60nQ/mS5pzqZ02RGuTUYnJ/TceFskDRK+Wyux4e18HkxsMeLIQ== X-Received: by 2002:a05:6602:2e8d:: with SMTP id m13mr32436394iow.68.1641627480497; Fri, 07 Jan 2022 23:38:00 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 18/37] bsd-user/arm/target_arch_cpu.h: Dummy target_cpu_loop implementation Date: Sat, 8 Jan 2022 00:37:18 -0700 Message-Id: <20220108073737.5959-19-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2f (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::d2f; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2f.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630046800100001 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 fa45d9335d6..2484bdc2f7a 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.1 From nobody Sun May 5 09:24:31 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 1641630577703149.72493619290003; Sat, 8 Jan 2022 00:29:37 -0800 (PST) Received: from localhost ([::1]:37388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n676W-0005Ou-LU for importer@patchew.org; Sat, 08 Jan 2022 03:29:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ii-0005KO-MP for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: from [2607:f8b0:4864:20::134] (port=37412 helo=mail-il1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ie-0003Pp-7n for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:06 -0500 Received: by mail-il1-x134.google.com with SMTP id 2so2324349ilj.4 for ; Fri, 07 Jan 2022 23:38:02 -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 w19sm613022iov.12.2022.01.07.23.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:01 -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=cLTwIHEIl13GSbdWHtA7LCjVkj5LLcCAHprKI0xeB4I=; b=4lFcgypJReRH3+v5LQNNNcGKNixJ4XHsBqLakGEpSGXTwBOU+aKzEj2ylU2uVNUSMS 0kEy0TgmrQogQE7exdxQCpECDfsJZnwYMUjdub22jb2o5eAI1yeyrlgwC2YukpQcOVNZ SBQTSN8GECMFEIiFrqER/fwWlbyzA2drQi7wF/82bbeY1MsQqoDPbGtUL3h4mBronWSL C5HjoUTWdWAoeizYy6pqkrZJqyJD0vyxmrSwLxVSGy5GfLoYOP22DK8oCUHhxryZa9XU zwDoBczo3WRi085/v7IyFBOmUOCsw1UCU1b3n8r2aFgHJe+q/0AuGnbdWvcO4vlCqqhb u0Og== 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=cLTwIHEIl13GSbdWHtA7LCjVkj5LLcCAHprKI0xeB4I=; b=qwhaCHqvggA1cSLVfkA6RdjjMfcRXYrbFcuDAiUVAMhMWLb1ZPr+FiS0n74xj8B8g4 SlCc8XZPPpdvbyK4sPt6mZnPhlmy2U+IyJXXLxD+jOO+AszZOq1ZnFnyyFxcrs3o/Cx5 tgczztTKufTadfGw8Xj+kkFlzofmjGGnkQPvrmb1k7oa8np92vLc6U61/wf530Fg1eZy 2FlRgYcvMy6fAwbbx+Ox9BDMBcNEcHYwkK7gIDoxcHDKDYQdpk+nfRvOZ1KJg/l+AaE9 CPk6o+r4ALBy42MuJQJr/aXus+GiW7FgkCWaL6wNSCBErCxV6SouLGP62sdDOCv3jg/0 pgOg== X-Gm-Message-State: AOAM532db7YDS1GLXGE+qK0z/JmDctL/ZPhQwWHc6bl4i+uOE3pDl6mU 0Px2q4pLasLQ9ICA4WNog76TquugoodCd1Sq X-Google-Smtp-Source: ABdhPJyroJ6d1NLPvLF+CdzcMJVJVohvG9kJpuKazDmwM3Bl4lyl8YlyfQITAjCtdKaoCrHvgACI1g== X-Received: by 2002:a05:6e02:1569:: with SMTP id k9mr30182738ilu.290.1641627481369; Fri, 07 Jan 2022 23:38:01 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 19/37] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions Date: Sat, 8 Jan 2022 00:37:19 -0700 Message-Id: <20220108073737.5959-20-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::134 (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::134; envelope-from=imp@bsdimp.com; helo=mail-il1-x134.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , =?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: 1641630578320100001 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 2484bdc2f7a..9f9b380b137 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.1 From nobody Sun May 5 09:24:31 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 1641630867193609.233121473028; Sat, 8 Jan 2022 00:34:27 -0800 (PST) Received: from localhost ([::1]:46262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67BC-0003Ub-2a for importer@patchew.org; Sat, 08 Jan 2022 03:34:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ii-0005KM-Lr for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: from [2607:f8b0:4864:20::12f] (port=45675 helo=mail-il1-x12f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ie-0003QA-9A for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:06 -0500 Received: by mail-il1-x12f.google.com with SMTP id t8so6457726ilf.12 for ; Fri, 07 Jan 2022 23:38:03 -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 w19sm613022iov.12.2022.01.07.23.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:01 -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=CM117LpYpXND7JkdncohCCBAU91EayOUZoRKvmUOZBw=; b=2aFFLW5FyTGUM/6C2u+gQakccnyNVzfv6JLape/JXGsEN/LlDCL0PfzFFgbF0WOk7J rMJdF2/ca6G1jxri8E9rc2+76KVfIhyLdIiH4OUi3xh7UCXn1jgB3gGG0irI9KsQPoTn LBEkIszjbMXAkcggLTG9DqtHW80B/CoCQRAbScLFVROSjEKl4fi4Y8vIRcZG38TJJX4a K5jfaTv/3KGuF8Rq32JmKAOPmmlRS2+pJ8RG9NtAzZVq5DE6gN2LT/37OCfgEfHV8A7S AQdcJJIsueszBSqfNZxQ2TYm0YUHexwpejtVEwEj52rBc8FpzjCSwXrJ4o3F6b0ZwmBV b4fQ== 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=CM117LpYpXND7JkdncohCCBAU91EayOUZoRKvmUOZBw=; b=cor9W+JqPGAPZLYn/x97kc/uGrXRYuI5C/aXB7s1tEoEiM8hA/q1um2MJhbnKdlBE6 UQ/vKcY19TC8HDJlNEsCNDFxXKQDdqwji1d2cOK/yTiZvN/SGFpVmglVCb5S/1eHMl/K n3EpGFHwr8JwdncuFACkjfstwwR9+7dwsomwqrmkJFe2gcHrZui9R0oZvUfFUkOHYO1A QypbGD0lm2zkHSaFnfwLNbTGAp8mX2WjLL2rEbfmoAEo6D/2V67djY3uvpGyd8kGaign XWXpUlNaZj3yW2OsPFVTgX4o8tMMUEhEKKRX2IG2sUlZgyDXzzeQwr8h+IFMRuKX2Rxw +3zw== X-Gm-Message-State: AOAM533PWBRSKeUeyseoNdE+X+zVl+72pbaOv0l264f/ODcLAwnEXqbz neMPJR09+ZTq5vBW+53x+z9mCMuQyLYGxPur X-Google-Smtp-Source: ABdhPJx9bBU2xS0yXTG4BTSzHnm42K3nlhO5wIbbgVsKPaCwNxIm/bF9tl9Bb9gafrb1QsiDGqF/TQ== X-Received: by 2002:a05:6e02:164c:: with SMTP id v12mr2353552ilu.49.1641627482269; Fri, 07 Jan 2022 23:38:02 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 20/37] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions Date: Sat, 8 Jan 2022 00:37:20 -0700 Message-Id: <20220108073737.5959-21-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::12f (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::12f; envelope-from=imp@bsdimp.com; helo=mail-il1-x12f.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630868937100001 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 9f9b380b137..905a5ffaffa 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.1 From nobody Sun May 5 09:24:31 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 164163022821914.406064905998505; Sat, 8 Jan 2022 00:23:48 -0800 (PST) Received: from localhost ([::1]:45514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n670t-0008T3-5M for importer@patchew.org; Sat, 08 Jan 2022 03:23:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ij-0005KT-Hy for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: from [2607:f8b0:4864:20::130] (port=46863 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 1n66Ie-0003QL-JH for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:07 -0500 Received: by mail-il1-x130.google.com with SMTP id e8so6449907ilm.13 for ; Fri, 07 Jan 2022 23:38:04 -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 w19sm613022iov.12.2022.01.07.23.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:02 -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=QN/OyRNbwAdj6xPxDJrAihNIR+PMKeuUplfT2MXdmUM=; b=8O6VOjnFOKYQzX5jZ+wOd6xyIva/UXdFJdBF2b5llYjBkIghXHGNf9eHtn6V0AlYci KNaLlxnDpM6WwgwlQHOpmuXU3NUo1jQ+y8gmPr35ro9wlGZutgEP6aX8vewTWik8mdiC 4fYDlie8LdcWPDUJg/w+80eRJvgu5VmQ9yMmDDwa8qGARfLUifVixPpzDjdomBEaM0NZ ZxYNecsihT6LMqf4WLnl1fmOUj3B9dy2LO0WKPii9BJyQ5AApEQXpvp+JIZ4DOjscpAN ovcfQsMIV7eIn/b2qBS24jbNHFUKMwKInWH/pWO9DG2kJgABv3Mv9u4QlTPvMbbAsM2Q Gj9Q== 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=QN/OyRNbwAdj6xPxDJrAihNIR+PMKeuUplfT2MXdmUM=; b=QctzkVgsQ4u1onMTYWjfNiZAu2QQlNtZJ2LjHJ2AZ23biyEWwiLSHfaS2oLZhb22/W kQDzdH3QQvJrkojFzk5YzN6jjLpxxSwDB67QOclDdxNtuWj6ZRaydPf8OEx7LbrYND0K 2mRMZMlgzAjtDb6xLOs6KmeOGrXpNV3cE0RxIkS7VxfpjV7C+uzKEAS0daeCWKYb/i37 b8QRAsShvwTwdHxqjxGxWRJnD0stBSXSCNG7GyPhBg9yMGqCVRerJPqX5ckwI9UEqSUA VbGw4Et1JoL+Kwt7FzwL3eSfwFZC3sRQmElvB4OnilONld1PPfLoORG7NlqCeEyj9Joe EsnA== X-Gm-Message-State: AOAM533bdZs/cERRXsbONN7BG1yZtCugi0WhSFQKhPJBaqV9L5RejGvL 0p9Hza5/X4gLAEdFr9Vata6P+82+TI8kQWKE X-Google-Smtp-Source: ABdhPJwuFjarcnJIgM6IrLqHg6ZySS20ql+s9h6nZxeJGIo+Vqd1FI6A/bOmWtCPUVRudMe4HeX08A== X-Received: by 2002:a92:cd87:: with SMTP id r7mr28826068ilb.182.1641627483251; Fri, 07 Jan 2022 23:38:03 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 21/37] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch Date: Sat, 8 Jan 2022 00:37:21 -0700 Message-Id: <20220108073737.5959-22-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630229964100001 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 905a5ffaffa..c675419c30a 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.1 From nobody Sun May 5 09:24:31 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 1641629994816162.6237441616796; Sat, 8 Jan 2022 00:19:54 -0800 (PST) Received: from localhost ([::1]:35756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n66x7-0001DI-P3 for importer@patchew.org; Sat, 08 Jan 2022 03:19:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Im-0005LH-6Q for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: from [2607:f8b0:4864:20::d29] (port=45618 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 1n66Ih-0003R2-OV for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:09 -0500 Received: by mail-io1-xd29.google.com with SMTP id i14so10074469ioj.12 for ; Fri, 07 Jan 2022 23:38:05 -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 w19sm613022iov.12.2022.01.07.23.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:04 -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=kmpxcPLnQajhynuO8Pi+Ynu8h8dKLSTDfwFItipGD6k=; b=JBUq/aEtFuzopJGGuqvG5nVcyM+CCO/a1tSDLc4/u2nKWvRU+GI5k/ZGwEzPEeWTPs EtLfypWV+/O2CcfU/ythfugzTGdpHLdlGjVKR5iSeBYVBcEx0ujpLc/expwJwSQgpu3v NAnN12aaaFikul3K2Gn5o8X2XQlLNl1eBQpKcGStNzRCfO4rxy4U9Ye/nz/qREb+uPW/ UdGfh0h9Da5nCaoKiDH7pAWc70eQXcA/sRiAas/fN1vIvYbO/KWy1sHomeShrWAie9FC h7hIDpZ4m+dvl0wjzNydvJJjk74lJsrmHTx55asc9wriE9bmuoTlLY7eeWNVTcUalL4P LJqA== 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=kmpxcPLnQajhynuO8Pi+Ynu8h8dKLSTDfwFItipGD6k=; b=NULKH1vIkU18SJZ/bIekNLG3CV+OGeaZz/73RtZclSJa26Osb472sAUi9+ieTCaj2k VnbP/jwcajuwfyYSWdQ7+KLGwIbgGPLHS29BIF0bU3hOJuEuKs7ACGpCD0VgN+1GRoGD yiwf4ElQT4MLP0/7AXZlcNzSHpx4gK+d1G9z4k/I497bvMLKZfNbEGpjTvVy4lbkGLGx 9d69Uh39pExJmZnNkWqQxYoP/+mNMRa6krADI4VBDuPsokD4l0EEGHyQWqWfcLeRNMcx eMzKIcteGY7LxQkCUrN+2UmDJeAikKlp9IgJplRIdYwbJXs7A2/GDOF+Kv2DiuoPrd2/ ntkg== X-Gm-Message-State: AOAM533J8OfEpb9BBLMRa91lmtVc9UvqFZuKOj971hjM+StB2REZ2p/8 emJBJD/Y7KTG7paaF/0WXDRVOqNm9P8wDaj+ X-Google-Smtp-Source: ABdhPJyCOlOnFxwM41u2um1Il7cD9Mld5o7qhxixFPqQe0+2dAxyb48UpfzwP4TUg0qaEVUoFKN0uA== X-Received: by 2002:a05:6602:24ce:: with SMTP id h14mr30800084ioe.87.1641627484456; Fri, 07 Jan 2022 23:38:04 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 22/37] bsd-user/arm/target_arch_reg.h: Implement core dump register copying Date: Sat, 8 Jan 2022 00:37:22 -0700 Message-Id: <20220108073737.5959-23-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641629996506100003 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 00000000000..ef5ed5154f1 --- /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.1 From nobody Sun May 5 09:24:31 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 1641630277164370.61266175938033; Sat, 8 Jan 2022 00:24:37 -0800 (PST) Received: from localhost ([::1]:47374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n671g-0001OW-5q for importer@patchew.org; Sat, 08 Jan 2022 03:24:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Im-0005M1-Nd for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: from [2607:f8b0:4864:20::d2e] (port=46621 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 1n66Ij-0003RI-AA for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:12 -0500 Received: by mail-io1-xd2e.google.com with SMTP id x6so10011319iol.13 for ; Fri, 07 Jan 2022 23:38:06 -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 w19sm613022iov.12.2022.01.07.23.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:05 -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=e+6KZ3Ysi4G9kovLQZe1VwbKNP6XCvJKHGf2d/pxlNg=; b=S74B33RGxxdx5+64KSHucUxj7FM/+N05Ggq9fSh9tehIoatMps7rhyObePqsgaGPOe 1B93NHWgL+4PWGVkTdhc7+mIsO1tcULHMxhYXsutGPDqmdQEKbWKXCD504v3qmHwj10a /edoskLRJExEcyvMI8EKISqGPY5r5itmElnVliYkhl1z9Pb1X2gNG2qBTPJlvIKq+Y5f VRUZsW5FFxw0V8eDgYD9yb+K0HWnjmO9KUyObQzJZUcswR/m8GkoJRNa5IEiIvXhB+h9 BwrOW16Y5vCCgr4JUb7xqnN0Ne5ArkbfYnFfAWPAYflJSjZQPJaFhkiyyv0iTwqob1uQ BJ0A== 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=e+6KZ3Ysi4G9kovLQZe1VwbKNP6XCvJKHGf2d/pxlNg=; b=VNkkxKUkFJnGszHD3tK9PhDIfogDYwXDU/cengU63NQ6ErUqoxwXRPvxNwP6OpVqln 5xK6fpTajhokG7z8nFUl/NChA3SHUkxuJRUFg0M3lNuYpJuZBI5lerlSMTSwqyKl08St jNymZLLsZiaemnvfBmil9GnXEEMGOEXgHVA/cyc2sR363+7vgjLWNBhoP1E8NWDP6trN gt4DYWjTkBEs/uBa3bRMmll3j+aPQEhh+kbt775Yex5kBkzrzFEPoDiLgwCKMwD0kyPz F5IuieXqVA1jkCXHfW5zQn5guPxhnaA8kOVl53s/zOynJH9+X8XAcYAGSVJN7A/Q5E/6 US8w== X-Gm-Message-State: AOAM533y8SOud0SIPi3ahELjn/oWvUiAE8xUackokiTlASB2dl1NKhbD klREWF0PQeCP4lZFpnKmBHxdRQ5Mht6CAfC5 X-Google-Smtp-Source: ABdhPJz3BX9BiqvSXZdegkOimtwJnAbOLOCs2Nb/OLu4Q/jD0M8EN/xnUQK3FucXmefm/n4t+wpNfA== X-Received: by 2002:a6b:fd19:: with SMTP id c25mr29752395ioi.49.1641627485812; Fri, 07 Jan 2022 23:38:05 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 23/37] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space Date: Sat, 8 Jan 2022 00:37:23 -0700 Message-Id: <20220108073737.5959-24-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630278189100001 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 00000000000..4bbc04ddf5b --- /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.1 From nobody Sun May 5 09:24:31 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 1641631122025825.5838542631691; Sat, 8 Jan 2022 00:38:42 -0800 (PST) Received: from localhost ([::1]:55272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67FI-0001UT-Us for importer@patchew.org; Sat, 08 Jan 2022 03:38:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Im-0005Lp-7T for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: from [2607:f8b0:4864:20::d35] (port=37516 helo=mail-io1-xd35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ij-0003RR-9z for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:11 -0500 Received: by mail-io1-xd35.google.com with SMTP id 19so10095141ioz.4 for ; Fri, 07 Jan 2022 23:38:07 -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 w19sm613022iov.12.2022.01.07.23.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:06 -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=A4XfzEfM8rJrMxLuwMhjGZH/tq7SaJNrwBDs3j79yAc=; b=ljo6GIKrZlqnMMGfGsbpJMTtYHWVbGhtedo4qoW9KQ0J2yfwuI14VZoCDNbuaUqz6J U84GjlOfqVDbvdlMWGLD30OVxsC5NRNK0fEdAGKPhplq53At06z4T8bLorPl7MAWoE4J e6mBZIL/ntbC0HqgZ67qUc8FUFeIXKkdHtZ6YwE90i5S4o+iLKSOjKIJOl0YY5j20KMU vdSlGXF70zEYM0uJuW5jhJ7FI1+tBdWaB3T8yhTLdUVKm8GXjo0l5xpvIjQk4uLEH/cJ zRcqjk3Fp+dDOzugVIxPh2ktMC0hNlyTSgWhsvCxFSX3pDupu3Q9qsCqNq3izWl6hyoP 9hww== 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=A4XfzEfM8rJrMxLuwMhjGZH/tq7SaJNrwBDs3j79yAc=; b=Z+jwgU9tOm0difHzhYigR4yMjLKdpV5QP24ExQWBkmDganzFm2UjGU8W+rYCPK3utv R/yxiVRj/1xkvCxROgieAaPIH/ngKiOoaMOYsslLlzDzGtx1OsSdZFgGnieinqWRfzxd kW8mpE24lcM25Gz5PDxHSARsS5Jnu/BIxaoYy90OmQxsTWz1p++p2uH1eMwUJJ6Qqk6K dvnkzukhUJnoV5pLAvsEGUxSqEcmMFhfH59hftqpVY0hGC2xS5BdY2cGLoPN9xc4bij7 Y+FNwpTPwkJbmsGCxYyeX/PkF7EoSq0UFGAiWa+NztjNBB87WCzmrRq7xvUMUOjVXZVK 1UDQ== X-Gm-Message-State: AOAM530wipneu0I8GpK9mfih1ZF/MI0RPzxVyxUNoofDihoFhno4ou/C izDTCzfdSlk0Bi8NiPSONeFX1MgBaVqAntef X-Google-Smtp-Source: ABdhPJx3gPBUj7hjKzX9R+yBS7KKQn4GTilsF7iS+vbSwGpBlugSshx/nG1/HHntjwIx3xWE5M2XpQ== X-Received: by 2002:a6b:ec16:: with SMTP id c22mr31027500ioh.214.1641627486753; Fri, 07 Jan 2022 23:38:06 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 24/37] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm Date: Sat, 8 Jan 2022 00:37:24 -0700 Message-Id: <20220108073737.5959-25-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d35 (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::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631124139100001 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 00000000000..5d434a9e7e8 --- /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.1 From nobody Sun May 5 09:24:31 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 1641630433707856.8156960264452; Sat, 8 Jan 2022 00:27:13 -0800 (PST) Received: from localhost ([::1]:56884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n674C-0007pu-MV for importer@patchew.org; Sat, 08 Jan 2022 03:27:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Im-0005M2-P9 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: from [2607:f8b0:4864:20::12d] (port=43823 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 1n66Ij-0003Rk-Bl for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:12 -0500 Received: by mail-il1-x12d.google.com with SMTP id d3so6453276ilr.10 for ; Fri, 07 Jan 2022 23:38:08 -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 w19sm613022iov.12.2022.01.07.23.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:07 -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=KGVENobWTliVhjD6oaRv6CJbcN7/F345/0QE+6WY50Y=; b=oGTYTEcBFq8VNRa1ExuztTPFimNszCTSguNMGFFjwpNfBolCAAHS8v8EqBl6wnf9yk I+/7lhn23lLTWgLtj0wsY0Khac2AW12M/2a0/JrB8PstkQVuvmTqe8CSQwdO+ETrMrj9 DwBWOBGA7dZz7EU9pjekak1jRm/doXacDzPzBeiHknCiWT6MnP3L0WQAZDpRzn0MynSb Q8x6OThecYbjXHx4UDLhGc56Lx4Q60kKS4AL1PZ5DX7NKzDBdVfUIdUHVgpPc6b950WW XhSwFHrNlBSgVYglIcszEDiwca3WaPNg5C/Sl83rS4KgW8uTlUbhZAPCUGbTGpqfx+Uu YmQA== 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=KGVENobWTliVhjD6oaRv6CJbcN7/F345/0QE+6WY50Y=; b=f4mRyL/D5gKf9fo8aLPnOGeU2OkLov+FT7cwGfjCT10ZIuch/3h7Hj9sYQhINKGooE SUTdsppahFSugCGuM4y1Hztmiyj6fk9uOXjkSRkosbphXQVkUuqQMzPEnYnwPlAihky4 Ank7fOGcWX7e6hq7l32vJAWI81DUqN523OJJFPhEjqoxGK4ggBMEkuVHk9GfNu54p5WK 9fnI0J7GfhRD8PXhLGQlKIgFDn3E4FAqDoz/asSiOK3Dy5B2qSLDseZbKDYakbEGg7Vl U5ZNkV7DH5uTyK3FBVubXgWUazonzOkIYzlyZNt+ubKAL3vLq4XVBy0ZJLMAs29SW/t5 TG6w== X-Gm-Message-State: AOAM531gqkSfQRqaBNwpfmxL9la/ZrPQWRGELSi/GwDOxnI0pDz5j92L 955LjaybmxTna129RrpZPgb0Sx7vf5CM0pdG X-Google-Smtp-Source: ABdhPJxVkOnz0FQDBGIM1MMsLmu+KFUxbGkkVo6tButwNpel7wNSIJ0lQXUL5jMLIfzrLWsvmSNDhA== X-Received: by 2002:a92:c681:: with SMTP id o1mr31718776ilg.23.1641627487695; Fri, 07 Jan 2022 23:38:07 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 25/37] bsd-user/arm/target_arch_thread.h: Routines to create and switch to a thread Date: Sat, 8 Jan 2022 00:37:25 -0700 Message-Id: <20220108073737.5959-26-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630435344100003 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 00000000000..11c7f765838 --- /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.1 From nobody Sun May 5 09:24:31 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 1641631345017475.2141051540085; Sat, 8 Jan 2022 00:42:25 -0800 (PST) Received: from localhost ([::1]:34620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67It-0006tm-SZ for importer@patchew.org; Sat, 08 Jan 2022 03:42:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Io-0005MR-1e for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: from [2607:f8b0:4864:20::d2a] (port=42722 helo=mail-io1-xd2a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Il-0003SS-5q for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:13 -0500 Received: by mail-io1-xd2a.google.com with SMTP id o7so10064060ioo.9 for ; Fri, 07 Jan 2022 23:38:09 -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 w19sm613022iov.12.2022.01.07.23.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:08 -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=sjaqpy92Qqb3sdMZ3pMivxUNnqWoJmC1P4NXVM3iJJ0=; b=wjbDNF5wCrK2G7xaZUgCegeMYo3quGu1UezlFzJXcWn5zF/OaW388Kq2USsWN89g4h afcpBEAS+rHLpIRp0Epojk4r8rmHgTICcd+pTJJkicvRa11WseJFhmukB5GJKPKqIfZP ZO3DSTd3LlxODvfWs/80OVgJ77yv+vzD3WxzfBYIBloGwePbiOeSjrw+6CSmNsRVh55y rR4SNMUCGlYsggK8gvUPqkFQcWAMybGq/wSBLlSUUzhKaWh8pFp0Od/6p7gUwG+i3blf hrHcOHyGo9oKYK/R6HoEyqa7o6hn9IV4864ZwmIp8XCRaEmYE8Jl1MrwV5s177FVTMca ssrA== 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=sjaqpy92Qqb3sdMZ3pMivxUNnqWoJmC1P4NXVM3iJJ0=; b=Ac87Gj+yD7Cdz4ZRt55Q28sUv9u2R96CcB37+PHFa+Dixw3H8wZrwgGVneN49/gu+g kLMu5SIuK369itA9CgJBaOpmvaEVcZg3bK67lSEjrVuXGk6ohBv6ml9ZCW/HR1Wic46O PulTrIxyQJbrhvWhEkM0nci95t/aLISFcdn/cK8fexby9PGLsJmzoEvJcgM7W9jgZ6MO V0c+g8OgopbaUmgJ9F6hhF7gCV5iK7GCtdQcOBonq/8SIJvGFxgCMSP2SuWeVPacB00w VrgUzztfkfS1w+H8s9Tzeh1nSLGG3HFsclr044qMiCdZfT/1EMvCNbjX2/ybhVOtBlwi fEqQ== X-Gm-Message-State: AOAM5326ybuORHMuMdqoTObqCVOrEBN7zm51UaKdaS+qmmlzUPMHobgZ rTiDPdUsWTaNmKWbhjuyvwIfyqecaTXL4DVW X-Google-Smtp-Source: ABdhPJzF61SpPoI8HzUsiS3nGUXqJp+KOQVOrBZJAF2/Cd6rGmfVsb6Z15L+GRiVNBXbfJJ9twbJpg== X-Received: by 2002:a5d:97c3:: with SMTP id k3mr31834006ios.191.1641627488893; Fri, 07 Jan 2022 23:38:08 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 26/37] bsd-user/arm/target_arch_elf.h: arm defines for ELF Date: Sat, 8 Jan 2022 00:37:26 -0700 Message-Id: <20220108073737.5959-27-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2a (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::d2a; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2a.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631345774100001 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 00000000000..15b5c66511f --- /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.1 From nobody Sun May 5 09:24:31 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 1641631127599452.62338473342425; Sat, 8 Jan 2022 00:38:47 -0800 (PST) Received: from localhost ([::1]:55778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67FO-0001pT-J2 for importer@patchew.org; Sat, 08 Jan 2022 03:38:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ip-0005NS-5j for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: from [2607:f8b0:4864:20::d2c] (port=36583 helo=mail-io1-xd2c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Il-0003Sf-Ty for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:14 -0500 Received: by mail-io1-xd2c.google.com with SMTP id p65so10131719iof.3 for ; Fri, 07 Jan 2022 23:38:10 -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 w19sm613022iov.12.2022.01.07.23.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38:09 -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=NGafu069XHHYypYBdA9I4L4GZtYRvDK9ebq4zTQT5yc=; b=3OYuVO4vi5T5ma2n302/zq3+/PyhsjpmA4hYm3zVcawmfhTgCr/nd+mr5BTHU6WxDB 1G+c1D8EyzupbWcla3ADfxRRMS1a7BjhedsZbnN8HWPCvGyDKPiHsm/FE4UI+sf6nZ5b ZUhQ+gnwS5F5mfPuDXZl28IT2GblcL9OwCqj7T5BIyvvwXtLOkQEwZxy/gRY60s8Wjr3 GeQUtQ/Z4bmFUgC6aArsKxPjV31ymxGHhT0r1j4bihLvIjThrLGUshO6GwHDq2zQNZOS SW5tkJCfh+fk2h8ONwJvJoVlJIakst8IQ/7IlMvgA+1yn3FKJj0S7Cnad163/MGJNdDl uzRg== 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=NGafu069XHHYypYBdA9I4L4GZtYRvDK9ebq4zTQT5yc=; b=uAbDqw9tCsSh8zLsV1RR7AX0iUlbC372LPVFTVSqEDsxNb5ehJIopdHvjsB6tN3vgx P0LRqyn2scw/u94vvXNmhS29i0xETb/QBrKSlMKC+SyquQ041B/OEdSZz4oDovDfjWQb P1o5MKTOsJtMuWHWHgxnwUlwvJIhuXLAw7QLC76mukvJPtQ/8/lVd+8iEQHU1Q73ekSf WspqcF+z7M2m68TmwmhmvK2xHcQKkJz6a27nevNn2lR+RLVbGYXBh8vpfm7GWIhbtvi8 8RiAvOUg58tEM4IcWXM3TItNe1QwzK1fcbS6M5gcQ+8mOWIzPKSDW8GSRZNebQtt9I8+ vJmg== X-Gm-Message-State: AOAM532S3CEGURoRDia6u4zsoxYsdiVRJfpO0kzbSDhRG+GSfaTB/otb Jls/Gdwiuzhygjz+Fy/v9YuDT3mBNcKmqhSx X-Google-Smtp-Source: ABdhPJzzEeX/ANNBDdKf7nSDwYlyni9OGifrHxbQ9XjBP9l/4YcB1RNQTMjLXLEhnqJZUfKFt5CcyQ== X-Received: by 2002:a05:6602:2e8f:: with SMTP id m15mr5544661iow.7.1641627489879; Fri, 07 Jan 2022 23:38:09 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 27/37] bsd-user/arm/target_arch_elf.h: arm get hwcap Date: Sat, 8 Jan 2022 00:37:27 -0700 Message-Id: <20220108073737.5959-28-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2c (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::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631128149100001 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 15b5c66511f..02d25b89264 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.1 From nobody Sun May 5 09:24:31 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 1641630856525211.84376319021442; Sat, 8 Jan 2022 00:34:16 -0800 (PST) Received: from localhost ([::1]:46226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67B1-0003TI-7q for importer@patchew.org; Sat, 08 Jan 2022 03:34:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ip-0005NR-55 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: from [2607:f8b0:4864:20::130] (port=38685 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 1n66Im-0003Sr-3f for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:14 -0500 Received: by mail-il1-x130.google.com with SMTP id x15so6494905ilc.5 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=C7KyPYzl/HUi0qh8zJoH8Xb7K1UuKIwCMgwQW4DXlog=; b=i/fE096/gEVdrerUB9NpQbfFIvjLJH1vlJ6TV+HYTMi8ThOmqGcNnoCxUJloGtS6PR 20IabUM/8xq1bm0gMlMBoWxTLC8MIgmrCXcIzFelrhONn7iDv95BBLX8OLiTs9HBotXW eKlWwg4UX6X/fpU9xcomSHmsam/dpqLLYGJj4smAYKBs3sBPasNKd2ALN93cDOTf03yA 9unoMK1LFU6pvPEPq5Y3VxH+VEoZSc90cdlynYzq/GlRIUwf1y9hO41g7+VvwlSF4FEC 0FIOmDD+VuYOfcypfADCvqowpSyJAxTmQ6vI57c/W7RTxOAcPZfPFFc6/jyE25LS8Q9B RNsA== 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=C7KyPYzl/HUi0qh8zJoH8Xb7K1UuKIwCMgwQW4DXlog=; b=bK1c9acNrCMcvas7AF1ErWRMsFfg7M4VK6DfjdalQ6ne0Mrfh7oyAjFOfW7Jg6W/2s bIvPBV4gcWlDkaiHPPZQSEK83ucGYwQtMLs+rIsWwFdbs4+h4f5Spz8e8BK0D2Wfr5QC RwoetPWCq3DMNkAAhd9+8fyDuUl4dVYUIQDOXxzZyFbhtYp8z689+DNNeVGAogqacyia zeyVu1ZBjwDrBm9PU4VVd4rOYkQ/wuzp68kQg8jriF3TMpeD90/QNITyEyqH2jgXjxL8 gT/BXQHmIFv38EJ+ZlwHuD6h0IG1dD4Ib3D6y7WAciCSzGbokPKAh+mZJiiAZk2ajzlv nFmA== X-Gm-Message-State: AOAM533jFs4wYIdu/3iRNbQNxJd+L+AukJp/Y/UaqiE7aD3gqkRZ2EV2 FEmhgbDApfYBLw6/PPuM8iViBN8wBirBJ7DT X-Google-Smtp-Source: ABdhPJy3uYWVZVYPYYF8+u7A/qPHfrZV7WRR8R9nhiYvqSw/MdpkwZhJQ6YIKpv9DggTNoLWhtYmyg== X-Received: by 2002:a05:6e02:5cd:: with SMTP id l13mr5735962ils.119.1641627490760; Fri, 07 Jan 2022 23:38:10 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 28/37] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl Date: Sat, 8 Jan 2022 00:37:28 -0700 Message-Id: <20220108073737.5959-29-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630858562100001 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 02d25b89264..4a0215d02ed 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.1 From nobody Sun May 5 09:24:31 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 1641631440622847.6690839894865; Sat, 8 Jan 2022 00:44:00 -0800 (PST) Received: from localhost ([::1]:37796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67KR-0000il-Gn for importer@patchew.org; Sat, 08 Jan 2022 03:43:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Iq-0005OY-5Q for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:16 -0500 Received: from [2607:f8b0:4864:20::d2c] (port=42724 helo=mail-io1-xd2c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Im-0003TZ-RQ for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:15 -0500 Received: by mail-io1-xd2c.google.com with SMTP id o7so10064155ioo.9 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=yq/esU6h8w+LdCkuWquK/eBiSLOcYx6Uh3QYevpdbXE=; b=Ux6bT1h+NL04vRBOs7InSf8TFeJqq3ydq5OuOHgvepvQRx5lu33u2sz7Nnt7yPGDsP rajaAKrjxdiIXVo0QjIQKjTYCIFljvW5pb4DpggOUtn6adcxNFz7Aqbn1BkBF7mz9PEt o0n59flxBZCm9hwGNzbs+EHSbKJcojP5hdU6mGKtYsNR2gXti+d8zyeVhq6xnX67Z9QF dFrxhWKukEu0673ihhwHTq5VnQejfKc6rqwVDT+yIpKloiRkPg1cTEAhwLyMCvsbAOZS rNkb/PdZZH47o2wd+kdGdxF7uT/yswgiXVq/Y4vh+sAgm7eCqOGfk0xdE9MQEdWQ54cz mz7Q== 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=yq/esU6h8w+LdCkuWquK/eBiSLOcYx6Uh3QYevpdbXE=; b=pzwW+ozYLG3Z65n2E2wExiD+oz9i3i9NgdAAJ7kuzw6vM7kH3PfWNcxmdwsGlEUhXP KcRHNVEFAx8YBaS/9n392BcCUM4QF9nwzR+1tVHGFKhHTgfi+1fiU+V4P/FGrDq9g7s6 MWoJoOpxMq18T85XL9IeFumhv9wfpLiLU8PsDrzt8qsRl8JxeaC7vsV8WFkmgxlsVfo9 OOHmd1JUbLDU4MmwwjW7sFik05dRvT0/xksTQdSJet+3+RlWNsHk/3eJeLq392/3siZu q714ZKFVmgy2aWyJj5RyTk0d67mO/NyAW/5pY1ciUB/f63+baFEHi+Z575EAcNUUAAw+ YHtA== X-Gm-Message-State: AOAM533LdqmBfDj0dZFk195udWtf6COpH7mVNdJNHbT1IRg8pKJjQyeG OsQ7ixNL6HM5t2ZoBuFZsEeiw5KPMD1PRby7 X-Google-Smtp-Source: ABdhPJzXh8VLD5aHqkgc1xExN0YZGjAUVb3zTkuvHPwAge662IExrA8FeGKJOf8gD8+uRM/NaSFAXg== X-Received: by 2002:a5e:9b07:: with SMTP id j7mr30935584iok.136.1641627491628; Fri, 07 Jan 2022 23:38:11 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 29/37] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack Date: Sat, 8 Jan 2022 00:37:29 -0700 Message-Id: <20220108073737.5959-30-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2c (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::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631442425100001 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 00000000000..973183d99ca --- /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.1 From nobody Sun May 5 09:24:31 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 16416304124281005.5702071012419; Sat, 8 Jan 2022 00:26:52 -0800 (PST) Received: from localhost ([::1]:55130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n673r-0006gi-FE for importer@patchew.org; Sat, 08 Jan 2022 03:26:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Iq-0005Qa-GB for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:16 -0500 Received: from [2607:f8b0:4864:20::d2e] (port=42726 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 1n66In-0003Tu-P5 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:16 -0500 Received: by mail-io1-xd2e.google.com with SMTP id o7so10064177ioo.9 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=VqBdes6F8m78x5lq8GFYwJEF8M0bPufEku2jPT9OAWE=; b=4LG6DS8ZUcLVBqLW2geNbebFOfJ8oMdGcbt2syJaHDCvy7UwPj1CX2LIWPdj+gaGAI pAIMv6vQshh+ErzIyqsEaUD9yalcFvBZzGoDG+UAz9rp0UZ9RjajM3mm8MaUukvUyzMA VUr56qDG69uYf0FGdRdaC4VlbK4LeivF61t0yPWuSBcEeovYu1kZcA0M04l990QQuvzC X+AJ5nouoQNfVH28XJZ7+O1eGNFPP0tOUX44BnT45CtVTrpItqmbA0Jt3XsRXXTOapHV h1d5Xjc3r9jsKgtF5pYDeJTBmksA6Vt/VkxegEnYubLakV5arxvRwHoDuqrtbJCQiH2Z JprQ== 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=VqBdes6F8m78x5lq8GFYwJEF8M0bPufEku2jPT9OAWE=; b=NKnE9u4U+JS+NNokVURzpFfQd94FE7pLhDuB3G/FyDPQ75dQMw5YOrdvv4hq/RpK78 JkiJPjpLirRU7cCg672KtcHJFZBczMrX/nFG40vyU9ikKpnl8OcIIkyWsZs6u09hQecO p0Pl6C3dbzFsi7VwjKc20l7iCZpY1vP96JLYCfhkw96qAz1UjSmiWz2IhpTZ3hbJpp0t fZz9fYLoJI1aZJEYgITMhEBBNJ+aWF2mXCpEuSWP4fGlsszZ9wf+lYi2s/UJk7l+wwDp C5EgHELpNDMDDeRjB0XdEXUxT/armZFSNMvjyAcsnBFFyO4RbvRTgeM4M+fIMBJvFSCZ FVcQ== X-Gm-Message-State: AOAM533nIWFOkcFejsZxhXg9Bk84EQeck/WNDksUl0jRGv9GsFedXM8W A/tO9MawafxgWgTQiz63lsRkalBTQ1zw8EmL X-Google-Smtp-Source: ABdhPJwfTK2fOtrAZfVhGRj0Juks3PlcXfjztFJJFCyEkNFEyaQriQV4Jc+LT6/UAu0mSqWUVZRUbw== X-Received: by 2002:a02:8813:: with SMTP id r19mr32242899jai.34.1641627492548; Fri, 07 Jan 2022 23:38:12 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 30/37] bsd-user/arm/target_arch_signal.h: arm machine context and trapframe for signals Date: Sat, 8 Jan 2022 00:37:30 -0700 Message-Id: <20220108073737.5959-31-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630413135100001 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 973183d99ca..9527335cc98 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.1 From nobody Sun May 5 09:24:31 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 1641631412920536.6741926617326; Sat, 8 Jan 2022 00:43:32 -0800 (PST) Received: from localhost ([::1]:36256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67Jx-00083F-U7 for importer@patchew.org; Sat, 08 Jan 2022 03:43:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Ir-0005TM-6g for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:18 -0500 Received: from [2607:f8b0:4864:20::d34] (port=43850 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 1n66Io-0003UY-MP for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:16 -0500 Received: by mail-io1-xd34.google.com with SMTP id l3so10038957iol.10 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=1ZeA73Y9C2GNlu6BEvq4LLEaMFz/sfyQRf5YDtwolg4=; b=jZM6Mj0QDMQVxxdjw+Z5QBwBwaOwuAnP5A9Hw6XS205QSw0WLkl3zsSH2m7Xouxtbk lfnBHcs4vzfNts3p4kyp0UeFFeC7wlz3GECP52UM5TWLXXfDlJWk5oLu0nFKFOReo6mi NllmxLjhDIBF/N9H+wM+RboUykm3MH1VqLxcduTjSHQxXdre8/f2XGwh5plv0paApEMY EwNqgyLWaU3sLo6vSdt9ppmlbOT6wbgrcPgfaBSy1lXOSpnTpFUUZcMmvkC2b9HDNk5f 857Cl/gcjJW6G2YyXOTuG5p+IiEcg4gppQ79uviHYjpk+JOD+hmOG8hWy5Gpukbxq4kg k4RA== 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=1ZeA73Y9C2GNlu6BEvq4LLEaMFz/sfyQRf5YDtwolg4=; b=2PhM48bHuGOCVIKE0KuvTRI21BqBGVSaJGdes0Bne0pRO2hucKSq68qbMpf6grnRmg zSjlqQPwGud7wi8jsRLI5QU+ELWLOdDQ0moYWzQJ+x8S3i4JUiFDn4Z/1y6KbdlKJPa0 ZNBUohjgVifp2D83zixaJ1EpWLVb8v7Pn315gzo26kZAgfVkeEHXG+hZSVS8ntNgZUJU zhHBD1KhnbjVUJu2cAcKR5bQ2eJjH1SZNS1eVCLsfjhHaXdBD0YwyWUTgaRnBJgCiySE 3fU1ZTRoyXNEgkolNbkrr73GOda5A767dWSW5JkPzR41YLOmQOLdGlFjY1caNGwjmCk/ LjjA== X-Gm-Message-State: AOAM533ffOsGNR9uMgl9bgc0N5z85Fk3qKHCBVHh20+B90yImF4V3gcv lIrusembCc6JNzCnhqN3NjxpvvLycncoc5Ro X-Google-Smtp-Source: ABdhPJz2ZCgSSnULsN3w7PH341XluADiNSZftSeYKPVKPgQS9t6c3FZwGaxFt+W/+G+fDbfGytSpGQ== X-Received: by 2002:a6b:6614:: with SMTP id a20mr6613636ioc.26.1641627493444; Fri, 07 Jan 2022 23:38:13 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 31/37] bsd-user/arm/target_arch_signal.h: Define size of *context_t Date: Sat, 8 Jan 2022 00:37:31 -0700 Message-Id: <20220108073737.5959-32-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631415388100001 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 9527335cc98..f1844dbf225 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.1 From nobody Sun May 5 09:24:31 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 1641630566216818.2672911435476; Sat, 8 Jan 2022 00:29:26 -0800 (PST) Received: from localhost ([::1]:36418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n676L-0004gC-1V for importer@patchew.org; Sat, 08 Jan 2022 03:29:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Is-0005Tl-6W for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:19 -0500 Received: from [2607:f8b0:4864:20::12a] (port=39660 helo=mail-il1-x12a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ip-0003Uo-Lp for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:17 -0500 Received: by mail-il1-x12a.google.com with SMTP id o1so6333081ilo.6 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=6Tbj1RmkZBzQdNFdHL2tew5V0kLNAuFym+h5lDLGqms=; b=WhELXPmxDVTzpR5TGLSMd4L2qaQkeImklEW7v9bUfNR37+ve0eKhd6GiZjZWnHsPXF OGaBBnXLdo5+umw+WMf48ATI+8H7RYot+AsNuZbrfoOE9Z7m6b2GjkeJU/X8n9xOIlxh LcpuGNG+DrF3bHnTA8XbXYXpIyZ3nSxZ3+fk/wgSaiOQFXcIsV3cti7YYCNQvCdTsVhL 8THKRIO7WPoZtNftKhS+aOhujhXUmzNQ8PhNzQi0vL/zD9fhIDn+iNyYc+ZSfzHOatiM qEjEwuz7U0dXgFO0kSLSaNHpBoyvZ6duK/0NN2ri6YH8iI35Awtt8pcTD8bN3yeKS2KI VP/Q== 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=6Tbj1RmkZBzQdNFdHL2tew5V0kLNAuFym+h5lDLGqms=; b=baHDe0wH3IMRR8p6zjfExBMGAMX3NPOE+3ep4vJmR7nWaZ2MD1CRbd1912SPDHLn7Z oaIGvkDA1/wSwPZW/EtCcuurPj2CxYjI5187X/BXP97YPkvW6rYGEzEzr+RLBmOG0lCS Ybtd/OMirSk+r/Arwijwsel3/dnW3cUG3CJCuCGSNEOz22XjGm3M0/An6yysPtS6oVuG 2L/4Kzal2aALdE2N2ceioiAoeTDWbeIC80D7GadpCw23MSXeo/9WKpCKpeLTARMbVH04 ojKJd5cmAlrxcyg1a49jTGab4fL2U+OUcP947AI32EAMS7AlzLfKlR5zDG+axMMlWgDf hiHw== X-Gm-Message-State: AOAM530YMi2vfutINhsgGAokgVtEILTNt7p+MHYi01QMXAIMWIWGtwHu noN4XJ9DxzlboRmuaGJpir0p39+XAu+nd+b2 X-Google-Smtp-Source: ABdhPJza8BXEKY4YkjRdXPXdXHzpaBDkxsbJ6ye/76HNaZ11BRTfX22/MzAA2anbW+xy0W17F77f5Q== X-Received: by 2002:a05:6e02:1ba6:: with SMTP id n6mr32992516ili.296.1641627494351; Fri, 07 Jan 2022 23:38:14 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 32/37] bsd-user/arm/signal.c: arm set_sigtramp_args Date: Sat, 8 Jan 2022 00:37:32 -0700 Message-Id: <20220108073737.5959-33-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::12a (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::12a; envelope-from=imp@bsdimp.com; helo=mail-il1-x12a.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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630568345100001 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 00000000000..3c0db30a85e --- /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.1 From nobody Sun May 5 09:24:31 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 1641630823258501.18373897018637; Sat, 8 Jan 2022 00:33:43 -0800 (PST) Received: from localhost ([::1]:45232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67AU-0002mD-5R for importer@patchew.org; Sat, 08 Jan 2022 03:33:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Is-0005Tn-Rc for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:19 -0500 Received: from [2607:f8b0:4864:20::d2c] (port=38513 helo=mail-io1-xd2c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Iq-0003VI-V3 for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:18 -0500 Received: by mail-io1-xd2c.google.com with SMTP id u8so10107361iol.5 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=siiQROmFkgoyoci8mg+ev58BNz0SLHU/+j4/Xsy7h34=; b=o6Wthbmf9+gsuhvkJSA4DXYAhvjS7ynqhw6hv6P1PHN1GxKlqx21CB2GkxqAxGexMm uOlkjS2rHNI4FdMMmepBmeODOPDGyC0+r5kqlo7YzLqW/rlAJHb548Qa3tailb/AOWx8 9Io0HRUHlfQHvENLvjxklBXyDG4YWhFVUhaChU2CDOLWF6GtwQQQ7seC8OzqF3CnLWZD 8odHNispijxADcQTtFONsXph+FU5GD+DIBn//yjKM82uBxgN8R5CZJaM6w7RS3Nny8aS QPPjt7Tf0BsFBhcexJAtJnUNFipsIdX3SJRK0cnXMSSaDzJWZjjcDaBYdhAk/8G3XDEf O1Rw== 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=siiQROmFkgoyoci8mg+ev58BNz0SLHU/+j4/Xsy7h34=; b=z3apfUWI0RWodLHHkiD3bTtUCuTVC3kSdZtbNQXxNkhqraOayBUi0MfdiDsHFK3rDn rdZrUVIWUF+9+y0lgTVriPqah6je+OWBXAGUcu5bMHNddJPI3TWpjmy7e48+TxhY00nf bwiw99UoUL3ADuG8NnA4xGrJsheilMBNrPuRfmEHr9gwOZto6SUfDWO9JRqZ4pp6/kB9 /69GlJnanNCuGoa2LznwlPxdx2sOWfKaP+hmoYugwouCFsAv3PhFSG7mxaMelWTS77GO paS2njS2A/cg3wyudg8BGhzDBLdW7RCMO9KErkItZm9ptMWxrOGn17Z5end9DH7EwR36 xcrw== X-Gm-Message-State: AOAM5309TMivAJ30keORe74FiFRbdOKDwyZCagropL4nZmTwsxF+qoKX 7+uXTSu1ITwEbXbtYIM0HXTROZ1DETmYCKSq X-Google-Smtp-Source: ABdhPJx93hmzAsdzhG/Tc6Kq1VwakhGEGSKTT/qw8EBaC1MN/TdmucVhZmzbUS3npWOGb4ws6q50Ig== X-Received: by 2002:a05:6638:2688:: with SMTP id o8mr30059038jat.118.1641627495227; Fri, 07 Jan 2022 23:38:15 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 33/37] bsd-user/arm/signal.c: arm get_mcontext Date: Sat, 8 Jan 2022 00:37:33 -0700 Message-Id: <20220108073737.5959-34-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d2c (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::d2c; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2c.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630824560100001 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 3c0db30a85e..93c9bfc0d37 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.1 From nobody Sun May 5 09:24:31 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 164163175486989.55355818225507; Sat, 8 Jan 2022 00:49:14 -0800 (PST) Received: from localhost ([::1]:45920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67PV-0006x2-GF for importer@patchew.org; Sat, 08 Jan 2022 03:49:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66It-0005Tp-SV for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:19 -0500 Received: from [2607:f8b0:4864:20::d30] (port=40607 helo=mail-io1-xd30.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n66Ir-0003Vw-Tk for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:19 -0500 Received: by mail-io1-xd30.google.com with SMTP id q5so10092729ioj.7 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=xVAeEhWfPUcbULInn573PJBxHu7QnmbFB7C8wstKchQ=; b=ad1ljQig2DoGzbg0U9BOdq8ltQ2YNp541/0boMK5ZnMN804GFAQ8cWQxRDiErRiIr/ PqGSX+vM4FgXibcAgMwqeliPfZ/UWM/kx7zUSZKjnn0yMWMVDC4khv8kPY+kBJy5ZXkp GqJmsO/hcAM6KxPZyi/sgqJVUJxYw0h62qcsMGgbZ7+HfYxB6H5H1rKwrnOCGTDtyGW8 Wx7pzbYdedRwTtI/zlszV+7e5oxXJ+ygwIUTIv0iLzafpJ7hnq9LudpymNnpBrD9Ha1M sdhUFygSn5GQqVVT4tYgRGNwjchsgIbLdXcGn4/OecCFuwVLHHLfT7TgxoODjbUAC5zn 9PHw== 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=xVAeEhWfPUcbULInn573PJBxHu7QnmbFB7C8wstKchQ=; b=kOs36YpCuL2ZDlay+kd1Aa+Vy64CZpndtCZaQZgogz2gZlRlcv5veecmy1NiQV9r7m A4vr8Dq9/oYlSgPXvuAB+RPbQecoYNH2Qve4tEY5T0Bmt/+WLSoDJQC4Nykr/ftCcid7 foh7t4il2z2WK66akNkEX1wK0trN3sYlROg5a+7vFAeN/ug0FJ0BBo7q3iWHhqBncHLH 8dNxF4YSyHDT3Dw1uz15QQ8NZp5LmmlCKPoqw1wly51Q7QQ1CFt5xGfZCyzzmjejElF8 rqnsoESarSGx/UgfNLfGOkCi3axPYy4E2dykheC71wAQIYIAnNbMT0JqDsYHQiFa7Mhx jf3Q== X-Gm-Message-State: AOAM531p0L30U2okHR2U771tamI8un6fZ5/vVNgUsaD8tQk+zD6BrTav k/rlwfFWQaYFmVZJVGqCsziAuFEt2C37UAnU X-Google-Smtp-Source: ABdhPJzARJozL5Pp11oO2PvzUYPf7Ti5WesGVYzDbFOtu+8XS7WcKyarsIIXulK1Qn3tapHTH2xa2Q== X-Received: by 2002:a02:ba8b:: with SMTP id g11mr30459453jao.20.1641627496074; Fri, 07 Jan 2022 23:38:16 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 34/37] bsd-user/arm/signal.c: arm set_mcontext Date: Sat, 8 Jan 2022 00:37:34 -0700 Message-Id: <20220108073737.5959-35-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::d30 (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::d30; envelope-from=imp@bsdimp.com; helo=mail-io1-xd30.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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631756628100001 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 93c9bfc0d37..fb6228db6cf 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.1 From nobody Sun May 5 09:24:31 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 1641631086775470.7578680351197; Sat, 8 Jan 2022 00:38:06 -0800 (PST) Received: from localhost ([::1]:53848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67Ej-0000IR-Hq for importer@patchew.org; Sat, 08 Jan 2022 03:38:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66It-0005Ua-WE for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:21 -0500 Received: from [2607:f8b0:4864:20::d34] (port=37516 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 1n66Is-0003WQ-Bz for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:19 -0500 Received: by mail-io1-xd34.google.com with SMTP id 19so10095422ioz.4 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=yTd5grbll1DlbzNLFo371dzmeKkoGihsZlNwerjeO8o=; b=uFRKi/yRihKMcKylTf3snOhrn3coz/uZ+yzZOqjjSCVYbbfK3vB+ixcFXRjHszEmvd DOMTxo/LVibyDqgxsoDFCe4yNzLIfrtxjMhjJHb/k/yNnXlFvX+koV7ex7XXNtYCN1np GgvUpVSlY7z/4lnXG/OUgzLxphZRnypeQtK3YA/+7nZSwdSn2yrr9r5hBaDqAYcMAU+w xVvMw8N3Hv3FlkEOlWLKqtcxS+2jd3Xm1PNWZ3wtJ0Vux/+qpawWaTFrXDFp/7XFHZSm CL6JmDiU41B5CGrBZaGijFubrbpHkuupWIToQuTuMr3GBzAIC7vqYvxl0EYOz4NLrUEx iBhA== 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=yTd5grbll1DlbzNLFo371dzmeKkoGihsZlNwerjeO8o=; b=ze0/4zEBYE149kUzqsbPYtspemZMlBoiKSOiKgF1W/QLWBGbY25fqr5gq7Q0MKXYwd jb3dnWgq8q1TvKcw5+L/MbBiJyWmhfW/cicCuKj8NiROvrla5JA2RhkK4p6uOEYGvPKB d0T+jk/Es5IOOs4PcNZioLPMSp1HTL8Nsl/fmPu6BjwFOk8/UxXDRbCHA2bm986ioNzQ DYwuS39XUesYxJzSqNyPGEXMDPB5aLu/jFrN0rffJmFL2QUiWwKckO/ub2nBj/+J35Kf oYargYq/qIH8I1Q/PyZ/XfMPfNE6QwrxJUNrZIX83IcfqCvV9SGH/pGVaXa/kHW6Hu2b zI8A== X-Gm-Message-State: AOAM533BkT15T850qh//0GrssdD+WSTBdiuItZ9dJi//afrkUsUAnfGn BUtHymDqBTV3Nc4My4rYFrt4UViy1CFboIKc X-Google-Smtp-Source: ABdhPJzcvhM2FMMEByQkg2/JWYE/qshVJvApRwMl4oNEs/57gKOVoqAnc5lallBo2MKGw7WzxkQKeA== X-Received: by 2002:a6b:1496:: with SMTP id 144mr6261573iou.119.1641627497083; Fri, 07 Jan 2022 23:38:17 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 35/37] bsd-user/arm/signal.c: arm get_ucontext_sigreturn Date: Sat, 8 Jan 2022 00:37:35 -0700 Message-Id: <20220108073737.5959-36-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631088208100001 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 fb6228db6cf..1478f008d13 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.1 From nobody Sun May 5 09:24:31 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 1641630764454684.8566463931671; Sat, 8 Jan 2022 00:32:44 -0800 (PST) Received: from localhost ([::1]:42756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n679W-00012x-GX for importer@patchew.org; Sat, 08 Jan 2022 03:32:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Iu-0005VZ-UG for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:21 -0500 Received: from [2607:f8b0:4864:20::d33] (port=40610 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 1n66It-0003Wl-In for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:20 -0500 Received: by mail-io1-xd33.google.com with SMTP id q5so10092783ioj.7 for ; Fri, 07 Jan 2022 23:38: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 w19sm613022iov.12.2022.01.07.23.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=zYfRV6dnf6d+zAIFlxvvp/6sxyAwR3ew/6aIDkWKGyA=; b=DmGcah70KXaUCMaNvepb0vXbtdz0FsDVaFoK3DxxNu0CawLQKkB6jXljWQnYwY35Y3 BUI+h4CrYthOdiVYcBo0T3dwxaD7O0bB/THFi0fQUW+atoa60gkwL4iKk02R6pGI/YrP nkdV+U3LusIeSx6jJd+ryWDTqI0lt0Ph5+mMeBZKok9LC5OR01TR+I/t/klPoTE4IqYL n4ctyIoU4qnqpNd2aQa6bvknyxVMP+hFyQvQLVRv0N7aobJfIJ0URenHNaE6KTKSggQS /xr7scqCsXVB4RxjCh566SINZhPqbev69LrW0lchuvtz1wLwW3uIilQqiezv4m/EEDA4 OSjg== 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=zYfRV6dnf6d+zAIFlxvvp/6sxyAwR3ew/6aIDkWKGyA=; b=hPQIlZDqkdqi61mls75Sm/4Ic+ZdHwdshC9USB1pP2Iyb7kWSw6ZJl9V75zZ5bL48R fYybDnltZ7EpuDsfMS0M9dvLWe/hzxHUqQJS7hmex5LKlZBBiyy4NT/inx1Iqo4W4ezv OaUPyILmbztLRjOKihkvKyjOnjTir+GlqeuUo15cmVY6rHZTQWZOv4wX2nJnteRqOfpC xqFqmWV2VHI947CRJYceLGlFN/s4tVa+RPzDV0SF3WSvgsiE2E9p431hDA8XKb8lM0Bd AwPfs1xL6URB7AU5Z3ylTW+oGUYot93DyXNggTLyTXfUES3D1XkSD6jSTtmSWktVdPDB BKqQ== X-Gm-Message-State: AOAM533eNKKHa68z5kxarZ8zhz5Bpf6Td2HXulEwLc9Lu1WbS3cIn0l7 OACQ11fmvgy15VfB9upwYYzacF9wD+hLsSaO X-Google-Smtp-Source: ABdhPJwl2buk8ATQk86GdhbbCHAe3AfusOFMNZx5AB325hJ5oLzWTvSIh4ckif8uIf8Psb6/UGsuVQ== X-Received: by 2002:a05:6638:3009:: with SMTP id r9mr30896197jak.261.1641627498002; Fri, 07 Jan 2022 23:38:18 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 36/37] bsd-user/freebsd/target_os_ucontext.h: Require TARGET_*CONTEXT_SIZE Date: Sat, 8 Jan 2022 00:37:36 -0700 Message-Id: <20220108073737.5959-37-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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::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, 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, kevans@freebsd.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641630765912100001 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 dd61aec7cce..41b28b2c150 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.1 From nobody Sun May 5 09:24:31 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 1641631948969654.2659645151354; Sat, 8 Jan 2022 00:52:28 -0800 (PST) Received: from localhost ([::1]:52634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67Sd-0004Ri-Rj for importer@patchew.org; Sat, 08 Jan 2022 03:52:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n66Iv-0005Vc-OP for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:21 -0500 Received: from [2607:f8b0:4864:20::d36] (port=35711 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 1n66Iu-0003X3-4b for qemu-devel@nongnu.org; Sat, 08 Jan 2022 02:38:21 -0500 Received: by mail-io1-xd36.google.com with SMTP id y70so10125472iof.2 for ; Fri, 07 Jan 2022 23:38:19 -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 w19sm613022iov.12.2022.01.07.23.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 23:38: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=GioDY4nXC7yuWDiwWaq62PITdulW8xkFyjlazyzw9XU=; b=rru1w7eBKWXhreoaZEqlbA2dTXFPSQu7FWyAFtG/VLg24WKVmc99AnOf9V5ECAzR62 Xi6DUVqAGddIQMW5ccms5NP45ZfF3UbLTtfHHn8vKfjGwqCheJmgb7SR+po7PbRbww2J gIDUbxfqhuHv1/fy7AoXYSy/q2fUp9vD7XD5aM3/UknDISpTqO7xAkUO9pSu+9h2idvh 4NBIFOwhHt+W4mU/oW8of3hD+xUXWgDv1FCYX3xgXe1k1GGNm5R6Y0YRGWeoXoRw5Osq RATbSx4NmmuoLjIklY4gdh1Hdn9h780oMn3GLCiur7nNhd5/7Sratpyrg0iYLEspZs3s 7UqQ== 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=GioDY4nXC7yuWDiwWaq62PITdulW8xkFyjlazyzw9XU=; b=IRD9xfZOjn1zu0TTXnnWcup6CG3975x3qu8IHuPkuTbktdkzBaGMBXRuyxQwAzn+j7 eS1lOpuJMSnqrmXDPxctlmErXrfy4HkS0vuoOz1s2k/p5+QQoOvGnak1lZBrY5/4al8P 30yZxzkOHh7CFDVCqf0jg75mkDZ/jXuv80UhwRYmrTuT02PwMkxfVk4sS8TSTyEI8Gjg NJrDUkjjCIeMeg4ijxzAGU5cwlrkmezDkSHv26V7Ss8Ji7GCUwXygU5XTwMorSFzwZDy x+uLU5WMjllkbjzQQWhIqdL1RLd+wBjBEnU9gUPuA+iVGnefiDDo14SUcfQlljU2pSp0 6WHA== X-Gm-Message-State: AOAM532tOSMJfI3p7yN87F40LQvoVMeuoWJX5BXhAPT4go/5IKVDfapA f9tCPLJvcFH5JcFXIFcdFPMlSvoRfjfsAiQE X-Google-Smtp-Source: ABdhPJxwXYe89r2T56E7Y97q3T/NDImQxG2h2OBNPyBAfjyxwzf/8hRtLzs6QprWhiyN4eUnxJDsSg== X-Received: by 2002:a02:ca02:: with SMTP id i2mr32443596jak.42.1641627498884; Fri, 07 Jan 2022 23:38:18 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PULL 37/37] bsd-user: add arm target build Date: Sat, 8 Jan 2022 00:37:37 -0700 Message-Id: <20220108073737.5959-38-imp@bsdimp.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220108073737.5959-1-imp@bsdimp.com> References: <20220108073737.5959-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, 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , 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: 1641631950025100001 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 00000000000..cb143e6426a --- /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.1