From patchwork Thu Nov 4 14:05:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A096C433EF for ; Thu, 4 Nov 2021 14:11:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C60EC60F70 for ; Thu, 4 Nov 2021 14:11:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C60EC60F70 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:36596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midSV-0007Fi-Sw for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:11:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNc-0006Lr-7Q for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:12 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:46934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNY-0000wG-TT for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:11 -0400 Received: by mail-io1-xd2e.google.com with SMTP id i79so6687218ioa.13 for ; Thu, 04 Nov 2021 07:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0zcqxxx9i9efPGyMNGiYlMMaZ7Z90otmzxtyKTD4u1s=; b=NlQCfHimpk4aRPZKtWg75SM4pU74fxKpE1YdbDXod+PaLCD+tpb0e20wDNXFz9jvE3 KjZnTs+nrbtD5ubmdxvJlwcRVBN9YhdVoD5gMYMCl8ThnX2tf/dkk/8aRyr0UbiD9JSC 0WpibltrrJ5D4izcP1Jwoc4aQf6vETXFsw8Ad4qXDx67ste7U3Ub+CkHf5z3EwQD+EsM nAJTszFfujH8yE/YUaDzWZggz3WOwBnoRE/zee/qVqe5z5duhyYBzaqMhuLz1eS/7cF4 9fFfva5wfw9HNVrGPuJIiS+Fgh9YtLfl9ki15rXqsDzXWjshzT8gUraN76kdiWKEszSy h19A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0zcqxxx9i9efPGyMNGiYlMMaZ7Z90otmzxtyKTD4u1s=; b=X/62+9lMwewnXi3m/zVnZf0fLaCuO/yvCOXfPv2lX/cHKmVwz2PH01x0Ysk7f2yQff qljEwT1XzNkzuFDtDtjoE4nNG1B9XWrlLcOoKi45mce4vaIgaE99w1zK3gFIUdB8uHRa +fAb0caaqpxKiRbUn78Cosqx7K0DHthsmpGGB+SslObv4PhYmtFgPfKEKurcLr/Wv0J1 TltaNDlM5OwfdsDjjthCz8ZimaCAO/8fNDrxpVG3YGAAuYq/qJ5pmCesSAyo0GZZK26m W8agJpcOM5heakhy3y6wZE9tIvHwLodTTWjmX8G/46rD1dCezA2SB5uKEMdvxY3hjnwa kIIA== X-Gm-Message-State: AOAM531b1zHDO6x+tbLodvoiWO9cVt0aGVbnGVFA1kkgqmbV3FTQhK+o ZWJg6iTgVoyRqDg6fxF1EwNOQYDugItiCA== X-Google-Smtp-Source: ABdhPJw1e5LIrGAGhh2JX7DCH7hfx9brPOjWjBxTdjophY2zoJRquf7dLTO2N86ERG3XwktZbDBPIw== X-Received: by 2002:a05:6602:1242:: with SMTP id o2mr25611695iou.183.1636034767111; Thu, 04 Nov 2021 07:06:07 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:06 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 01/29] bsd-user/arm/target_arch_sysarch.h: Use consistent include guards Date: Thu, 4 Nov 2021 08:05:08 -0600 Message-Id: <20211104140536.42573-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As part of upstreaming, the include guards have been made more consistent. Update this file to use the new guards. Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_sysarch.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsd-user/arm/target_arch_sysarch.h b/bsd-user/arm/target_arch_sysarch.h index 632a5cd453..8cc6bff207 100644 --- a/bsd-user/arm/target_arch_sysarch.h +++ b/bsd-user/arm/target_arch_sysarch.h @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef BSD_USER_ARCH_SYSARCH_H_ -#define BSD_USER_ARCH_SYSARCH_H_ +#ifndef _TARGET_ARCH_SYSARCH_H_ +#define _TARGET_ARCH_SYSARCH_H_ #include "target_syscall.h" #include "target_arch.h" @@ -75,4 +75,4 @@ static inline void do_freebsd_arch_print_sysarch( } } -#endif /*!BSD_USER_ARCH_SYSARCH_H_ */ +#endif /*!_TARGET_ARCH_SYSARCH_H_ */ From patchwork Thu Nov 4 14:05:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F280C433EF for ; Thu, 4 Nov 2021 14:08:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 245D5610FD for ; Thu, 4 Nov 2021 14:08:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 245D5610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midQ9-0002oS-94 for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:08:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNe-0006OK-03 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:14 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:40861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNa-0000wW-0n for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:13 -0400 Received: by mail-io1-xd32.google.com with SMTP id d70so6053156iof.7 for ; Thu, 04 Nov 2021 07:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5K9w6Dgj9bW+v4mINR6IMzovYCKqh6rwlm+KG2b5Ybg=; b=Fht7BRK1sFf0xIRTby7u61RJ4guM3kfj7y1SZfgUyGSfV55eiRhbB5vQq+pu2F9W99 lDCy4Jg2asRvBOo0EoVIL25Ydi7LOin1BfycgScomANuR/vfTtqz6eaAYSkjteGfizXT 6cMhTngWOPvFEjBsIRRPk2smVWfNibStHVkW6a5/6aK6tr4Oxjho9LjMR0euYbSSulPg xdb0WKYlYn9f9GhZSsgNP8OtQcFwp03KM8gN23dspLYnEj6MSoNpLNQdLa2O26OMUeez g4gSL012s4rw5fTWY+ScESo552A5sJr3PY5MmQMhSGA8muWH3zklrRo0AObySxNyQBwg vVZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5K9w6Dgj9bW+v4mINR6IMzovYCKqh6rwlm+KG2b5Ybg=; b=xRKw2iV2ZRwWiR/3N6EzUQE9kbGXpV8ga8dQlGATSJqzKc6w0Kx+/TfhaA5CcT20cH gAL6oDLbzBHTonli7opFLsB4MRM4L594PYYkqFvuJrMxLhWOpZDoWeJxIGK2KWI0YKnU DRbHAhIVyGbx0fXc8x0uKMsgjkpBUyP2WCf3WWPBhR14O1w8kGpC+WE6kWtEFncOjm0v XS8uqbnAYHnesnmuz213JOlK6Q9vqzJqLWERChHGuYZPSHf0r84cZh0ZQeEnN9IMHcwn QvCC3p96b2WrflGR+rHzAP+QbdZWKZnkapyESi/zasLcr/N1OwujlMFztbr5BTXCzUk7 jcgA== X-Gm-Message-State: AOAM533pFNkKJ3Vfmd9h8BNh3wvjXFKMZX6ChbMBtFrqlfjgcTOxqzgk JLUk++bSUyhTlr54vuKUtOY89NtsOkk7Nw== X-Google-Smtp-Source: ABdhPJzUNanoZa8JdJ1wjQF/CKoXWYtskUqV5yBT+TYWNYWY1awD72TBgasMptS1DELE63XgTSyv5g== X-Received: by 2002:a05:6638:348e:: with SMTP id t14mr3885547jal.145.1636034768458; Thu, 04 Nov 2021 07:06:08 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:07 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 02/29] bsd-user/arm/target_syscall.h: Add copyright and update name Date: Thu, 4 Nov 2021 08:05:09 -0600 Message-Id: <20211104140536.42573-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The preferred name for the 32-bit arm is now armv7. Update the name to reflect that. In addition, add Stacey's copyright to this file and update the include guards to the new convention. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_syscall.h | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/bsd-user/arm/target_syscall.h b/bsd-user/arm/target_syscall.h index ef4b37f017..a5f2bb4e01 100644 --- a/bsd-user/arm/target_syscall.h +++ b/bsd-user/arm/target_syscall.h @@ -1,5 +1,24 @@ -#ifndef BSD_USER_ARCH_SYSCALL_H_ -#define BSD_USER_ARCH_SYSCALL_H_ +/* + * arm cpu system call stubs + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_SYSCALL_H_ +#define _TARGET_ARCH_SYSCALL_H_ struct target_pt_regs { abi_long uregs[17]; @@ -31,6 +50,6 @@ struct target_pt_regs { #define TARGET_FREEBSD_ARM_GET_TP 3 #define TARGET_HW_MACHINE "arm" -#define TARGET_HW_MACHINE_ARCH "armv6" +#define TARGET_HW_MACHINE_ARCH "armv7" -#endif /* !BSD_USER_ARCH_SYSCALL_H_ */ +#endif /* !_TARGET_ARCH_SYSCALL_H_ */ From patchwork Thu Nov 4 14:05:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF66C433EF for ; Thu, 4 Nov 2021 14:08:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E3E6E610FD for ; Thu, 4 Nov 2021 14:08:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E3E6E610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midPZ-0001CO-VP for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:08:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNe-0006OL-0W for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:14 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:36733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNa-0000wh-SE for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:13 -0400 Received: by mail-io1-xd32.google.com with SMTP id e144so7021335iof.3 for ; Thu, 04 Nov 2021 07:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3XmuKD3L8C0RdT+vaSED8BhWG5EV9OjA2AgZ0ahq8Uw=; b=iYbZOCjmBOTRuGfgtTMGw/lFkauFMLI5K9hxVRuShg+0GWVWfOTThjGc3ErYiQBkGd KrfreuickrMOz7O+FpyvKJRX8Q1SQ2s0Mk4JmWTSaQYgsK5CAQ+Pxy9GCLjpOnGQKEU+ EvBF2jHpDeIuEvhwV/ITqguGog/gBspwrvgQzpwvpqMNIJELeGrn7giWnnb6pnLKlMpW 30NCP5o7EeTkxvHizqmi0/ZBaF2lXRGxnO/fserypFc9L9HzdoJgvNwOTS51amLoMKA+ eRRHiKT9BR1vp6vRRsPTuMKW+s3Y2JNLSHLKv5zIgfUzZP/1nEPK6fsGFs4pA4rtLxBA rMMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3XmuKD3L8C0RdT+vaSED8BhWG5EV9OjA2AgZ0ahq8Uw=; b=Fn2CAA+FD++Iou6A1KBAbIaYtpefv+YEhnOoKCATZCr0mVLRSxAEivKfn8vvyaco3J TwJbFMs9g/QxpRnew2WnJWZgK2j5SeVfphBKNtMBtkpVdTSnSSgIXx61aD+roQ/FvZhY mdy/leKfhUwzb1QBsc9ShLsPrapc3JcON3hf/DRlgrqbL7ZCIXw+Nwc1peo0Kw+bL13e IcL60r5tdSSaJ+ERazlnf9Y3whY9+dkSNFUYSVOyue85CpXf1WkS0HoiGeDhH7PYVabM x+QXBh+ppHxTFcCW5uktM9O353X15IycHO9GyQ/hEMI+I+9VdD+TUEL5+7YtT9wEkfZ6 5cQw== X-Gm-Message-State: AOAM533nI2uxlOdJsnFQ3wT3Sgassi9kgks8r85lpZBnx4QIg91WYNqj 8vbtXQEOlyvNfK1Ug/5aIQXLc8fpSKZF7g== X-Google-Smtp-Source: ABdhPJwkHDUTeoAPsl4X9WDCaqzyJntBiJl0Ik+bI9N9uJ9R4RIkE32rLjNqOmGXpISRHWsKUa/bJg== X-Received: by 2002:a05:6602:2352:: with SMTP id r18mr399455iot.180.1636034769667; Thu, 04 Nov 2021 07:06:09 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:09 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 03/29] bsd-user/arm/target_arch_cpu.c: Target specific TLS routines Date: Thu, 4 Nov 2021 08:05:10 -0600 Message-Id: <20211104140536.42573-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Target specific TLS routines to get and set the TLS values. Signed-off-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch.h | 28 ++++++++++++++++++++++++ bsd-user/arm/target_arch_cpu.c | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 bsd-user/arm/target_arch.h create mode 100644 bsd-user/arm/target_arch_cpu.c diff --git a/bsd-user/arm/target_arch.h b/bsd-user/arm/target_arch.h new file mode 100644 index 0000000000..93cfaea098 --- /dev/null +++ b/bsd-user/arm/target_arch.h @@ -0,0 +1,28 @@ +/* + * ARM 32-bit specific prototypes for bsd-user + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_H_ +#define _TARGET_ARCH_H_ + +#include "qemu.h" + +void target_cpu_set_tls(CPUARMState *env, target_ulong newtls); +target_ulong target_cpu_get_tls(CPUARMState *env); + +#endif /* !_TARGET_ARCH_H_ */ diff --git a/bsd-user/arm/target_arch_cpu.c b/bsd-user/arm/target_arch_cpu.c new file mode 100644 index 0000000000..02bf9149d5 --- /dev/null +++ b/bsd-user/arm/target_arch_cpu.c @@ -0,0 +1,39 @@ +/* + * arm cpu related code + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#include "target_arch.h" + +void target_cpu_set_tls(CPUARMState *env, target_ulong newtls) +{ + if (access_secure_reg(env)) { + env->cp15.tpidrurw_s = newtls; + env->cp15.tpidruro_s = newtls; + return; + } + + env->cp15.tpidr_el[0] = newtls; + env->cp15.tpidrro_el[0] = 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]; +} From patchwork Thu Nov 4 14:05:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00515C433EF for ; Thu, 4 Nov 2021 14:12:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BACD9610FD for ; Thu, 4 Nov 2021 14:12:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BACD9610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midTV-0000p2-V2 for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNf-0006SK-5F for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:15 -0400 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]:40860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNc-0000x4-7D for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:14 -0400 Received: by mail-io1-xd30.google.com with SMTP id d70so6053308iof.7 for ; Thu, 04 Nov 2021 07:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5iIfFcYyYja/cPaQ9qdIgUErIUCnLNWxpKMyL/JDBtE=; b=0KsRHtTzaIzii+ZWZCTR76FtLAIodVpIQehBsjf+XCoFrxV8gS4feMgtlwgA3pgA73 EDsRrTUUoIYPkgpndxEC5AzI5cW0pyy8lZ17jGDb6G4PXB5pxBKxL2JPTilRXn7C3ZxM bUjtAqSH5Dx71uP88vCbRTIBPOPRkLdXNPIxApHlN5uNB4QBwy3oUQhrKLNjXfX+deTw o9day25mWc5ayWVVNxpMcVM75jAkMat/niufTSRZXoi8gqtb32gjbdBKaI7HsVWCjqXO D/yznpHMmLR1Xm9nLTb3oTUpmP+llZyxm8DyyIzz8y4ZEDWfOWl19jAO5RyQPMWx+1rz iefA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5iIfFcYyYja/cPaQ9qdIgUErIUCnLNWxpKMyL/JDBtE=; b=Y2LmDx33rS7CfxsIn41Se/pdXBZOyD/BlVJ+45oR4pT+gozKvielxkpSTm8oMfmd17 gZbwqM0POMgwe4gKFuTAdK+uv2BuL4Unx6sjAm0rI8Co+Xn4nU7lIwOFgLXIm5hlqHYd orxLfZ+PBVdsfgYCvV5Me8tFG9SEJXV4lnUNIBNZlfGAzsPKRvlp15raNQCA14nUVw8c J7AgDUw7F8Zs8LwpoLxQTvWTR4ReiWaYzVc6ImvBUflJ2QG455ge+phMzqh9n+cUcDVi boGHMWYyz41jLtRztNg8fDG1HUqyQY4o1+Z5/zf7QQUojbpPV+hVe4RBlrrBGmTSFVQL 2dYw== X-Gm-Message-State: AOAM532LeaayrY+pm3AUzZL5xDowSRAEHYLLd7jxVoaPjZHFvFQB9ctu 454wI+0VHRo37EO29HPVECVQlTacKzU4hw== X-Google-Smtp-Source: ABdhPJxSKbvBgzegEUeDY9xUccML/AwLqA9XpWneoRMkjZRKVWEKKTMs/BoUip/7Tp0zqWi3FvY1gQ== X-Received: by 2002:a6b:7a04:: with SMTP id h4mr7178334iom.154.1636034770847; Thu, 04 Nov 2021 07:06:10 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:10 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 04/29] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions Date: Thu, 4 Nov 2021 08:05:11 -0600 Message-Id: <20211104140536.42573-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Olivier Houchard , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" target_arch_cpu.h is for CPU loop definitions. Create the file and define target_cpu_init and target_cpu_reset for arm. Signed-off-by: Olivier Houchard Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bsd-user/arm/target_arch_cpu.h diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h new file mode 100644 index 0000000000..66215684d6 --- /dev/null +++ b/bsd-user/arm/target_arch_cpu.h @@ -0,0 +1,43 @@ +/* + * arm cpu init and loop + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_CPU_H_ +#define _TARGET_ARCH_CPU_H_ + +#include "target_arch.h" + +#define TARGET_DEFAULT_CPU_MODEL "any" + +static inline void target_cpu_init(CPUARMState *env, + struct target_pt_regs *regs) +{ + int i; + + cpsr_write(env, regs->uregs[16], CPSR_USER | CPSR_EXEC, + CPSRWriteByInstr); + for (i = 0; i < 16; i++) { + env->regs[i] = regs->uregs[i]; + } +} + +static inline void target_cpu_reset(CPUArchState *cpu) +{ +} + +#endif /* !_TARGET_ARCH_CPU_H */ From patchwork Thu Nov 4 14:05:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D59D7C433EF for ; Thu, 4 Nov 2021 14:14:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F8FB611EF for ; Thu, 4 Nov 2021 14:14:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F8FB611EF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:48062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midVd-0006XN-Qi for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:14:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNg-0006St-B0 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:16 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:44930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNc-0000xM-R5 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:15 -0400 Received: by mail-io1-xd33.google.com with SMTP id f9so6915754ioo.11 for ; Thu, 04 Nov 2021 07:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IOY3t4AaHZe80iw8hQcSliA4Md0iNA8hrA2Uy7U0qF8=; b=3wOxFoT9veo1eOphH18qdcn59J2C93hUkwM/NkU1yVgNIMH2qAFRtpwnF5W3YQa4xQ vWJJ+kD7mQ2F42CqeJknTFvU+ZJt/ymqRGK+XUSB81DslTjCdQmvvDy7gqR5R6T+MM3U xiKLRKOKIxlcUHpJxGV7FgSjn3LPDJEo3ph2RopzJmwcHTctrAIgXy+lP1xBdUKdwfUP i5Q6pwpASdWSaKAkJ1EAPxSXVikCsSs16HDHYPiZbx1TWJj06eJBsqLTp+4MUS1FTJI1 ONEhWaO4l0yCmz0YqWcSqpl7uA1C+T2+hByJ6M3LbokrHZXwz05Jz+Y9lvHEOnE97Ctf 7MEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IOY3t4AaHZe80iw8hQcSliA4Md0iNA8hrA2Uy7U0qF8=; b=SVXZC1w6sq2mE/L/Fp6f+t1KfNdcX8rDDhF6UOpwYV5Qs+elGNq2JPP5l5J77024uH bcb26IRu1EJfOZZaAvcjD34fBNvqeFcnxphjf8/zzi7AsScFllV1lU6/S+TrzC6JXUY+ mym60e9358YnKuAgKzGmU2Vnywbe4UpjlnGWwc/uML3KgUZLGSHqogcHuHPrVJ1P+T4L mjAxFMoOFixk6Kfaco0e7uINrroUjLfJNNOT4LCpwbwR0pGOqHjFLByF5NH5KLJTeEp+ YzUJZ7ZnYItoL5f0KUo9cxo1VleSsyT+BKn/Lhti9tlXNjfz2n8QRJafSAcuyZwcNFUv imFQ== X-Gm-Message-State: AOAM533P1vF+YsGRCqCUN7q+QRb1Uls42ExL9qzZBNmkJRm7ykBL2kZA qbH3eO8U6du+MKY+3GyrHsDkueNgtYc7IQ== X-Google-Smtp-Source: ABdhPJz3OvExpkbOPR4TkCNn4ZGaW4uxxc9sOSuGWBleIkgWm+C5x/RWznBF8q7O66uc1Ad0TFlbcA== X-Received: by 2002:a05:6638:dcc:: with SMTP id m12mr3997759jaj.143.1636034771644; Thu, 04 Nov 2021 07:06:11 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:11 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 05/29] bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs Date: Thu, 4 Nov 2021 08:05:12 -0600 Message-Id: <20211104140536.42573-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement target_cpu_clone_regs to clone the resister state on a fork. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 66215684d6..fa45d9335d 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -36,6 +36,14 @@ static inline void target_cpu_init(CPUARMState *env, } } +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->regs[13] = newsp; + } + env->regs[0] = 0; +} + static inline void target_cpu_reset(CPUArchState *cpu) { } From patchwork Thu Nov 4 14:05:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BB2CC433EF for ; Thu, 4 Nov 2021 14:14:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FB0D611C1 for ; Thu, 4 Nov 2021 14:14:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0FB0D611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midV9-0004ba-5U for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:13:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNg-0006Wc-8G for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:16 -0400 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]:33741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNe-0000xm-1A for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:15 -0400 Received: by mail-io1-xd2f.google.com with SMTP id z206so7072222iof.0 for ; Thu, 04 Nov 2021 07:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GLFz+hfOtxy/QWMpxfsl9nCO3CdG/6n25bbQ+o+tB/w=; b=Aep7I0AFEOJdWz7ORLLsHk2dAaAVCXYD7FvYJarVRcdNPuTpxYAXtjSfJ95V73R3en lOnGqYQYADHW/Kmh9r4TnIzcKou7QtNdnzry/nIi36DVCDkv+AUXI8KXBWlqd50NxDeK q2iiCxw9CoAOIVQ9yvZZCsjqF1FsPx+CP6VCDWkFvjLtoy7uQLsBFMaso/6G6fLQjZhG e2+aEgIBCMwxZn+EzciAzqBLR/CDZK7P2TtiXJxMPNyBJZBw+/iVF4/Dbnz0uTt3W2Ke tTP88l/5mk0EOR0SpBRScAEmg46v6ItdckVVb5RDZBHgT/vAoVbNFyLPN0FU9ZX2FTCK JQ+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GLFz+hfOtxy/QWMpxfsl9nCO3CdG/6n25bbQ+o+tB/w=; b=E4HP029PMaYiLdZe57GhLgPa/nlueyDT/HtJANB600oUmn1JwpSt9lSFygJsm1/Tk8 fOuf4piSFyehnIsw6jhh7AKh44a0dnWuXd1jVHZxC8og5BSuCWVgRJ7d/Qq60bWj3LEN G1i3kC4Te5NrUFnYu/WTf8H4tSnY5sTqUQks8+ex9bOgLiJtP+kqVWjCyjO4FxNmOvoq DaUUDawfA09uw2dO5lNTKSq59CtGredH/240K6qgGpF8D9bbs9Taanap0UigL/rpXGV1 7LEXSg/P7IfgykHmiECr/pZdbhmD2Yg/rlUjpeGSlH+bDru7b7y5UETCh15tNaS8gJ3P 9i/w== X-Gm-Message-State: AOAM5330ELM59fssflRFX3sqJd0DHGYtA1DMBb2jJw1xwVsQUQR34wE5 k4yJeCF+kTk9nh+NMY4mvNQhhwP+b4bdNw== X-Google-Smtp-Source: ABdhPJxfZ4eU9HYuD0XDcjzdLF/AZ/SGczESVoLWkFGBDQKu4AcQtedLzPlqSLtsFaD4T/fUoAqUNw== X-Received: by 2002:a05:6638:c49:: with SMTP id g9mr4070026jal.54.1636034772726; Thu, 04 Nov 2021 07:06:12 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:12 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 06/29] bsd-user/arm/target_arch_cpu.h: Dummy target_cpu_loop implementation Date: Thu, 4 Nov 2021 08:05:13 -0600 Message-Id: <20211104140536.42573-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Sean Bruno , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add a boiler plate CPU loop that does nothing except return an error for all traps. Signed-off-by: Sean Bruno Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index fa45d9335d..2484bdc2f7 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -36,6 +36,28 @@ static inline void target_cpu_init(CPUARMState *env, } } +static inline void target_cpu_loop(CPUARMState *env) +{ + int trapnr; + target_siginfo_t info; + CPUState *cs = env_cpu(env); + + for (;;) { + cpu_exec_start(cs); + trapnr = 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 newsp) { if (newsp) { From patchwork Thu Nov 4 14:05:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC240C433EF for ; Thu, 4 Nov 2021 14:11:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BB68611C1 for ; Thu, 4 Nov 2021 14:11:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6BB68611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midSp-0007i0-FX for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:11:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNi-0006b6-04 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:18 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:34773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNf-0000yF-81 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:17 -0400 Received: by mail-il1-x12f.google.com with SMTP id j28so6281589ila.1 for ; Thu, 04 Nov 2021 07:06:14 -0700 (PDT) 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=i9XvF7HXxjrpqRTzWnEQTmzEf/yIzl4lvBJGSRF9a2k=; b=Lu1iIDIljTEC69tG8KRIa5aId1GLbYuXFnCXfiSVmEEiuJ19C47s05qO4Fnpmnrn2i j5Djnm65rtaKuabDAPRZC+Eyhv02ePzDxIqA9XVpaDzIxmupYFhWgJSJZ1Sw3P3RarJO NBrcCvBqD5HrboZKovGjml/MPBE0wtP8/68s6sZEGVV24GO7MeRym+e/kpOu9Znedwzd I/49uc8HAJNphBFMMb+0itIFKski1GsDuCGYkApGPbvVh2CEcmhGV8ymU6sbeuEXS8ls K6weyC5nWxj2Que2/KpX3ENlMVHkuNEDhsmnJgghvdJI1Q2J6Ej5VeT6rcTA44Arhbcd ORig== 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=i9XvF7HXxjrpqRTzWnEQTmzEf/yIzl4lvBJGSRF9a2k=; b=MxoZ0Mlh48jqlYeWybQ7BmBqAG7aHE4opo/1/Yw+PqDP+4jneGiVUj2eRHPYGRo3wY A2STomAOdjijtWxhTmF6WADtxZxodi8cVjBt0OiNrgM7m6L5CoR2Dy4OUXy9iCow0PhX HL1rISIUvvQcIQsCEwedD8AE0uMj8XKQawUuYR5S16d+pi02QdTQrTdJBBNCqUv5Ykeo 2+P7CqBdJRqGgjAmvzcfemHMGLkFfDdNhm6X5EduYsFoMeev9y79XC4kFVMY783GdQSP v6IFER6YAK5tsOh77O7SnXlTtW+05QXTP17Zu+L/mImUReU292MYwAbggA9j6onNNvdm g40g== X-Gm-Message-State: AOAM533CgIRa3u9zK/Nuv+h5YF5uu25FFKEGsrG1rb7X6YJfSLFOCmEf 6eZreX4CN4C9pNIL/l72uWbG4+Mo6R8J5Q== X-Google-Smtp-Source: ABdhPJxT0yyBdgTUZQ0vt3+bHV6Tbdl1xvLHRl6lRRAa6QaDU7UavBfmLicwPEmOSRC1O8CoZH7OVA== X-Received: by 2002:a05:6e02:1749:: with SMTP id y9mr29413143ill.232.1636034773930; Thu, 04 Nov 2021 07:06:13 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:13 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 07/29] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions Date: Thu, 4 Nov 2021 08:05:14 -0600 Message-Id: <20211104140536.42573-8-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , =?utf-8?q?Mika=C3=ABl_Urankar?= , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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ƫl Urankar Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 2484bdc2f7..9f9b380b13 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -48,6 +48,39 @@ static inline void target_cpu_loop(CPUARMState *env) cpu_exec_end(cs); process_queued_cpu_work(cs); switch (trapnr) { + case EXCP_UDEF: + { + /* See arm/arm/undefined.c undefinedinstruction(); */ + info.si_addr = env->regs[15]; + + /* illegal instruction */ + info.si_signo = TARGET_SIGILL; + info.si_errno = 0; + info.si_code = 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 = TARGET_SIGTRAP; + info.si_errno = 0; + info.si_code = TARGET_TRAP_BRKPT; + info.si_addr = 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); From patchwork Thu Nov 4 14:05:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8C0AC4332F for ; Thu, 4 Nov 2021 14:14:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8095E61266 for ; Thu, 4 Nov 2021 14:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8095E61266 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midVD-0004xw-LE for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNi-0006bO-9C for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:18 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:40857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNg-0000ym-3O for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:17 -0400 Received: by mail-io1-xd2c.google.com with SMTP id d70so6053559iof.7 for ; Thu, 04 Nov 2021 07:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IfRWeGYD+0hbc23c7Edg1M5XjxcHd+iZ98b19hdHbHg=; b=LeP6zOjpqzmz7oAA6qpb8Uk9asUMapdUePjyRhueMQV+kiwVZEfH0Y16l4ZEQ/1s2a kHI6gDFepgYq0TEWkr3tmZVxEfOYr8FcH0stMeO9j1AENaszz57UpSBXQWVHsRsFYtQp CxlFHxcvJ1GMkICPXmcKWyujAQIcdvCOE4y39W7+E1pxlWy3Ei6jgYom4DIXV8oL0rVN Ej1Pe7H+DQybd4G2K66whFX1PMQRNoIub0xDP6CeCnlT1V80qDt+O+cOuna1zSA3ZBSg d5sh8f8BeYmnG4umzgpjJqdC8Rrll7bU14ay+pwa7toWa45yXI/GMVATyIvvkSP9OQdQ IftQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IfRWeGYD+0hbc23c7Edg1M5XjxcHd+iZ98b19hdHbHg=; b=BxPSbscTceWJYgbF5V4PLqqAUC7+Xqod1nAud8bvle1NhQNXVzicQXkflc0L5lEDjc Ya2I/kX0XE5CtReGnBtZOWeTeBDBVC4SPbipaeIU6aH08E4Z2xEp+EI0CDfnlWXB43bw X7MIQdMDL9XrybubZOWs4qmwJs8Ir1CWTO70vPmxguD11lcI/gK+P2rcwb4vgGjn/eQM GfyXYBrFrlHrBf+gcEHwM+DduCCmj+2V12dr6K0lDBzIjGWACxDbL8y9pPQyeQWkruNJ hKydHkiAycf/PYyqxW5zyO2btrSA5OQUKWRadZDODI8lFd1mFEECOwoGcDR2I1k5zpGe 8i0Q== X-Gm-Message-State: AOAM530iwHKfipjpfqAqdHK6wM64GuaS/XqFQKr1r2M9RMM5JBKzsIWQ k5f7qPfH/3V07s5Ylz4XMSfH8tfBEZoj5g== X-Google-Smtp-Source: ABdhPJwq8ymXxE1ym0hZw9FLXwwgOieua/vFimL1af6IM+AaaHmuei1o10IHt9STbPNq/9pSrZhBag== X-Received: by 2002:a5d:9d85:: with SMTP id ay5mr26323164iob.203.1636034774788; Thu, 04 Nov 2021 07:06:14 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:14 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 08/29] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions Date: Thu, 4 Nov 2021 08:05:15 -0600 Message-Id: <20211104140536.42573-9-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Olivier Houchard , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement EXCP_PREFETCH_ABORT AND EXCP_DATA_ABORT. Both of these data exceptions cause a SIGSEGV. Signed-off-by: Kyle Evans Signed-off-by: Olivier Houchard Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 9f9b380b13..905a5ffaff 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -65,6 +65,17 @@ static inline void target_cpu_loop(CPUARMState *env) case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; + case EXCP_PREFETCH_ABORT: + /* See arm/arm/trap.c prefetch_abort_handler() */ + case EXCP_DATA_ABORT: + /* See arm/arm/trap.c data_abort_handler() */ + info.si_signo = TARGET_SIGSEGV; + info.si_errno = 0; + /* XXX: check env->error_code */ + info.si_code = 0; + info.si_addr = env->exception.vaddress; + queue_signal(env, info.si_signo, &info); + break; case EXCP_DEBUG: { From patchwork Thu Nov 4 14:05:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA54C433F5 for ; Thu, 4 Nov 2021 14:17:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 946AF61221 for ; Thu, 4 Nov 2021 14:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 946AF61221 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midYk-0005F9-NG for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:17:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNk-0006k9-8w for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:20 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:34371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNh-0000z3-6e for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:19 -0400 Received: by mail-io1-xd2d.google.com with SMTP id 2so3673931iou.1 for ; Thu, 04 Nov 2021 07:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=98BqBI8TmV8YvyFkZ3y+XgKQlmpyG8KzRCO1YXNy77I=; b=WOhdyhMPDFSG6PtfWxQ6FFJnmW2vV9sjSYfd9kPCabDrNYPNEDEoF+zBXVWd0q+L9a CDotICchVeI1S/Pj9Cnbjf2etzo5I3I/kJG0DOf+OB1/cOjsd9HQS5Se/VSLx/459XJy F7L0L1vCiHf2ji9qIEbxsE6oy4nBtR9cxSAJ8L1dVBdR3La1/ND6gvsv2sQpo/45+i7F LsCg80ZQdtVtvJSLQ02Sy1sI1Q7ZipERwb6tiRf+ZzM4FxJ5RdRhWNpi9kXis6Kox1sF P4wwMR2kwdaEYU+JBff2+kVCwK81v1KkmYfFCuxDEya3avAR7phzwevEHbBdWi62qCn/ uFYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=98BqBI8TmV8YvyFkZ3y+XgKQlmpyG8KzRCO1YXNy77I=; b=vRAGY6viZO9ojt8d8OtgNzfE0vKs2blIBYTRwqlVwKe7I9trVkewpNeoMRnxaFhs5L 23b79en8wkayyj7OArAw9dGGnFrWxd2uyKvCSlDHKgvog+Up0d+9uWjXbC5T+F4bN4JN ao7hWaCNhgjo+UckzoE+06BgVJPYZ2Q5GW31KXpJRBOUXt3Z+wQrGH92EOmD51Um2oCt SK8aSNbYUMAqobhnRWy+O68nVzSqUVIYPUlzaXk3K8ibXkAS0QE2h8PuoxJ+DBH+Pzs6 rlEp9uzEpDkqKlxSrSKd+NGXAWewNm39VjN1gsUEUH9PWZYr/71rK8DOwH2u4wBwFisE wMCw== X-Gm-Message-State: AOAM530czlXSr7TNdFx+RB2M6Z+7GY2LFLTD4ZbSgR/YjYtKoNPVPb27 QjGLnlYrZMWkFQyaPN0JQ8pZSI5T0nGemQ== X-Google-Smtp-Source: ABdhPJwcvsbHbZQyE4mDJNtTDBGtbbQGRIvMBJZ3bA4kMB/p3M3jN7fz8h+ubbQay5N6u/EBCaC+9A== X-Received: by 2002:a05:6638:22d6:: with SMTP id j22mr4012437jat.97.1636034775806; Thu, 04 Nov 2021 07:06:15 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:15 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 09/29] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch Date: Thu, 4 Nov 2021 08:05:16 -0600 Message-Id: <20211104140536.42573-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2d; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement the system call dispatch. This implements all three kinds of system call: direct and the two indirect variants. It handles all the special cases for thumb as well. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_cpu.h | 94 ++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 905a5ffaff..c675419c30 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -40,6 +40,7 @@ static inline void target_cpu_loop(CPUARMState *env) { int trapnr; target_siginfo_t info; + unsigned int n; CPUState *cs = env_cpu(env); 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 == EXCP_BKPT) { + if (env->thumb) { + env->regs[15] += 2; + } else { + env->regs[15] += 4; + } + } + n = env->regs[7]; + if (bsd_type == target_freebsd) { + int ret; + abi_ulong params = get_sp_from_cpustate(env); + int32_t syscall_nr = n; + int32_t arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8; + + /* See arm/arm/trap.c cpu_fetch_syscall_args() */ + if (syscall_nr == TARGET_FREEBSD_NR_syscall) { + syscall_nr = env->regs[0]; + arg1 = env->regs[1]; + arg2 = env->regs[2]; + arg3 = env->regs[3]; + get_user_s32(arg4, params); + params += sizeof(int32_t); + get_user_s32(arg5, params); + params += sizeof(int32_t); + get_user_s32(arg6, params); + params += sizeof(int32_t); + get_user_s32(arg7, params); + arg8 = 0; + } else if (syscall_nr == TARGET_FREEBSD_NR___syscall) { + syscall_nr = env->regs[0]; + arg1 = env->regs[2]; + arg2 = env->regs[3]; + get_user_s32(arg3, params); + params += sizeof(int32_t); + get_user_s32(arg4, params); + params += sizeof(int32_t); + get_user_s32(arg5, params); + params += sizeof(int32_t); + get_user_s32(arg6, params); + arg7 = 0; + arg8 = 0; + } else { + arg1 = env->regs[0]; + arg2 = env->regs[1]; + arg3 = env->regs[2]; + arg4 = env->regs[3]; + get_user_s32(arg5, params); + params += sizeof(int32_t); + get_user_s32(arg6, params); + params += sizeof(int32_t); + get_user_s32(arg7, params); + params += sizeof(int32_t); + get_user_s32(arg8, params); + } + ret = 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 == ret) { + /* + * Returning from a successful sigreturn syscall. + * Avoid clobbering register state. + */ + break; + } + if (-TARGET_ERESTART == ret) { + env->regs[15] -= env->thumb ? 2 : 4; + break; + } + if ((unsigned int)ret >= (unsigned int)(-515)) { + ret = -ret; + cpsr_write(env, CPSR_C, CPSR_C, CPSRWriteByInstr); + env->regs[0] = ret; + } else { + cpsr_write(env, 0, CPSR_C, CPSRWriteByInstr); + env->regs[0] = ret; /* XXX need to handle lseek()? */ + /* env->regs[1] = 0; */ + } + } else { + fprintf(stderr, "qemu: bsd_type (= %d) syscall " + "not supported\n", bsd_type); + } + } + break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; From patchwork Thu Nov 4 14:05:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EEEEC433F5 for ; Thu, 4 Nov 2021 14:16:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B82061250 for ; Thu, 4 Nov 2021 14:16:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2B82061250 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midXP-0002fy-BS for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:16:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNo-0006nY-Sm for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:24 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:41691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNi-0000zU-J1 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:24 -0400 Received: by mail-io1-xd34.google.com with SMTP id p193so6987152iod.8 for ; Thu, 04 Nov 2021 07:06:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rKLMBYjEYlw1VjEHepSl0BqgSbBEPtGPWDcDEzPgUqg=; b=KYtKzccL8ob3kUeHq3Ewwfr64lXVIMC/wjEJdd0QyGXwHIxYScpuXWWsxGEiBr9/V/ uID0tZChUrwYDYzGyDbHOCEt4mCibH8vLIC1i4xEgZSdx/1w5L060EUrlZ0Rf0B6wxin IW85FRItnuG1HeO48h2t6M2wzpOv0T3dDqbuhEIJl2OZ0N8bXK75Z3MS1eAoOAxlv8t7 iPH/kK9NpT4BO7AYGD+0vWSkKipqQgvBwovMv8dM5KGdULnrDxD3WmFv1eYrofnmNTp/ eL6peqmIayR1d6tfsCpFG6cVMLCCqLAS8Z5o7CthMIGJEgxnA9CFJEDfFF1yY9DLmW2R x7qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rKLMBYjEYlw1VjEHepSl0BqgSbBEPtGPWDcDEzPgUqg=; b=a3cDcNJWMKYAE1++Nz1EBB8xLAgzTrZhKdeB5PU5aObm+TfK9+kkuGrDWfG8ShVf/8 ClqS0XE82ShseH0wElEAPoyupbp4cDcf7grWzlogq/Rmyp3iCnrF+t0scbaZOZxPUyxE 4b1zjSV9aLiBEnRqQ9YPtyVCDWHnBhcY/N2igM+2/0DKYypKNBRbFBFPcJsorcs1UpIK EaMXWl+xSUSlovRohzSzbu9WgPRD7x0N6/VXJ0I2pC4fV1M0f0FY+PrTXtY5QfLloybr WsrCwRthVgYqXJgKiv2QaFxIMDn+jjxWc5aLR4Mnva5tjaEsGtUP66FxIlNIUKi4RCpi WSGA== X-Gm-Message-State: AOAM533yLc+eg3yE/dOaQczs9coaO6Dq/bmhSuclrK7Cy5kvBP7pz/um WMBNt43lSzv+gyekUTjAgMdD62laUK7X2g== X-Google-Smtp-Source: ABdhPJxc5UBb9wK4JZvulGce+Lf1H9gs0hvt/fzZY7ftqYjL3NCtS8dnAG7dKOB5gQrewPt63owaCQ== X-Received: by 2002:a5e:d505:: with SMTP id e5mr868503iom.217.1636034777257; Thu, 04 Nov 2021 07:06:17 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:16 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 10/29] bsd-user/arm/target_arch_reg.h: Implement core dump register copying Date: Thu, 4 Nov 2021 08:05:17 -0600 Message-Id: <20211104140536.42573-11-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement the register copying routines to extract registers from the cpu for core dump generation. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_reg.h | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 bsd-user/arm/target_arch_reg.h diff --git a/bsd-user/arm/target_arch_reg.h b/bsd-user/arm/target_arch_reg.h new file mode 100644 index 0000000000..ef5ed5154f --- /dev/null +++ b/bsd-user/arm/target_arch_reg.h @@ -0,0 +1,60 @@ +/* + * FreeBSD arm register structures + * + * Copyright (c) 2015 Stacey Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_REG_H_ +#define _TARGET_ARCH_REG_H_ + +/* See sys/arm/include/reg.h */ +typedef struct target_reg { + uint32_t r[13]; + uint32_t r_sp; + uint32_t r_lr; + uint32_t r_pc; + uint32_t r_cpsr; +} target_reg_t; + +typedef struct target_fp_reg { + uint32_t fp_exponent; + uint32_t fp_mantissa_hi; + u_int32_t fp_mantissa_lo; +} target_fp_reg_t; + +typedef struct target_fpreg { + uint32_t fpr_fpsr; + target_fp_reg_t fpr[8]; +} target_fpreg_t; + +#define tswapreg(ptr) tswapal(ptr) + +static inline void target_copy_regs(target_reg_t *regs, const CPUARMState *env) +{ + int i; + + for (i = 0; i < 13; i++) { + regs->r[i] = tswapreg(env->regs[i + 1]); + } + regs->r_sp = tswapreg(env->regs[13]); + regs->r_lr = tswapreg(env->regs[14]); + regs->r_pc = tswapreg(env->regs[15]); + regs->r_cpsr = tswapreg(cpsr_read((CPUARMState *)env)); +} + +#undef tswapreg + +#endif /* !_TARGET_ARCH_REG_H_ */ From patchwork Thu Nov 4 14:05:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 901A9C433EF for ; Thu, 4 Nov 2021 14:20:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5517D611C0 for ; Thu, 4 Nov 2021 14:20:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5517D611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midbi-0001Zb-IG for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:20:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNq-0006oy-94 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:26 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]:40944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNj-0000zs-KH for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:25 -0400 Received: by mail-il1-x12a.google.com with SMTP id k1so6262216ilo.7 for ; Thu, 04 Nov 2021 07:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1ztRBQYqWrUwRLf6NQ4W8izvboRcDbY0eKrhIvHHz3I=; b=f4/1VVtJdxJA6ObRpXO+osPgo4zji3vWjabJJiDGSf4vow5N0uZUAiWIyw/szw3CM5 0N9uYPq7IcQ1UfgSyKwNiRqjaLeesxaCx7yxLUEeYeyvm5GWSv06BbuDA3LShGeLfKcZ V47rd2SJH3R+UH5cqfZZD+dvfynqMpsX0Gx5mA4VNf6Ng2ONv/8MEaSm4UhNJd5Zzllm a77QM/xyEo6f5aBciIWi0rSy4dmnX2wrf3v3/ufQExT/WfuxGF66A7ry6rA2+/XANOw+ a+BZXijX8H8DVIqzXwv+vlCZl06rOOTetHenpi3eVg5lYAQESqY0CQq5QL0OyhdZWmVf m48A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1ztRBQYqWrUwRLf6NQ4W8izvboRcDbY0eKrhIvHHz3I=; b=wL4hOtKHXrtV30jxERHFuTY6Om8YJ+MaN17Q51hsQvNyYySU3jHAzruqRBOIKuFf3+ gIhp1BJE1ZdV9b5VS0gAwQ2GJ8igRSnQkqKf7lbbVLCGSmmIHEkR9ca4vY172b8i/5p9 molSLjK9DcZLGdbM1Yu3yyee6uSENlGhFQ8geWKcH+u1uomyjdlBIXst2WKoTDuTUMAq mMP3ndmzB7xeSj6gdOi5jwSL8EvPX0KAYrLBvIgd4M1qDuKtf2TFKrXemHplzmkDavkr fZeRbjSDY1qzHPElM/cPqc74Gl3IuiG2EE+R8yzO2cCsWkpJXxDctoPUEKxPWP3SPDLT AvNQ== X-Gm-Message-State: AOAM531RINpjDkHygRAsJsAHweAS9TMa0t6FcmGRBnIR2/dOmisrWMl4 vZBFTX7iWpVqLU+2DKRbpJCEIT60+pPoYA== X-Google-Smtp-Source: ABdhPJzhJlGyw6qGMCYmRBhagt+wukl5nkYtsFooH+QpjdchGQtVv6zlczOBEkKzCwMrIyLpztUAXw== X-Received: by 2002:a92:8742:: with SMTP id d2mr34167829ilm.128.1636034778237; Thu, 04 Nov 2021 07:06:18 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:17 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 11/29] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space Date: Thu, 4 Nov 2021 08:05:18 -0600 Message-Id: <20211104140536.42573-12-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Various parameters describing the layout of the ARM address space. In addition, define routines to get the stack pointer and to set the second return value. Signed-off-by: Stacey Son Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_vmparam.h | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 bsd-user/arm/target_arch_vmparam.h diff --git a/bsd-user/arm/target_arch_vmparam.h b/bsd-user/arm/target_arch_vmparam.h new file mode 100644 index 0000000000..4bbc04ddf5 --- /dev/null +++ b/bsd-user/arm/target_arch_vmparam.h @@ -0,0 +1,48 @@ +/* + * arm VM parameters definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_VMPARAM_H_ +#define _TARGET_ARCH_VMPARAM_H_ + +#include "cpu.h" + +/* compare to sys/arm/include/vmparam.h */ +#define TARGET_MAXTSIZ (64 * MiB) /* max text size */ +#define TARGET_DFLDSIZ (128 * MiB) /* initial data size limit */ +#define TARGET_MAXDSIZ (512 * MiB) /* max data size */ +#define TARGET_DFLSSIZ (4 * MiB) /* initial stack size limit */ +#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] = retval2; +} + +#endif /* ! _TARGET_ARCH_VMPARAM_H_ */ From patchwork Thu Nov 4 14:05:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E739DC433FE for ; Thu, 4 Nov 2021 14:16:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B246B611F2 for ; Thu, 4 Nov 2021 14:16:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B246B611F2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:55228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midXb-0002tj-8u for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:16:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNq-0006r0-KK for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:26 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:34377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNo-00010V-Ir for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:26 -0400 Received: by mail-io1-xd33.google.com with SMTP id 2so3674146iou.1 for ; Thu, 04 Nov 2021 07:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F9IbbLGjnRnokIuDKxQfCzJoAx075CoGnpnzgfUmRKo=; b=bjfIrnmnRdCx9FwDgLWOCcc2qCcgyQowvcSbtL9jvDVezWV2sBRB5ghP+N1lTN0Wt8 FtcnsdFJf6DKsYYJH6hGGniDT9GiVt92OC2zt4qH1/JjKiInYlxKhYepCseVETKHoE1a YpdgqhJGQtnRQeQzWft+PVqFm1O0BGBVQMccrYy9ZaHy7SHZcuSMl5P+4Y96r6QKIuut 0KR8YEbYhRxZ7kCBxXyiyEOpl3KReNr2wnkARQaSD8b7d/Fn85F5L088S5ko6/cJAjOW xxr0vNeS4NOHXf9VRwg5u5ASaBjcWVlJTp7KU0aseLZDfnvxlgKms6xBqwYMs8OuO8ME cPUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F9IbbLGjnRnokIuDKxQfCzJoAx075CoGnpnzgfUmRKo=; b=L5mkqdcYIcj3n7pjEPA322GvUOfrj9XTrrhn6/bSOz7poRtbH757xuTT3Q92UE7Fuk 5z3aRYmtjH/YXbgsev4dnt/144Pse8KbxpaLexbPeGoSmlSMuaJl2fabYzEPuOjohC/Z EeoDlrSse6vvS98ShLkT6jbDK0csY9pzlRyU+fZ6T6kqgIuE3Oxt6exBHQpFcuNARQU1 kamx/OgW/bRlmKH71V9LVwb2v6mJXAFq9/QcKglJgWecSLdeqOsxpLF60Nopfs8Drf6y RwVI+YxjhWURQyL6vIhoaojJMTNIt6WqYdsNR0h0CcOdLgXKDpFXaMXummjT4cmUPQEW rDqQ== X-Gm-Message-State: AOAM5338qpjItc5Up1u5eOKa07wIeCEuiTv+WcXtQq3Gc6Sc6ef8EtG7 l3qZUJg7eCB/DdFVcw/NaWfZPPgsW0R8Dw== X-Google-Smtp-Source: ABdhPJx31xve4U5O9Z4kfNcaxY5j5an/l1OEBXHfdKPOz2EPfiLu1VTi6nHUBzMobQDiZbQErWwoQQ== X-Received: by 2002:a5d:81c7:: with SMTP id t7mr38230769iol.65.1636034779468; Thu, 04 Nov 2021 07:06:19 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:19 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 12/29] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm Date: Thu, 4 Nov 2021 08:05:19 -0600 Message-Id: <20211104140536.42573-13-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Copy of the signal trampoline code for arm, as well as setup_sigtramp to write it to the stack. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_sigtramp.h | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 bsd-user/arm/target_arch_sigtramp.h diff --git a/bsd-user/arm/target_arch_sigtramp.h b/bsd-user/arm/target_arch_sigtramp.h new file mode 100644 index 0000000000..5d434a9e7e --- /dev/null +++ b/bsd-user/arm/target_arch_sigtramp.h @@ -0,0 +1,49 @@ +/* + * arm sysarch() system call emulation + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef _TARGET_ARCH_SIGTRAMP_H_ +#define _TARGET_ARCH_SIGTRAMP_H_ + +/* Compare to arm/arm/locore.S ENTRY_NP(sigcode) */ +static inline abi_long setup_sigtramp(abi_ulong offset, unsigned sigf_uc, + unsigned sys_sigreturn) +{ + int i; + uint32_t sys_exit = TARGET_FREEBSD_NR_exit; + uint32_t sigtramp_code[] = { + /* 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) == TARGET_SZSIGCODE); + + for (i = 0; i < 9; i++) { + tswap32s(&sigtramp_code[i]); + } + + return memcpy_to_target(offset, sigtramp_code, TARGET_SZSIGCODE); +} +#endif /* _TARGET_ARCH_SIGTRAMP_H_ */ From patchwork Thu Nov 4 14:05:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DE66C433F5 for ; Thu, 4 Nov 2021 14:22:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44D46611C0 for ; Thu, 4 Nov 2021 14:22:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 44D46611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1middl-0005v8-Fx for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:22:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNr-0006t9-8M for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:27 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:33372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNo-00010f-K0 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:26 -0400 Received: by mail-il1-x12f.google.com with SMTP id l19so6331298ilk.0 for ; Thu, 04 Nov 2021 07:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4oZ5iwXqrJmDcU+2qXHAQ++/SNnYAx62sujgKs8Ho4M=; b=XAfZ5Vt5r1Ugl1YVtw3+EYHA54XfZs5bP3dsKqLQPD00BC6okED8HrXQCt3VrK1/l/ Geck2s6exQtAW+Bd2VQT/mRUMORnKLRfeAFjzDYbD3tivhRTZNA75Z91WOeePqicCA16 UCfFU3F3bLek05hfmbobPww72pQGnhVagXBKxGzoU2XB0Gs6S5jG6euefF52A7QEjtAM f9FKKBO/VysHcbCJETFJ43NcZcZbFmo3brpXhvalVbFFrRAbSe1KhhVqvvMFmOqw8BZa mjH1WhiYaq9hA/ZbEKGXYPO01567M7408XZ1xywJSTQOyhO9ZWEoR+PqO3DLLaYSOlkt QGpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4oZ5iwXqrJmDcU+2qXHAQ++/SNnYAx62sujgKs8Ho4M=; b=ZArFpxcB84wQ/zn3txbXuP1n/odIIAJiBlBd6KpuoeC+Qm2IZAzPCLzwBV9RxAISwE WoOrxkJu3XTQvZXDgOUePnstDFTqw7bmlIZ8+Jgya/OTuG+dOELRD8ImyalDvE+XQSUJ vU4mo6RImn+zMFtMXIzApmBcntAOk7waghO2uCr3HrHAEL4KFq6iTaa17WehseQSfR/O +zDV8N6zPVEgvIAEKGZvhYa2OFEDLkW0U7sAYYBJS0uWj7EHp/UMDY+TlhPDRIj7LN3D 9rifWC1UGySa2/UETM0GeIKc8LYcPf1+v2MKTjkwpzp5wEEwNNLjKvHCh/xB/N/BLZTN sZPA== X-Gm-Message-State: AOAM530BRxyPbN3LPQeMPHlFG5gml0vh7ZOzv0JgL4sLiOPks+ocOm1r iF1YlXTKiEG1DfxPyKVYvuewlsKNrikOWA== X-Google-Smtp-Source: ABdhPJx0iyb1m/XwCr35/xvT13QfPJ/Iiv9J8FV6QvDgik9d50XjqpT0hse6s/QGFSCqeKiS0FvPEw== X-Received: by 2002:a05:6e02:1aa2:: with SMTP id l2mr24092449ilv.114.1636034780726; Thu, 04 Nov 2021 07:06:20 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:20 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 13/29] bsd-user/arm/target_arch_thread.h: Routines to create and switch to a thread Date: Thu, 4 Nov 2021 08:05:20 -0600 Message-Id: <20211104140536.42573-14-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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_thread.h new file mode 100644 index 0000000000..11c7f76583 --- /dev/null +++ b/bsd-user/arm/target_arch_thread.h @@ -0,0 +1,82 @@ +/* + * arm thread support + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_THREAD_H_ +#define _TARGET_ARCH_THREAD_H_ + +/* Compare to arm/arm/vm_machdep.c cpu_set_upcall_kse() */ +static inline void target_thread_set_upcall(CPUARMState *env, abi_ulong entry, + 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 = (u_int)(stack_base + stack_size) & ~0x7; + + /* sp = stack base */ + env->regs[13] = sp; + /* pc = start function entry */ + env->regs[15] = entry & 0xfffffffe; + /* r0 = arg */ + env->regs[0] = arg; + env->spsr = 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 = infop->start_stack; + memset(regs, 0, sizeof(*regs)); + regs->ARM_cpsr = 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 |= CPSR_T; + } + regs->ARM_pc = infop->entry & 0xfffffffe; + regs->ARM_sp = stack; + if (bsd_type == target_freebsd) { + regs->ARM_lr = 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 ignored + * 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_ */ From patchwork Thu Nov 4 14:05:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C79BCC433FE for ; Thu, 4 Nov 2021 14:19:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BAF6610FD for ; Thu, 4 Nov 2021 14:19:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6BAF6610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midaF-0008MB-KQ for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:19:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNr-0006sW-0Q for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:27 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:38789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNo-00010n-Jm for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:26 -0400 Received: by mail-io1-xd2e.google.com with SMTP id v65so7010838ioe.5 for ; Thu, 04 Nov 2021 07:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oLmdczkCWtTXgS+hIrrLVL8jr4D4Q93OjOn0dkypiZQ=; b=bw15/a0TzFGJUpNj510qR5nOo/8BQ4yG74ERWTJW2cnP5q0VEZceHvrE+7GqeqlW1o mRIUB4v7Z74iEFNYiGRN2xaALikC9r8jVjce2IGkN3f7AH8z7iiCsUxmv1yQ/rQGgWWG lNwS6UsMnO4qAOFmLhDXpIBzdnyxcrSodGPqRUmztxBv0B1lsWfPuoE++66ZG+BaHA5K QG08fAvtfmnVxOeJrN/1mZIEYMd5HV8WxJo5sCqX+t3Rn1DaxJVrEWKRc8ypALGODKQa qePYUsHT5sEGydDP7g/zmzJk1ep8ZH6d7GT6KhL+UNokEVBKgTgUBLuEpy7OuVjX8wGB Sovg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oLmdczkCWtTXgS+hIrrLVL8jr4D4Q93OjOn0dkypiZQ=; b=3MF0IZljHpsoJBkX33Jv98hUqp+0gyQFWRTZ0e75JPrcDrGF0Q8Kjws6eUsKXDcE16 G/EJGK34Vmiw4k44Z6eani9KCnLB8HJC1KCk7ET0TzOSR0j0L3itzN5fmpKTAJOcIyFo L09UiHyLMbxvAyUKVVlTFu49/PwL/tWXxPvfapoNu9nU/obn8+gLILPcF3MVkV6Isvr9 BW/FZvGii51p5VDNwLJgRanWExqFyyKlOmq+TVr8a6dW//6Ku/iYYt2q91lfyL2oaBvd dPM2CsZIhiAoePSsveOu0ttfVrep/Msevr1ZoKADxWfg2MR6NzFR0Evs6jzq2sIQMxMp VCSA== X-Gm-Message-State: AOAM533PIPDvlm4f9HTyeMZ18d0pJaA64lk+7XJe7Z2mxZ/kpO7C/Vve qghb6O91nrfO9BCJsM4acjtt9TLHDxtBww== X-Google-Smtp-Source: ABdhPJxWzcY/Aw6jc4yUn0V2MFlI676Wh7m3YwO8jOKymqo9nNPaPiUH7nEdj+yg8YmlQSvetWvWdw== X-Received: by 2002:a5d:9753:: with SMTP id c19mr22571466ioo.136.1636034781893; Thu, 04 Nov 2021 07:06:21 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:21 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 14/29] bsd-user/arm/target_arch_elf.h: arm defines for ELF Date: Thu, 4 Nov 2021 08:05:21 -0600 Message-Id: <20211104140536.42573-15-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Basic set of defines needed for arm ELF file activation. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bsd-user/arm/target_arch_elf.h diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h new file mode 100644 index 0000000000..15b5c66511 --- /dev/null +++ b/bsd-user/arm/target_arch_elf.h @@ -0,0 +1,36 @@ +/* + * arm ELF definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_ELF_H_ +#define _TARGET_ARCH_ELF_H_ + +#define ELF_START_MMAP 0x80000000 +#define ELF_ET_DYN_LOAD_ADDR 0x500000 + +#define elf_check_arch(x) ((x) == 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_ */ From patchwork Thu Nov 4 14:05:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AFA2C433F5 for ; Thu, 4 Nov 2021 14:19:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0EDC8611C1 for ; Thu, 4 Nov 2021 14:19:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EDC8611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midaL-0000IH-6s for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNt-00071g-5c for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:29 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]:39898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNo-00010v-KG for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:28 -0400 Received: by mail-il1-x12b.google.com with SMTP id x9so6265792ilu.6 for ; Thu, 04 Nov 2021 07:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8R82c+oSIU+sp8WqnJE/Io3vjzLSVpjkS5kzwk9Q/Pk=; b=UCStGRAeCTA/ulOT0ztTc8cLjjsrzT551wKA5yMOAYO/YCeJN66ARNsBme8ZHmfhGp xUs+h2CmCEfZqiQWg0LZsNk92LYQe8Ul7ulC6avl8g0DRPNMvGYmyYn0yRcXbohXVfHZ MYKRL6Mkc/c4Yg0m63P5AWxPPG3d3YlNYl2IXZONIt9617blKxjbynDfXcPVK8KqP0f8 iE4Iw3pn8xOhhPK72IBUuZ8fHcZx8lAHVw+hyiI+/UEBat7ylP/ox99PFKsCy5jy6OuH aRiirEZaHvKyppuXQkrcBBJJSVQtr2NU1x7m8FYsuMYe/Q7fZXPoaKHomMWyFXhtxeRg p6uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8R82c+oSIU+sp8WqnJE/Io3vjzLSVpjkS5kzwk9Q/Pk=; b=zdlPjyiG7z7lxeyhNOcRoFXBpWOvnzNvqdPNMvn7iXgRYJqD9y69wplxILrm9GXGkY kOsZvN+a9Ps2YgsUr0mxoyc3WGC+feD/n2bTLevvSs4sqcRr/hDi3GWMw9y3UrOzW09J DKMvwDScCIkWMu0wW/EyN1yxpqcsHDqGYZe3UY0+YUKUOaKjtGaDkVHWxaaPil8yrqhi wAsgvdI4uDRtJs1GHSFA++D5nSdTYf+b9kS6xFwRgEFLmLcFOQx13OghajCowHZRSZ3z et+NrpHHfRYied0JpTCqcmcLO9MzA/dhKAKTcthxvCoHMEbP4t8lavYa99BEuxyX5Hu5 +tRw== X-Gm-Message-State: AOAM531kMGT/iy58Scsr1UPqRKWjNpVeFXRyndAcpdW85mBQZbuMaVOS KhabR2IcOP2O1/0tl4UB2MN5PME2rIRWTA== X-Google-Smtp-Source: ABdhPJy9JVzLBXpTyLknNrAlmJYovI2Cl3gspJA00CUtyPxZ5n+vOG0nTruvju0pEWylAgVlGqWpBw== X-Received: by 2002:a05:6e02:144e:: with SMTP id p14mr3716650ilo.18.1636034782930; Thu, 04 Nov 2021 07:06:22 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:22 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 15/29] bsd-user/arm/target_arch_elf.h: arm get hwcap Date: Thu, 4 Nov 2021 08:05:22 -0600 Message-Id: <20211104140536.42573-16-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement get_elf_hwcap to get the first word of hardware capabilities. Signed-off-by: Kyle Evans Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 72 +++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index 15b5c66511..02d25b8926 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -31,6 +31,76 @@ #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 -#define ELF_HWCAP 0 +#define ELF_HWCAP get_elf_hwcap() + +#define GET_FEATURE(feat, hwcap) \ + do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0) + +#define GET_FEATURE_ID(feat, hwcap) \ + do { if (cpu_isar_feature(feat, cpu)) { hwcaps |= hwcap; } } while (0) + +enum { + ARM_HWCAP_ARM_SWP = 1 << 0, + ARM_HWCAP_ARM_HALF = 1 << 1, + ARM_HWCAP_ARM_THUMB = 1 << 2, + ARM_HWCAP_ARM_26BIT = 1 << 3, + ARM_HWCAP_ARM_FAST_MULT = 1 << 4, + ARM_HWCAP_ARM_FPA = 1 << 5, + ARM_HWCAP_ARM_VFP = 1 << 6, + ARM_HWCAP_ARM_EDSP = 1 << 7, + ARM_HWCAP_ARM_JAVA = 1 << 8, + ARM_HWCAP_ARM_IWMMXT = 1 << 9, + ARM_HWCAP_ARM_CRUNCH = 1 << 10, + ARM_HWCAP_ARM_THUMBEE = 1 << 11, + ARM_HWCAP_ARM_NEON = 1 << 12, + ARM_HWCAP_ARM_VFPv3 = 1 << 13, + ARM_HWCAP_ARM_VFPv3D16 = 1 << 14, + ARM_HWCAP_ARM_TLS = 1 << 15, + ARM_HWCAP_ARM_VFPv4 = 1 << 16, + ARM_HWCAP_ARM_IDIVA = 1 << 17, + ARM_HWCAP_ARM_IDIVT = 1 << 18, + ARM_HWCAP_ARM_VFPD32 = 1 << 19, + ARM_HWCAP_ARM_LPAE = 1 << 20, + ARM_HWCAP_ARM_EVTSTRM = 1 << 21, +}; + +static uint32_t get_elf_hwcap(void) +{ + ARMCPU *cpu = ARM_CPU(thread_cpu); + uint32_t hwcaps = 0; + + hwcaps |= ARM_HWCAP_ARM_SWP; + hwcaps |= ARM_HWCAP_ARM_HALF; + hwcaps |= ARM_HWCAP_ARM_THUMB; + hwcaps |= 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 |= ARM_HWCAP_ARM_VFPv3; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + hwcaps |= ARM_HWCAP_ARM_VFPD32; + } else { + hwcaps |= ARM_HWCAP_ARM_VFPv3D16; + } + } + GET_FEATURE_ID(aa32_simdfmac, ARM_HWCAP_ARM_VFPv4); + + return hwcaps; +} + +#undef GET_FEATURE +#undef GET_FEATURE_ID #endif /* _TARGET_ARCH_ELF_H_ */ From patchwork Thu Nov 4 14:05:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA6A8C433F5 for ; Thu, 4 Nov 2021 14:22:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ABFCB611C0 for ; Thu, 4 Nov 2021 14:22:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ABFCB611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1middF-0004v0-Sj for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNu-00074c-0w for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:30 -0400 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]:36374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNp-000113-0F for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:29 -0400 Received: by mail-il1-x12f.google.com with SMTP id l8so6285219ilv.3 for ; Thu, 04 Nov 2021 07:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I1XrwZ0o7hRgTEhkk9E1BQTq9616nNWJfCEFdNAWs4w=; b=RiJ7QAl28KqQVUNVdMTWAIG8NCmD8yhONjP8KagQJSZ6oySEjXZ/IeOjj39u2aXV2X HVCPBLRrBkUzqX7CoPKXpgpBFlQmBtQt0bZHCy8c+fQV5gH/Cw2szgdEBtmSDvmyM+Wn nZV/OCqMNlaqhrQic2HYgp+wkGCgQzbef3qws7w4Hm2nJLDJ6B7K5PcaHbckq84FcFJk NXrtesHTUIRJuGeNx9Lt+pzSx0bZq/T6EXRTFOIBUW6PL+2v7ux7hyEBhLWU6pcf/E67 Ar7DWWxHH1gK1Fr8DP6CmEUd2Pia/I9fIDH5byV8G1Six2V3nDZIIuWynDnpXcbZ28vR Zxog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I1XrwZ0o7hRgTEhkk9E1BQTq9616nNWJfCEFdNAWs4w=; b=FdpGVFZp2yx5+JxUwV0WcoWY5vh0L1rj/xfWRGiSqWxKAtThv7CunMHkvzzFi6A8hk m/IOjpUFgs5dvnsvmhyHocCoMQg57mgvv9VQjA3aYQvYCjsKxLZq1f+QLZpUk2xmSid8 1Nr3cPDz2Hlfw88agQ/FHvvEwHVqbrlE0OSvSSq3WUyKb5SJB0HsIDtcChdg2X5c3aMm /+FMV+66l3H75tucqSRz6QYdnRzZk4cGiE3Da4lFGrc3OT0r/vO4KB4cInjtTwZIltHS JsF31Vf0DI31lFT0AuophLLKeU11pnn8rX5dpoMVZb+Vp7WDTaGQj3zSQFNOnG24XvA+ pbBg== X-Gm-Message-State: AOAM533PFju8XR4w0U+gmTjT8HZwSTLBCXcKD+YEFiz3eMRR4xocqOCm GY6u1LlLgwnFmPdO6gyTQtikkZCGJ+7Omg== X-Google-Smtp-Source: ABdhPJxRDw5eKNqsReMrSnGW2pDOTiY0BpT81/WgHEpgzsgjLarCkAjwDWrzNMFcwz4W4qrJlDkPCQ== X-Received: by 2002:a05:6e02:1846:: with SMTP id b6mr11299206ilv.164.1636034783704; Thu, 04 Nov 2021 07:06:23 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:23 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 16/29] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl Date: Thu, 4 Nov 2021 08:05:23 -0600 Message-Id: <20211104140536.42573-17-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Implement the extended HW capabilities for HWCAP2. Signed-off-by: Kyle Evans Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_elf.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsd-user/arm/target_arch_elf.h b/bsd-user/arm/target_arch_elf.h index 02d25b8926..4a0215d02e 100644 --- a/bsd-user/arm/target_arch_elf.h +++ b/bsd-user/arm/target_arch_elf.h @@ -32,6 +32,7 @@ #define ELF_EXEC_PAGESIZE 4096 #define ELF_HWCAP get_elf_hwcap() +#define ELF_HWCAP2 get_elf_hwcap2() #define GET_FEATURE(feat, hwcap) \ do { if (arm_feature(&cpu->env, feat)) { hwcaps |= hwcap; } } while (0) @@ -64,6 +65,14 @@ enum { ARM_HWCAP_ARM_EVTSTRM = 1 << 21, }; +enum { + ARM_HWCAP2_ARM_AES = 1 << 0, + ARM_HWCAP2_ARM_PMULL = 1 << 1, + ARM_HWCAP2_ARM_SHA1 = 1 << 2, + ARM_HWCAP2_ARM_SHA2 = 1 << 3, + ARM_HWCAP2_ARM_CRC32 = 1 << 4, +}; + static uint32_t get_elf_hwcap(void) { ARMCPU *cpu = ARM_CPU(thread_cpu); @@ -100,6 +109,19 @@ static uint32_t get_elf_hwcap(void) return hwcaps; } +static uint32_t get_elf_hwcap2(void) +{ + ARMCPU *cpu = ARM_CPU(thread_cpu); + uint32_t hwcaps = 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 From patchwork Thu Nov 4 14:05:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F52AC433F5 for ; Thu, 4 Nov 2021 14:24:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF611610FD for ; Thu, 4 Nov 2021 14:24:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CF611610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:48504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midfS-0000mF-Rc for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:24:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNu-00075A-7j for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:30 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:42967) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNq-00011Y-1m for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:29 -0400 Received: by mail-io1-xd2a.google.com with SMTP id n128so6988608iod.9 for ; Thu, 04 Nov 2021 07:06:25 -0700 (PDT) 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=ib2ItGUGOkMWysYfWU4lM4E6SvnkdoydaKaA4P/DKkQ=; b=LQlR1mXPRvSCqwnRsKCkQe8vf2swBjJ9jUL7CZT0XDvryBmkTOr1sc7tKEy7V1IWLh 02XhA91MtbRiFvvbUZc08nW7hDtiIAVMXxPHYU2ug8pQrwOTqE/WuzFiBAHJyqpsfOKG lYyNn5d5FSSTWmVqt/RaqQ/BvQdnJSF6jTSJ6HA6bVUYG9gyiaKO9Auc95tLBsancKTs UVBikgZ1Rl/O0OEjWtkNax352kT8pEMeyXZ3vmXwvJelNrJmnz4WIOMSuhe/eaMaGLAl k2JEaswij8La5knm+P1UpfQ+9dtYvPNK/7FRU07SPUprMfvav7CwTGKyUZwjqxKgUSCj 4aww== 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=ib2ItGUGOkMWysYfWU4lM4E6SvnkdoydaKaA4P/DKkQ=; b=IjqW7AR+IH0LAysvurrteaOYnMOJDKNPfK3XXOhv+obbakQWXol1r3UVHTrNNGyzo/ ERnNuv9RvqNdXvAx1TIc4EW2hsg69gm9kqs0QkWIAM5F66qgRoihTTH/CFsZ0UKSRFj1 pagZtBwQDgX3Doq3A+kMrAU1Ab4egp8vs6twDW/s3GYx6jAZTLJKNbN9WV+MjSjmXkj0 JV1wJvFosJNB1pi7EodpPL3W248fbE2CaP5g00svhlHSl1fbIDfLz/P07qhV5cGVfXC7 zZkdE9UkW3OfawnTJv+jn8wdQg1je5d2P6gSq9mIL39jFK/VsabWmTyGpXmNgsf8n8Ay GrDA== X-Gm-Message-State: AOAM533bFbfAmwsSo1b1OyOTwmniLbivw23WYUiP5LmB56GPeaww2VUt TF/pnbJ1D7cKGmf/967NOPS7/BQS30wACA== X-Google-Smtp-Source: ABdhPJymx1YARIwupjvHvw+3g/xtHAZheHHusZzCfxA3cCxU/Q7xtzVI6gDuvnlq3ErWPn1WH/nXQg== X-Received: by 2002:a05:6602:3353:: with SMTP id c19mr1825582ioz.218.1636034784910; Thu, 04 Nov 2021 07:06:24 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:24 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 17/29] bsd-user/freebsd: Create common target_os_ucontext.h file Date: Thu, 4 Nov 2021 08:05:24 -0600 Message-Id: <20211104140536.42573-18-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 bsd-user/freebsd/target_os_ucontext.h diff --git a/bsd-user/freebsd/target_os_signal.h b/bsd-user/freebsd/target_os_signal.h index 1a4c5faf19..3ed454e086 100644 --- a/bsd-user/freebsd/target_os_signal.h +++ b/bsd-user/freebsd/target_os_signal.h @@ -1,9 +1,6 @@ #ifndef _TARGET_OS_SIGNAL_H_ #define _TARGET_OS_SIGNAL_H_ -/* FreeBSD's sys/ucontext.h defines this */ -#define TARGET_MC_GET_CLEAR_RET 0x0001 - #include "target_os_siginfo.h" #include "target_arch_signal.h" diff --git a/bsd-user/freebsd/target_os_ucontext.h b/bsd-user/freebsd/target_os_ucontext.h new file mode 100644 index 0000000000..20b8a9188e --- /dev/null +++ b/bsd-user/freebsd/target_os_ucontext.h @@ -0,0 +1,26 @@ +/* + * 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 + */ + +/* + * 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; From patchwork Thu Nov 4 14:05:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFCC4C433EF for ; Thu, 4 Nov 2021 14:11:00 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC12960F70 for ; Thu, 4 Nov 2021 14:11:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AC12960F70 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:35270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midSF-0006La-OR for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:10:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNv-0007B0-GG for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:31 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:40865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNr-00011o-0U for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:31 -0400 Received: by mail-io1-xd32.google.com with SMTP id d70so6054269iof.7 for ; Thu, 04 Nov 2021 07:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xELoQ9MP23ZY0icqqnGEqd1dDOY3xpL6nxhgED/dCUI=; b=Ky8BOgPgFSdahzbOeojFe7cOl4GLq5cxpW2pwisfPnJSDFpBBNxS98cUEN+7rLCpb0 baBSqUja0XFkEMQ/B7uoqewsf/h+46cU335sb1XfT0OC/4b5Bd/4ybQH9Bu1xN7YrRah K2ughEhJ9tSrzUm5xOOy7R5HbOuN0Of8mvQohxIFH4MUE8acFEAig8kbiIxrCUX2+Xpo C2FIfumho+tHGaB1kf158U3DOI7xVrn6asg6kpKuTVmYKyCd27EaOf2C8HOl8eT1RHgp R5/NYqTvuN76yfb6cvWttKoQMKkkwOppY1toMfb7abxy6CUEWWXUECrS+Xne3EvTe67C DczQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xELoQ9MP23ZY0icqqnGEqd1dDOY3xpL6nxhgED/dCUI=; b=UFush2xQPJkOVPxaTDsFj9/DGa5Mr3TAArhs4C3BV/f4GX5EWWBcSjVuVX1j/rhA4J Rw0tmt36zUn7IleQwV2jbq2BMWS/J68ItLmQA5HqpnGDgcT6wbSnsplvB0qA5Xnc2sve M+eNtAzWNKK1vfp4+tVceBYVtsOCGbAnEKNp6TYvTVh3l9ym2VQys5onuY12zrVUuwfD +DLwugD/IPc/QbVxd0z4Csc+n+Fl9VnXdrVwHBWnG7agc2IgxP/W4PNjRWf2rtXTNfmU 5AETHwz5noQs+140HGkBugHITbhIYVkbVyPucq7b+8pJkOwS1wE90yc/lAHvQ+RtT0wg ocGw== X-Gm-Message-State: AOAM532Cw5qNybeUqN28/ulBviREb+xwjkicCjSOxbvvGUe4VxR+gC44 KNG9KBgKXiipZMiQGZmcO9mvHB9asduSug== X-Google-Smtp-Source: ABdhPJwSna+ZEDVD3OIkkyU0HFPang5Rj7t3/a6NgtMgNHeJAUKHJ6+HBC8/hvVcc7mobL71PcZ+pw== X-Received: by 2002:a6b:f816:: with SMTP id o22mr38526711ioh.106.1636034785790; Thu, 04 Nov 2021 07:06:25 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:25 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 18/29] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack Date: Thu, 4 Nov 2021 08:05:25 -0600 Message-Id: <20211104140536.42573-19-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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_signal.h new file mode 100644 index 0000000000..973183d99c --- /dev/null +++ b/bsd-user/arm/target_arch_signal.h @@ -0,0 +1,57 @@ +/* + * arm signal definitions + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ +#ifndef _TARGET_ARCH_SIGNAL_H_ +#define _TARGET_ARCH_SIGNAL_H_ + +#include "cpu.h" + +#define TARGET_REG_R0 0 +#define TARGET_REG_R1 1 +#define TARGET_REG_R2 2 +#define TARGET_REG_R3 3 +#define TARGET_REG_R4 4 +#define TARGET_REG_R5 5 +#define TARGET_REG_R6 6 +#define TARGET_REG_R7 7 +#define TARGET_REG_R8 8 +#define TARGET_REG_R9 9 +#define TARGET_REG_R10 10 +#define TARGET_REG_R11 11 +#define TARGET_REG_R12 12 +#define TARGET_REG_R13 13 +#define TARGET_REG_R14 14 +#define TARGET_REG_R15 15 +#define TARGET_REG_CPSR 16 +#define TARGET__NGREG 17 +/* Convenience synonyms */ +#define TARGET_REG_FP TARGET_REG_R11 +#define TARGET_REG_SP TARGET_REG_R13 +#define TARGET_REG_LR TARGET_REG_R14 +#define TARGET_REG_PC TARGET_REG_R15 + +#define TARGET_INSN_SIZE 4 /* arm instruction size */ + +/* Size of the signal trampolin code. See _sigtramp(). */ +#define TARGET_SZSIGCODE ((abi_ulong)(9 * TARGET_INSN_SIZE)) + +/* compare to arm/include/_limits.h */ +#define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack size */ +#define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended size */ + +#endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA2CBC433EF for ; Thu, 4 Nov 2021 14:27:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FFDA610FD for ; Thu, 4 Nov 2021 14:27:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5FFDA610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:56540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midiB-0006Mt-Gu for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:27:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNz-0007UE-Rv for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:35 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:38617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNs-00012K-FD for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:35 -0400 Received: by mail-il1-x134.google.com with SMTP id f10so6289091ilu.5 for ; Thu, 04 Nov 2021 07:06:28 -0700 (PDT) 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=DBw1z07QxBjDRozLTIiFysXXDLukelVSqTbuJA83t5o=; b=b4pXlupF0hNesRscRiWHuUkJp9e7XtUZnQduNoSFm0j5gd/+pAuJ6iQZf8TTPtq/qW KvlBaGGnst7PV4mOWUR7suASWBNPhLdjF7GCyV7rYjZGUzgifkZqJEfcVh7VgnoYfnRG Xc/YPe36VAiPvyS+ubAEyGKvFM0xATq83Uie+3lnAUkZqj/bDAWEuK3/fWNC1cTHXCTh puonoiLjqMqM11nB3kvn8UI1yGbDS0usHZUGsNjqqxU2SR4C2YUYWsbgUkBGkqvbITXh 3Az4aKvsbOkS1j8owljJBxrbLODiUkdz06lzVdLX1OBUy77eMSX7d24DQIlNzp5dHnf1 gAwA== 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=DBw1z07QxBjDRozLTIiFysXXDLukelVSqTbuJA83t5o=; b=jwafVOTYC7pe02xFuZJ/e1d9VbHPjRIX1OQ1bRz10dnzRGgpHysjdc+zTHpbnwGpK0 L9XBQ69zdAaSF79yGQxcXqAEPS/o3WnbUz5IR4QQOrvnK8+7JOd+7w8jQCg9k7JzwbLM hLfOo4lZTioDX+bqf08qoVQZWkFnZA5yKmE7rXlMWv0m+apGysIs1OlAvW13P6cluYwn wPCgDgzuBhOt6ukwZi0Y/wrrB1DexH1AvsyO/F0giEJOr8sDh83EIC1nsug2lA879Dbs F6MsyWLPIkOUJYYDW8plmWWIke3odctBtCKFpVHJvGnzcIzjAVlg+SIE/endnlCfvHwE Uo+A== X-Gm-Message-State: AOAM531roSrhQLbqX4XDnNzggXiOP/A5whTU/uyggAEMN1bkRfJ3hTuL 2/CZE1yXvXWH4+69a3b2NaD2YUbGS7Fo2g== X-Google-Smtp-Source: ABdhPJxeFs4iSeDpceBrluaHSxHdSusYFkNBP9DVPBbj14zdGE2qUnegKlN6/bD8oRn6Um2iHpLMCQ== X-Received: by 2002:a92:c26d:: with SMTP id h13mr22659768ild.229.1636034787145; Thu, 04 Nov 2021 07:06:27 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:26 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 19/29] bsd-user/arm/target_arch_signal.h: arm machine context for signals Date: Thu, 4 Nov 2021 08:05:26 -0600 Message-Id: <20211104140536.42573-20-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index 973183d99c..3aaced474b 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -54,4 +54,24 @@ #define TARGET_MINSIGSTKSZ (1024 * 4) /* min sig stack size */ #define TARGET_SIGSTKSZ (TARGET_MINSIGSTKSZ + 32768) /* recommended size */ +/* + * 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 { + uint32_t __gregs[32]; + + /* + * Originally, rest of this structure was named __fpu, 35 * 4 bytes + * long, never accessed from kernel. + */ + abi_long mc_vfp_size; + abi_ptr *mc_vfp_ptr; + abi_int mc_spare[33]; +} target_mcontext_t; + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25169C433FE for ; Thu, 4 Nov 2021 14:13:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E49C1611C3 for ; Thu, 4 Nov 2021 14:13:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E49C1611C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:44672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midV0-0004HV-1I for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:13:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNx-0007Hi-0g for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:33 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:37782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNt-00012m-Fi for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:32 -0400 Received: by mail-il1-x129.google.com with SMTP id h23so6272982ila.4 for ; Thu, 04 Nov 2021 07:06:29 -0700 (PDT) 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=xSpmZTHUVlMjxvu++nH1NyF/IL0CfnSZPyN2HVK7azg=; b=4ahHVQGXl30Jufa7BeyVLDBsX/iXnXU0UsJAKc3QHOQ6SYfcZ8iIPrq6Cbtu2fSD0Y 5cHxECbJVaPtI/w+Hj/4PJC4OqjR7IFB/q5IpKkHZOsxbDUeOfvflun7iFRs0loN+r6J LyzBgmviXqIY4axfbv6wM8Dq565BD5cG68KZJEmqY1XpJwb1cylOChKiRs4HauEAqvzH 9F8P2QMqKsAPM9J62gkrn+ksqkBzQ3HxrN3tOPaHyc9+/QCK7EMnRAzq3y+pNlyTO18j sth2meFNF/zPdDk/WgZNqRd4SP8ae1f/oVf3QtTYa34Vmf2tapxrWtL9fxqrE4/qmx/i ieTw== 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=xSpmZTHUVlMjxvu++nH1NyF/IL0CfnSZPyN2HVK7azg=; b=aINNdaMr9B5E9LdHyxHmo9THQG+aJ6JBq4nA+ucRBo/lg2pYXtgVyP0LfYk8Gj21YI l70qmDqkBXRHK5fuFrWNGGWc2ojB+wy4VSh4ymMnYtKkkgR5ULgujcs0Sq8zHzZEQBUS pURABfro8uFtMWKlOxA/bquBVAUbIbCNmm2fesu869uipJkOM1w8yZ/dlOEtuPYGu5eg RlOWjNQIzTP0+lYQ256WTgZo1KL8K7PuuCB9gc1zuR9IQxC5EPMedozieNlznbyi6iYo dGHAEqk5v+Sgi8KZQhpBxPJhoGnzqBBPivw4opM1W+CeVdUIStCdGbtwIeiY0fNiwqIj ZAow== X-Gm-Message-State: AOAM531jwwTMKlJY7qxeQiax6sG6IcPhcFyfJxymgky3Vb3MLwEhrzpP r7S3zXN+qCY2P7gfyETKEt5bPRidLvUYfg== X-Google-Smtp-Source: ABdhPJwoAIcJAA7m6YmTCmekCHgs5BTpPQ5bldUR9eWONJnQKEzZ5N3dv8WHPIYoejoz/Wy/N1b+zA== X-Received: by 2002:a05:6e02:b24:: with SMTP id e4mr12116400ilu.17.1636034788263; Thu, 04 Nov 2021 07:06:28 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:27 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 20/29] bsd-user/arm/target_arch_signal.h: arm user context and trapframe for signals Date: Thu, 4 Nov 2021 08:05:27 -0600 Message-Id: <20211104140536.42573-21-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::129; envelope-from=imp@bsdimp.com; helo=mail-il1-x129.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Arm specific user context structures for signal handling and the closely related trap frame. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index 3aaced474b..4bdfcbb8d7 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -74,4 +74,12 @@ typedef struct target_mcontext { 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_ */ From patchwork Thu Nov 4 14:05:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87A1FC433EF for ; Thu, 4 Nov 2021 14:22:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C23F611C0 for ; Thu, 4 Nov 2021 14:22:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3C23F611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1middg-0005eX-ET for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:22:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNx-0007Jq-HA for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:33 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:34372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNu-000135-Eh for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:33 -0400 Received: by mail-io1-xd2c.google.com with SMTP id 2so3674710iou.1 for ; Thu, 04 Nov 2021 07:06:30 -0700 (PDT) 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=UDa9HzRQ7CJfd0GskHe2GGqy1pUzJiRt9/dQp1olxaU=; b=v+ktPMfEWv0Tek+Vh7smTkbkWLg7HE0y4q8xtMdVTAcWWyavqblSRKjGvCMC27mwBd yZBM4iwKws05U1yHBJhgcS81AIQhXMYfgYbhWq93AiQs19FBdLx3BhipTKpl5954WihK +xJqM9XYbydTK4wmw2DDkxAA2LPv5mUuvUcQ2/tgfS/XmBQ9SbdqNYMrgENQCcAH7DGi 9xEwA8b26RSHyyuWj4JaAGq4Pbzzigsu2Z1jddTFobE8JFBTPlazWKDFXxgX/gJwLcN6 2wgKx4pUZnzvLRkKZclXdI/KJ6xbwFhmjAaUGNlvHSFhumTzRx1sifnsgKCnoB3NHEw5 X5AA== 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=UDa9HzRQ7CJfd0GskHe2GGqy1pUzJiRt9/dQp1olxaU=; b=fmgcTatRJCtrblwdWudl3fvOwVxLAWti1E9zk/kK3SAfViBGzLRhL1Moi31yk/soPt snGsgeo3o7yD57eqUj8LL+OpQ7O+p8qw7kXmtWpq9ZNF1k8nkdr1iBPr4GYvo28xHmM7 7v/VDAcqBCeeNhlA2cNvhkYIjY8B6qO2vTChsN0kv/86WIGOiV543PsxNUh4/AlX74rv 8SEILe6TPCwDrLfFmT/G/OUDUM7Eab0pnwH/hPZAYDD1j9eEc+Lg//THUiI9VGxmuW/n 9qppsPMv1Js0PDEWIEnirK9yDNS88mOpBklGnW8ZK7Culk+IZ3bCI7gOSXPq835hjIUR y0VQ== X-Gm-Message-State: AOAM531h9I/XHARQ4ZqanPsG0TDaZU738/HzdfRh589M+kXRyO/XMGgf ofdEF9A/pO1ZY7qbgYdSWmXeKSxJTTvw9g== X-Google-Smtp-Source: ABdhPJzeFq0jxwawumw2h5/KKJfh7zo80XA0jRfIcG2468fkVAh1ZXFK3zUSWoC70f59dU8/op6yFA== X-Received: by 2002:a05:6638:2107:: with SMTP id n7mr4058346jaj.70.1636034789174; Thu, 04 Nov 2021 07:06:29 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:28 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 21/29] bsd-user/arm/target_arch_signal.h: arm set_sigtramp_args Date: Thu, 4 Nov 2021 08:05:28 -0600 Message-Id: <20211104140536.42573-22-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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/target_arch_signal.h | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index 4bdfcbb8d7..e673132c68 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -82,4 +82,43 @@ struct target_sigframe { target_mcontext_vfp_t sf_vfp; /* actual saved VFP context */ }; +/* + * Compare to arm/arm/machdep.c sendsig() + * Assumes that target stack frame memory is locked. + */ +static inline 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 = signal number + * r1 = siginfo pointer + * r2 = ucontext pointer + * r5 = ucontext pointer + * pc = signal handler pointer + * sp = sigframe struct pointer + * lr = sigtramp at base of user stack + */ + + env->regs[0] = sig; + env->regs[1] = frame_addr + + offsetof(struct target_sigframe, sf_si); + env->regs[2] = frame_addr + + offsetof(struct target_sigframe, sf_uc); + + /* the trampoline uses r5 as the uc address */ + env->regs[5] = frame_addr + + offsetof(struct target_sigframe, sf_uc); + env->regs[TARGET_REG_PC] = ka->_sa_handler & ~1; + env->regs[TARGET_REG_SP] = frame_addr; + env->regs[TARGET_REG_LR] = 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, CPSRWriteByInstr); + + return 0; +} + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8208C433F5 for ; Thu, 4 Nov 2021 14:24:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 64A37610FD for ; Thu, 4 Nov 2021 14:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 64A37610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:49594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midfk-0001XE-Js for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:24:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midNy-0007Ni-Ba for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:34 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:37789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNv-00013W-Pi for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:34 -0400 Received: by mail-il1-x130.google.com with SMTP id h23so6273082ila.4 for ; Thu, 04 Nov 2021 07:06:31 -0700 (PDT) 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=WZLLFuJrSTapjc7n8kKaU/l4LjLdLGHCbkIEXennWv0=; b=wv2rB0oN9NjhNQgfChU1UgWnC2K6XfG5ewZnA4rNDDZuc1CeRCiuburjXzv7nXmpag XkBxP/q1HbK70sdQPkf5tqtJd9yfqXPSebeXgooK4e4ueWEg6igGaM0tlXVyhNg31SgE uA/MltJ6nCmDyr/d+zjiHC0fJH06cqQ+WIzJlDw8GaA3VbR/1q3blRXo53p6TymQvZhc FuLn8nzH1MKRAWtY8i8WhZADrn4FIY0JRwXl1MtpuRRgmtb7EpbRXdR84iilg80LcZFM 7yYZeT588/kmDXAfgGyhckFGLsSRIsqx5EZ+XYedLLAZMw4JKzO/+ax9Whd8RzriSGEN vhbQ== 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=WZLLFuJrSTapjc7n8kKaU/l4LjLdLGHCbkIEXennWv0=; b=WdaJOkdxhRYFDTy9qHowmc2zTDILNC2nvP0YcWSR3X1Zt0RZy0J3nZ0urTFPkq59l+ jhxO5y8rzXGBxAj+V6VydrZOsMVV9eGMaygQBeNYE2x+7EP5DX7V0ukHZ21EN/RslcKO goGG2cgCETHOtqbw09FWg2dcP4kr1y89vUMefVWHpbvt5nS9x0pt91EXyZYBPN07Ls3+ qAUBF2w7eOhg+pOQMiLWrKz6qn7Qslt6s61eVvHfxd1H7alvi3KnM7renMS7GjcIEj09 ORC68lUFy9SjAbMWGbMd5Sb5ge0BvRBrLhEAXc2UYVZIrUv8x8STe8nlzVs80h/nT+vT yo2A== X-Gm-Message-State: AOAM533MuVAnm8JFVSU+6W+M8/mUBUaqHpcG4CvsoF2ZY+BDINN7T3XL +RU1tYg37vXyup8BQZc67jtqbuAaSVGd+Q== X-Google-Smtp-Source: ABdhPJwaRCfG9vOHKUluDkDlD5ec/XA2eoy4AvY5m7/Dh6cGWvuWkLVVAwi32U0HhbxDzz1XJBPiQQ== X-Received: by 2002:a05:6e02:164d:: with SMTP id v13mr12515749ilu.167.1636034790121; Thu, 04 Nov 2021 07:06:30 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:29 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 22/29] bsd-user/arm/target_arch_signal.h: arm get_mcontext Date: Thu, 4 Nov 2021 08:05:29 -0600 Message-Id: <20211104140536.42573-23-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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: Kyle Evans Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index e673132c68..ebb44d10dc 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -121,4 +121,54 @@ set_sigtramp_args(CPUARMState *env, int sig, struct target_sigframe *frame, return 0; } +/* + * Compare to arm/arm/machdep.c get_mcontext() + * Assumes that the memory is locked if mcp points to user memory. + */ +static inline abi_long get_mcontext(CPUARMState *env, target_mcontext_t *mcp, + int flags) +{ + int err = 0; + uint32_t *gr = mcp->__gregs; + + if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(target_mcontext_vfp_t)) { + return -TARGET_EINVAL; + } + + gr[TARGET_REG_CPSR] = tswap32(cpsr_read(env)); + if (flags & TARGET_MC_GET_CLEAR_RET) { + gr[TARGET_REG_R0] = 0; + gr[TARGET_REG_CPSR] &= ~CPSR_C; + } else { + gr[TARGET_REG_R0] = tswap32(env->regs[0]); + } + + gr[TARGET_REG_R1] = tswap32(env->regs[1]); + gr[TARGET_REG_R2] = tswap32(env->regs[2]); + gr[TARGET_REG_R3] = tswap32(env->regs[3]); + gr[TARGET_REG_R4] = tswap32(env->regs[4]); + gr[TARGET_REG_R5] = tswap32(env->regs[5]); + gr[TARGET_REG_R6] = tswap32(env->regs[6]); + gr[TARGET_REG_R7] = tswap32(env->regs[7]); + gr[TARGET_REG_R8] = tswap32(env->regs[8]); + gr[TARGET_REG_R9] = tswap32(env->regs[9]); + gr[TARGET_REG_R10] = tswap32(env->regs[10]); + gr[TARGET_REG_R11] = tswap32(env->regs[11]); + gr[TARGET_REG_R12] = tswap32(env->regs[12]); + + gr[TARGET_REG_SP] = tswap32(env->regs[13]); + gr[TARGET_REG_LR] = tswap32(env->regs[14]); + gr[TARGET_REG_PC] = tswap32(env->regs[15]); + + if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr != NULL) { + /* see get_vfpcontext in sys/arm/arm/exec_machdep.c */ + target_mcontext_vfp_t *vfp = (target_mcontext_vfp_t *)mcp->mc_vfp_ptr; + for (int i = 0; i < 32; i++) { + vfp->mcv_reg[i] = tswap64(*aa32_vfp_dreg(env, i)); + } + vfp->mcv_fpscr = tswap32(vfp_get_fpscr(env)); + } + return err; +} + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F5A3C433EF for ; Thu, 4 Nov 2021 14:30:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 159B5611C1 for ; Thu, 4 Nov 2021 14:30:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 159B5611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midlG-0004Dg-9j for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:30:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO3-0007gI-1p for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:39 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:45672) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNw-00013r-Ap for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: by mail-io1-xd34.google.com with SMTP id q203so6867488iod.12 for ; Thu, 04 Nov 2021 07:06:31 -0700 (PDT) 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=/P38LtQec0uIYUAMSJlTTldDVAbwXFSq7552rd++NNs=; b=HyEneBZQm4PB4Xg7WVOYB5TPE7ysjAyCyRAWMFxIu3D6gJ24P7eAyK80OqGOtkb0w5 cOYIoDWRY0nhmWWtO7Qjkqngi71EeFZoPm0evWjhNqr6K24ugcWj31+LHkdm0mo6TaA7 DidkklqTnO8U4pkvCvQsrjlsCYcCKwKa78pHRYcyFHk8i0mN/caXHS/oHvfGnUOkf25p okePq4e+skQ+a0fw0dG+GFIcp6NGuHfYXBHZLA7My4FH9iyPeYUcrzgRYFFTO6qdWf+l GTtZO4r4hj05B7vSNNRi64OMgjTPPsf9KIbs+GQxSfy21MQ5XZnayIpxnosncxRburwM C9FQ== 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=/P38LtQec0uIYUAMSJlTTldDVAbwXFSq7552rd++NNs=; b=hJu1A83R2k52YWEL15aCrEdxxzqKCCkRcQri6lmj8biQt8zyAI7KgW5cfAtizbUNcT zow8fwe4Iper0w3E7ZVIzQXfL+Cqm4PSlH9Sla8BQwbEWScprJbn5HR9ykG1e6GJOXtU 2J493+fJsDhFKgIywAaepcfCjQQGJdFuVYEAm0ZccykDn6CJUQ93s182Xgeb3rNOgeHN fJcQr/qSm/wAXaCKpgXXZYwbSnGoQlWKfpMTUDzCWYAUzJcUplig+5bvUZtTKCnnBRnZ ODh7B8nYjzzHiU6xn1yU1d2NDObrgCUHmKNt77Sriw9nd3Z25iUl4uMzKswE8qAU243X Z/kA== X-Gm-Message-State: AOAM533Wh16eSoKbHmL+NbAesxSkDhnNoHn6TJzmFjAkfE3HZwBz1YpT FTGg2GGjCO/VKHiIviCJWkFY3VBUEPE/Sg== X-Google-Smtp-Source: ABdhPJzlQ8eSa30BwHaOga3iU9opZvVyOglggKBKENXjfC0Y9w9laYtOpH8fQIE8ZOrG0GfM02EWQg== X-Received: by 2002:a05:6602:1242:: with SMTP id o2mr25613626iou.183.1636034791046; Thu, 04 Nov 2021 07:06:31 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:30 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 23/29] bsd-user/arm/target_arch_signal.h: arm set_mcontext Date: Thu, 4 Nov 2021 08:05:30 -0600 Message-Id: <20211104140536.42573-24-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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/target_arch_signal.h | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index ebb44d10dc..177617ea8b 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -171,4 +171,79 @@ static inline abi_long get_mcontext(CPUARMState *env, target_mcontext_t *mcp, return err; } +/* Compare to arm/arm/exec_machdep.c set_mcontext() */ +static inline abi_long set_mcontext(CPUARMState *env, target_mcontext_t *mcp, + int srflag) +{ + int err = 0; + const uint32_t *gr = mcp->__gregs; + uint32_t cpsr, ccpsr = cpsr_read(env); + uint32_t fpscr; + + cpsr = 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) != (cpsr & ~CPSR_USER)) { + return -TARGET_EINVAL; + } + if ((cpsr & CPSR_M) != ARM_CPU_MODE_USR || + (cpsr & (CPSR_I | CPSR_F)) != 0) { + return -TARGET_EINVAL; + } + + /* + * 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 != 0 && mcp->mc_vfp_size != sizeof(target_mcontext_vfp_t)) { + return -TARGET_EINVAL; + } + /* + * Make sure T mode matches the PC's notion of thumb mode, although + * FreeBSD lets the processor sort this out, so we may need remove + * this check, or generate a signal... + */ + if (!!(tswap32(gr[TARGET_REG_PC]) & 1) != !!(cpsr & CPSR_T)) { + return -TARGET_EINVAL; + } + + env->regs[0] = tswap32(gr[TARGET_REG_R0]); + env->regs[1] = tswap32(gr[TARGET_REG_R1]); + env->regs[2] = tswap32(gr[TARGET_REG_R2]); + env->regs[3] = tswap32(gr[TARGET_REG_R3]); + env->regs[4] = tswap32(gr[TARGET_REG_R4]); + env->regs[5] = tswap32(gr[TARGET_REG_R5]); + env->regs[6] = tswap32(gr[TARGET_REG_R6]); + env->regs[7] = tswap32(gr[TARGET_REG_R7]); + env->regs[8] = tswap32(gr[TARGET_REG_R8]); + env->regs[9] = tswap32(gr[TARGET_REG_R9]); + env->regs[10] = tswap32(gr[TARGET_REG_R10]); + env->regs[11] = tswap32(gr[TARGET_REG_R11]); + env->regs[12] = tswap32(gr[TARGET_REG_R12]); + + env->regs[13] = tswap32(gr[TARGET_REG_SP]); + env->regs[14] = tswap32(gr[TARGET_REG_LR]); + env->regs[15] = tswap32(gr[TARGET_REG_PC]); + if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr != NULL) { + /* see set_vfpcontext in sys/arm/arm/exec_machdep.c */ + target_mcontext_vfp_t *vfp = (target_mcontext_vfp_t *)mcp->mc_vfp_ptr; + for (int i = 0; i < 32; i++) { + *aa32_vfp_dreg(env, i) = tswap64(vfp->mcv_reg[i]); + } + fpscr = tswap32(vfp->mcv_fpscr); + vfp_set_fpscr(env, fpscr); + /* + * 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; +} + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12331C433EF for ; Thu, 4 Nov 2021 14:28:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C448B611C1 for ; Thu, 4 Nov 2021 14:28:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C448B611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:59174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midiu-0008Ec-0v for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:28:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO2-0007fK-RZ for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]:39900) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNx-00014J-Cl for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: by mail-il1-x12c.google.com with SMTP id x9so6266300ilu.6 for ; Thu, 04 Nov 2021 07:06:32 -0700 (PDT) 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=ebPUBinz5Y5WFe0LKLcheZIJ1i2oBR9MtV2qXwIpw5s=; b=OzK0SWGdaXMz308HxPZrwuqNjP2JkApVXxzcT3fr9XsqHh2Fo5btuDqdX/jpbbBm98 Yc8wM0xJoZFu20nzy8y7sTXA1+/yhQea7NZiTT1mkztmejU1GDRzIQ8luMrN/d7mf3pq lJfpfoJR18u5HMqzOW0oU4o8wCCv0O/gHT5lQR7bQueze7mxWTxs1K0PohxgoSWu/H2O 8ey8BEFHYJg3ffdWOIKleMllqSnYc3YJZUrRCttnPtq/6lmYOOuAlNKCMtZFzBJ6xuFR 8y14O41fifmTLgLnfOn3eBdzlaQA3iw2rzroMby4rBYRvI8hqY8iiNSLVwkVLc9fM6Fz mMIQ== 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=ebPUBinz5Y5WFe0LKLcheZIJ1i2oBR9MtV2qXwIpw5s=; b=xHkZg6ryk/r8WOImP9NTS0H8SNZ1QWNgQgF/D4zqpVRP/QfArichG/3SDLvA3KRbHk WqutZsCp8h19Ytq3EPhFyMZ0HbHjufizdVGZWBlB7NWHpYLo4+mNAfTXyAWwYsyCjSBH l3YbLQIq1zxV/TPUVXc4aX/VxO0tb6SUijrg8atLkd4JgH4A1PehZC0tb/5YpoYV3i8d T+H27sWuFxpowLu2aq7c/yLdTfItFK198r2gvqjW7PqOUSi5ssgM31f0jfmfx2qFdvNU Ue1ABbswZjh6P7TIwpySZ04nxi/77jD62fS7BbK3jAx+5Cdp9DS4FXm9vb9YhXwm/ger tmbw== X-Gm-Message-State: AOAM532oI6a7xR8ww2E4oSWIPbxJj4+Gn/203pP68RFFGvF2/Rw9KpT0 YgZOw6u+ZO16vCqO8Dh5EfqaVEvbpL9akw== X-Google-Smtp-Source: ABdhPJzXOjfWJqoGH+Gl3jMNrawoaVxU2ceEwMS1ASBRhK5SXQQmiFoQxBxideiUbStB/duMD6+NzQ== X-Received: by 2002:a92:c562:: with SMTP id b2mr20701791ilj.30.1636034792179; Thu, 04 Nov 2021 07:06:32 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:31 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 24/29] bsd-user/arm/target_arch_signal.h: arm get_ucontext_sigreturn Date: Thu, 4 Nov 2021 08:05:31 -0600 Message-Id: <20211104140536.42573-25-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::12c; envelope-from=imp@bsdimp.com; helo=mail-il1-x12c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Update ucontext to implement sigreturn. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/arm/target_arch_signal.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index 177617ea8b..fd38b14c33 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -246,4 +246,13 @@ static inline abi_long set_mcontext(CPUARMState *env, target_mcontext_t *mcp, return err; } +/* Compare to arm/arm/machdep.c sys_sigreturn() */ +static inline abi_long get_ucontext_sigreturn(CPUARMState *env, + abi_ulong target_sf, abi_ulong *target_uc) +{ + *target_uc = target_sf; + + return 0; +} + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Thu Nov 4 14:05:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2E03C433F5 for ; Thu, 4 Nov 2021 14:29:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A3F861053 for ; Thu, 4 Nov 2021 14:29:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9A3F861053 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midkB-0002Hp-Qm for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:29:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO2-0007dr-Ct for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]:35812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNz-00014m-KS for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: by mail-il1-x133.google.com with SMTP id w15so6284642ill.2 for ; Thu, 04 Nov 2021 07:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VTdt3uC+ttB19F3HtSXrERhSxFv3zvRil3LE5812gSQ=; b=AIImSrI+5yifraxY1cijEXWfKdEiLny5ZHoZ0oucx/8AhDuRDzVLLNb89thINiV8dd xGYqV4KueoOOgxLbRlkMu1VppfBf/8qfBLmsMoT9SqPcAUjLgAx4mEASlNzhPCzCdUrK MDI20qD/qXTC24clPy8zq0KcsGl1dzf2xbHfnPi8iDYDR8U+EeurGzV1WwL3vCLYYJRq TBrB3uN3+Yvml4qba3+JeNrUkq8aPFmmGqMEmQO9rM8AptwDfHvnMAQTNL60ADgNJpJC /8WSB946b4wG3UwTljzBMwY64jjeeMmzHp25Ppcxzz007X+kar1eKcAV02uMWrGbuKiD Wkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VTdt3uC+ttB19F3HtSXrERhSxFv3zvRil3LE5812gSQ=; b=KF85Wgt5rLeh8E5JtHilyIEGBogZeCATLNeQ1uSC+5CWyvOJsK3X4nnNoLfF5FIbD1 I/St2uXcbsyRyeGMp5DATGMr0MrbIrn9BH71nn1DPzvGyQVo5C8FbLteXDXlglxc5qU1 haIFXWIsbbl9oySGOYYvc5FV2kwYvShoLiIEu5UZsNokkaAer89srng7ZWfRHcilaALT lx5M5+Qk2SN6Tdrf2fWkSUPR+W0hOYmCqZ0VaFfkCupJTejmrgD5qxMM1X6LOKdWXhvk 6+R+/wWMpAG0lKUpXVp/fqi49igBpAwJEUH87eg+GgPAPYrhM9ShMOHzqusj8bqyIit/ SQ1A== X-Gm-Message-State: AOAM530CpwuPHqu0oLt3eMyXSwbAWWn4NQd+sJ6+cbjglroUrGrn+A+h X3d0sbS+kIq3+5u6zcSGt0G7GcnC8f80Ow== X-Google-Smtp-Source: ABdhPJy+TYE0PxzR+TXXpkO4POIHOKH2FK/vhj5Pwd+fKjV41vFr7Mf84YPCnrPizNS4M1ICs3sJRQ== X-Received: by 2002:a05:6e02:1989:: with SMTP id g9mr21213842ilf.61.1636034793261; Thu, 04 Nov 2021 07:06:33 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:32 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 25/29] bsd-user: add arm target build Date: Thu, 4 Nov 2021 08:05:32 -0600 Message-Id: <20211104140536.42573-26-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::133; envelope-from=imp@bsdimp.com; helo=mail-il1-x133.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Paolo Bonzini , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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-user.mak new file mode 100644 index 0000000000..cb143e6426 --- /dev/null +++ b/configs/targets/arm-bsd-user.mak @@ -0,0 +1,2 @@ +TARGET_ARCH=arm +TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml gdb-xml/arm-m-profile-mve.xml From patchwork Thu Nov 4 14:05:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E499EC433FE for ; Thu, 4 Nov 2021 14:26:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DB3261220 for ; Thu, 4 Nov 2021 14:26:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9DB3261220 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midgt-0003nU-Qv for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:26:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO1-0007ZU-Bo for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:37 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]:37787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midNz-00015D-9Y for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:37 -0400 Received: by mail-il1-x12d.google.com with SMTP id h23so6273314ila.4 for ; Thu, 04 Nov 2021 07:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rOISPYYKecMk71RBzznUZbzYo3FGryyldBKKzRc7muU=; b=RmX4rXtwf9HpYzI7pAKW6uKGnkTjS6QZi19qxbeat3XDkefgwndzBlTUg6OVQRSack 5XIBs6ltcfJZ5mTR3+ZyK7Shf7Rt9rx7NdWKWig1r96shlem4TR3SdVukge6BHTHuEgc 10u4JjVovdXM0oprQqSMDTNmTgnyuTJOoQyXp3XDHp7Zv35Ar1f7xWC0GZCvGFtIQ1+W 01zbWSScHYhD+iladHA+UFu9vOE5+tmrNZJ2sFqdXKefVZMtsVBH6FaCG3ayLMO3aJxp K+Y5V2rD73jP2hkmEp6Sxvuc4bCCwmLpB7OfKR6X5VQTOlLmY2CAFtCLgn+vZiet/Asn qe/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rOISPYYKecMk71RBzznUZbzYo3FGryyldBKKzRc7muU=; b=S/MTY32e1nRlcfebWN9xnS7LlIfCWey3u9paiI7zk9txliqwnU4sOCkDuqQ0sAC0VF mbUwzylnolITiG/YtLDzUDhr36jfbfTgBC4nZO6rcEr0YpgqsqGAMnla9W+RDG6cSu15 egzCYwZIQhl5jbaBjHBgiY5D8fghKyzTSgQ8Qc4RSGrBY3B/U3fbHkgFnZKOQr3RbiYJ 1lkVhPCRAc3knEdfD+p/u+rm7zUkh/+md35pmSqQPjeH7VreGL7Z1D3tlYfoKXcktTBM tN8Ft7gi3/QCluAXxlylfUSeeVDGWPcsPP2krYxicBw7vA/4qu8fMpEg5BqCmOSP6gLg IB9Q== X-Gm-Message-State: AOAM531YJ4O5diGq9bRGOLT9B783yhMCLoPgZXbrjpakrwAiq4ENJ4ik Tl8AqgkkzLsmub5ETOQa/D6jch7vhwlc2w== X-Google-Smtp-Source: ABdhPJyJezRcE9awRy5ndNfR9iWBrjO37dpxKar/MH70Zf7AH3o+XKRvfuAEUyXZRsbbNP91C258qg== X-Received: by 2002:a92:c051:: with SMTP id o17mr35672421ilf.276.1636034794151; Thu, 04 Nov 2021 07:06:34 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:33 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 26/29] bsd-user/i386/target_arch_signal.h: Remove target_sigcontext Date: Thu, 4 Nov 2021 08:05:33 -0600 Message-Id: <20211104140536.42573-27-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In FreeBSD, sigcontext was retired in favor of ucontext/mcontext. Remove vestigial target_sigcontext. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch_signal.h index a90750d602..e262667bda 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -27,10 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ -struct target_sigcontext { - /* to be added */ -}; - typedef struct target_mcontext { } target_mcontext_t; From patchwork Thu Nov 4 14:05:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F3DAC4332F for ; Thu, 4 Nov 2021 14:27:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B201F610FD for ; Thu, 4 Nov 2021 14:27:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B201F610FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:57484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midiR-00071F-Rz for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:27:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO3-0007fj-Sm for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:39 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:35728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midO0-00015s-Er for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:38 -0400 Received: by mail-io1-xd2a.google.com with SMTP id c206so5500409iof.2 for ; Thu, 04 Nov 2021 07:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wZvh57AWzS8inwSMVn1OaBIlb06mOlklnUcQyFDbg60=; b=QivoQuAjDT9P/5pFJz0dJZ3U5XOYq+JTmo33lkUO5b1V13fUPi70xiyqwjHBqGpJcE ZH2Q3mJ1n9PYvxVUSEkudCmo6s1Dv5sOL3DcovRUAranNME6qfZ3zUXHdrDn15RjrMk2 knOa4MzQ4NvjyLuXGY4OKl3Jhtj0kSCoL55KJT9yFD6jFmIBQMUyFf8TbDoxXdRkvNLc QfzkOuRqVWTw05dQQWFgKk0S9uHrXwoMZDK0orv/ne5TX5ustiXHEwz0K0i2xk3Pdx1B ZLIjxW7oL1sBZh7P8JRblvfEjC8Ra6CGFTdwJNipNzx4nUR1g3uY0JPIxTtBmhBp8K5w f3Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wZvh57AWzS8inwSMVn1OaBIlb06mOlklnUcQyFDbg60=; b=P2OwwjJ5ktcKL/5WGQX6g3SwF0Kz/2ss10hAXLbMXCHM7RFydQQfJlaSS2eBRGtaKm GX+UWB5BxP3y71O3LJnPx5YZvrNqXAYAkWC98nQdI3XhJxCj+336RXtgSo55VnHRjgpD 7MNEINGBBYY5863/Smw2nZd3YysjkoIfAOMl79/ll5g/F2TrApL1rstCe0atO3c1VLLQ o3s1THaIWb5HB/dJ4/p9lGBCPkZjjb8e2MWrjfrHuqtAdE6Ibavp6V1jK5HhayNUexPU L9MsguQoetvycxsDeAJYPGizd9bg0oz+gwylvdpJvw3qfSZxylDnZUyHwJzG5A+nnRSm 066w== X-Gm-Message-State: AOAM532VusiZJW6u0NhXUPY8036pdeqDhr3+t2/NjOlogfisOAO6pfdQ k6lvObR7B+Flmdr7n0UZy7ZiJ2+seZCr9Q== X-Google-Smtp-Source: ABdhPJz+QyTtcwwCfY9rs4wgWGXAFZWopCHWcW68y1s9NNL+Sp4BcxjvGqOJ665cFAay4e7Vud4Q9A== X-Received: by 2002:a05:6602:2089:: with SMTP id a9mr30952030ioa.20.1636034795036; Thu, 04 Nov 2021 07:06:35 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:34 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 27/29] bsd-user/x86_64/target_arch_signal.h: Remove target_sigcontext Date: Thu, 4 Nov 2021 08:05:34 -0600 Message-Id: <20211104140536.42573-28-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In FreeBSD, sigcontext was retired in favor of ucontext/mcontext. Remove vestigial target_sigcontext. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/target_arch_signal.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_arch_signal.h index 4bb753b08b..55f742b0a8 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -27,10 +27,6 @@ #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */ #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */ -struct target_sigcontext { - /* to be added */ -}; - typedef struct target_mcontext { } target_mcontext_t; From patchwork Thu Nov 4 14:05:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35192C433F5 for ; Thu, 4 Nov 2021 14:32:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC8FA604D2 for ; Thu, 4 Nov 2021 14:32:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC8FA604D2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midmp-000739-36 for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO4-0007lF-8y for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:40 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]:35807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midO1-00016D-8h for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:39 -0400 Received: by mail-il1-x12d.google.com with SMTP id w15so6284833ill.2 for ; Thu, 04 Nov 2021 07:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YUhiVOQnmpNFSdmZg3CHyQkzJYfHEf7WcwU0TPM0Y70=; b=6u7SIMT+3SdYzpEty9PbwDubfIHKZYrPbVn+vro1o/QvfbIwjF0GsHPFcpEz5AjSKO 3zfXZMDi+NNFrxYP4VAks5C6y2Z/w0HIv2UVwtphZv4jCqRYhKF95F2nTEA7H4nml4WV LQG8isxQLlKAkQsVnohfTffVNpHMD/xZJ+1xM+eD0BOu49ukpWOMuaOvXIUpxBg8mqEi FglslkPTewIdDmte14qF8m68Bho8+HPs7U7KpNfJdlK3v6oN/LeNOctPj/ToNLrsK9Gi 0p51QSX/R4rX0IVi/IMvghrCYspygcGBqdtX3ayKOhIysHPMo8d1kJzNy6hSG+R5kZL4 FoXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YUhiVOQnmpNFSdmZg3CHyQkzJYfHEf7WcwU0TPM0Y70=; b=NsM9bpigA2IPpDITVzcUm61qBhpq+rpPHfcGGV7mQVM3/feG2xAWiC8Jxu6fyGjWsN gD+ZvYk52MG69i4WrZe3o/KMIEsDiG+fRZh6QpYa8SAHByOlsDbXO/YVV5t1VmyXLQBl fqlE4dnVSNBujIoUbqGSi3E3Vc9yGt9NptyVUWGczfAjofxTA1A48l2sIe+f0DNQurTW z0KUj01akQnZBqbK9A2n+12vp17plSfFy7932qZaXPRzE5a7oGCF9laipKC2zxiOaMe7 g8kVDInjG9ztzGFLN2scW/CXlvL7VUpQbXzDeOT/HJgKlUBG8++LMyzZpxwgpdSwNl34 YuGw== X-Gm-Message-State: AOAM532ZYVNvLJ6YUyeXvJmun9AnzIz92MwrrdT7wievxEPYo3oqPAFU kmhYumYWNyNh23sUJVLYpV4JUmwsgpN0cw== X-Google-Smtp-Source: ABdhPJyOohsgSWsdYd7UYKXhwBaqoi5e0W5e+6jgo1G2tePoHmuokNhfXiDTiqgkn2tuSkTFP1bcBQ== X-Received: by 2002:a92:a304:: with SMTP id a4mr34646231ili.78.1636034796027; Thu, 04 Nov 2021 07:06:36 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:35 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 28/29] bsd-user/i386/target_arch_signal.h: use new target_os_ucontext.h Date: Thu, 4 Nov 2021 08:05:35 -0600 Message-Id: <20211104140536.42573-29-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_signal.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bsd-user/i386/target_arch_signal.h b/bsd-user/i386/target_arch_signal.h index e262667bda..bf7263c4f8 100644 --- a/bsd-user/i386/target_arch_signal.h +++ b/bsd-user/i386/target_arch_signal.h @@ -30,14 +30,7 @@ typedef struct target_mcontext { } target_mcontext_t; -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" struct target_sigframe { abi_ulong sf_signum; From patchwork Thu Nov 4 14:05:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12603205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AC2FC433F5 for ; Thu, 4 Nov 2021 14:16:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E631D61247 for ; Thu, 4 Nov 2021 14:16:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E631D61247 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bsdimp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midXG-0002Ac-1E for qemu-devel@archiver.kernel.org; Thu, 04 Nov 2021 10:16:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midO5-0007nN-BO for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:45 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:36738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midO2-00016a-70 for qemu-devel@nongnu.org; Thu, 04 Nov 2021 10:06:41 -0400 Received: by mail-io1-xd33.google.com with SMTP id e144so7023177iof.3 for ; Thu, 04 Nov 2021 07:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+ZNPpOkk6VPcljeu7Kbkpd5a4MaTSH5kT5BRcPYHMyg=; b=zhoQTsjivEs4/Afvof/7U5V2sMoO7bk2skxkaDGTxvBJIe3+vCn7GGMBD0knhd9aM9 VbcxJHfNotdW+VcejNXjqiFcrE680cAyMAia4lDjg5PY+e+qMscAsUewltsZK0BVwgYy keUsdypTvBM/x+ABui0wffMro+hyT18p+6Fy0Dl5l8X0LrrO09xzqqczpPo8HKzmvIBU PGGPPFl5ehGviMramLO21rPCfqNRhgb9Gv4DejNJmCI63cKerF4M12lMQ+SJvchxeDqp Ii3zVSwYBKswgZft6CyWcOi3LBDQYqI14QQAjYOgynOY9NGyQgbA2WD91WtyHvR/PbHc wAEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+ZNPpOkk6VPcljeu7Kbkpd5a4MaTSH5kT5BRcPYHMyg=; b=QCYodwk4WXasUbJuZmqre0WIVt73MpSDXp+yhvr/yqUwiUsr2iH8roaDWb4J/c16BM dPUV5HiqTIw7CnB4gsujZtPIlpKbYJIs3ksAQaZpNq4Jh4HaDwgTEFVV4LC8xuW5V6r6 B3kS3xs2HlScKR6YXcTXR9vdUDMuxj99DXQR7w3hzUi0Tc08+Wni6WcBvh0B4efwryqs wQ7PD9rqGDyu4ImRhtKsbSLB2y0vege9CBhkNr5BhBZ7Dlyaa9kk40vnRXXK7tvq3LKQ G9V7/JTJHarWz1SHkL4oezJsvNlUljnyiNEJglUdZfHZsgA+0gixjQA9BfjRx+/JzSJe Mf4g== X-Gm-Message-State: AOAM533paEimEkBMolo+lG/rCbQCn84T0P5+umNQmhJ1eKjDR2yUfUtZ 4xDJggPvzBygmEQOqUDtN0uF1+anJxlK6A== X-Google-Smtp-Source: ABdhPJwya05Z+S9mWZkbL5Z5WxNczRZiIgvrNqVOwI8zdtkyh61MIZRIorioA7cCubwc+WX3lXT86w== X-Received: by 2002:a5d:9d85:: with SMTP id ay5mr26324871iob.203.1636034796892; Thu, 04 Nov 2021 07:06:36 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id l2sm3206741iln.50.2021.11.04.07.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 07:06:36 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v3 29/29] bsd-user/x86_64/target_arch_signal.h: use new target_os_ucontext.h Date: Thu, 4 Nov 2021 08:05:36 -0600 Message-Id: <20211104140536.42573-30-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211104140536.42573-1-imp@bsdimp.com> References: <20211104140536.42573-1-imp@bsdimp.com> MIME-Version: 1.0 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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kyle Evans , Michael Tokarev , Laurent Vivier , Philippe Mathieu-Daude , Richard Henderson , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/x86_64/target_arch_signal.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/bsd-user/x86_64/target_arch_signal.h b/bsd-user/x86_64/target_arch_signal.h index 55f742b0a8..e84aff948c 100644 --- a/bsd-user/x86_64/target_arch_signal.h +++ b/bsd-user/x86_64/target_arch_signal.h @@ -30,14 +30,7 @@ typedef struct target_mcontext { } target_mcontext_t; -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" struct target_sigframe { abi_ulong sf_signum;