From patchwork Tue Nov 2 22:52: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: 12599745 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 57CFAC433EF for ; Tue, 2 Nov 2021 22:56:40 +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 0EC4B6044F for ; Tue, 2 Nov 2021 22:56:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EC4B6044F 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]:53924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2hr-0005Yp-88 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 18:56:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ek-0006M5-9G for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:26 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:37396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ef-0002l3-PM for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:26 -0400 Received: by mail-io1-xd2c.google.com with SMTP id y73so593243iof.4 for ; Tue, 02 Nov 2021 15:53: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=A3xeQseg7XCe/PHz62qvWhdyf1FsVU4bvG/P2lXDf50=; b=U9EAgY2UWzBeUi1+xQbYvftzEOyEAWQOsxTWaLcTdCeXdoEM15G8UQ/U53gemHS0TB DfVKFDHGJDBkH1J73sSLWM0Y7oAyklu+AsJK/htnpFnMMp7c52SWaokOJlWwCQD6rh/2 ky/e1D/7APDbLXPx4E0LeIzmo06DGn+M2HKni7eYmpKWz2+JdlptaTXqMbnOTOmqQzKr NxXx/XEYuPhZB51NIff1k7C9bDfQY6s+l51+fszsDDWi1+BjJkN1HoDVMmWVsQZSeS2y n1D8+hmdIx7ZA2WYxaXrp789yATsrvtRCvX7sQci4PyvkCd3PPP0NQzi/D7XCWKmBcW2 qi6g== 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=A3xeQseg7XCe/PHz62qvWhdyf1FsVU4bvG/P2lXDf50=; b=HBDzk5cGSqIGcLRWXwjBNWYpSgdT9lZiWNyec4+DBSw4c/VQDzXYadJZnfN0ggS94o QGoPhwxQS124n9hk+xOFmIjIFj2+Yw8dVZtrQby2KV3O8nvHVKkADv/MCAGI6PdJzjCv xxgdLT8+rXJPyae5hlLjAatrLbdCfFLCBLjZNC3Rfp1fqacwswzkkWjies5PukCKMPil Hla/99XI/RSOxpXuP4goUo91EqG8kfDg4YHSOaIlzgLf6YSbI9XR9pYteSZna2JI5c+a cphJuYtF8FCSCEMKfnx+N9C7vEhPVR4o9i7ISU/6CHMANyR40hT7IpfteaGLEA7bHCIL i6jg== X-Gm-Message-State: AOAM531j8dza8RnFdJw9OVzZO7W8rllkYbGdc748lbwcOlqGCuTQ0wXi rPaMCJUdrWEWvXXCkCyOHUWjITjv8xsBAw== X-Google-Smtp-Source: ABdhPJxrOzTswHuhehWPfP+wiSFkMle9PJ8pGFAkQt1fkaYfw+5GOLBfyeGFR9ciwT6gj9fp5Y7fig== X-Received: by 2002:a5e:cb0b:: with SMTP id p11mr28233000iom.41.1635893600372; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:20 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 01/30] bsd-user: Add stubs for new signal routines Date: Tue, 2 Nov 2021 16:52:19 -0600 Message-Id: <20211102225248.52999-2-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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: qemu-trivial@nongnu.org, Kyle Evans , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , Warner Losh Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Until the signal support is merged from the bsd-user fork, we need stubs for cpu_loop_exit_sigsegv and cpu_loop_exit_sigbus to link. These call abort after logging a message. Since singals aren't supported here yet, this is sufficient. Signed-off-by: Warner Losh --- bsd-user/signal.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bsd-user/signal.c b/bsd-user/signal.c index 0c1093deb1..05b277c642 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -20,6 +20,11 @@ #include "qemu/osdep.h" #include "qemu.h" +/* + * Stubbed out routines until we merge signal support from bsd-user + * fork. + */ + /* * Queue a signal so that it will be send to the virtual CPU as soon as * possible. @@ -36,3 +41,19 @@ void signal_init(void) void process_pending_signals(CPUArchState *cpu_env) { } + +void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, bool maperr, uintptr_t ra) +{ + qemu_log_mask(LOG_UNIMP, "No signal support for SIGSEGV\n"); + /* unreachable */ + abort(); +} + +void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, + MMUAccessType access_type, uintptr_t ra) +{ + qemu_log_mask(LOG_UNIMP, "No signal support for SIGBUS\n"); + /* unreachable */ + abort(); +} From patchwork Tue Nov 2 22:52: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: 12599743 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 02086C433F5 for ; Tue, 2 Nov 2021 22:56:10 +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 89D626044F for ; Tue, 2 Nov 2021 22:56:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 89D626044F 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]:51386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2hM-0003oQ-KJ for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 18:56:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ek-0006NU-JY for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:26 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:36835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2eg-0002l9-Bx for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:26 -0400 Received: by mail-io1-xd36.google.com with SMTP id e144so596108iof.3 for ; Tue, 02 Nov 2021 15:53: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=0zcqxxx9i9efPGyMNGiYlMMaZ7Z90otmzxtyKTD4u1s=; b=D6qFPPZIU468jjMQIJUygb0LIUHmNy+L4BJbJdq5NjGqX2UmI9iG+nmNBo6uWsa6zQ FeqvqO6tPwA4qlDoFvTmbEAF3Ipjeh8++nO6dBLseIGZNWMW1Gtc+dZ65wra48XSWEi9 ka3suPGNpzR1OFfAGt/KMVZ8qB0/KSp8ch8oB0JAuF5k2hXOSEmJWNz3kapD6blhMHlC +bZpOCFi73OXCAqOZdOXY+Lw3i1zXpVrFmMLiLckRCdZwIDdE072aPPC7uvqZ+Jgd2eV q2dGvRCaQ+POfoeyZKDPxj5c+N8CQIZbQb9Ss4NreA+5OEBff7UerwZVzw6wvGCxzwLs nAew== 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=Rqyfyv/hPTfa9maQrZQieW80xKO8SflONs/OMxuG0IUyH2vtNqzlUgOkkraXbDuPSq vp6FLU3lbqb/jGjRaD6KsBb7kw58WyHxTlO3f08ra9rNLqtasXko9GMzfio5cSN2vbXz 8Fj+TQg1csuFzpjELFMbtm0uoY9gnP0yj5r6h8YoyogsYoxWrxHr4s9nbbkvPsfqeE5N ZxjHDHNBuX1svoN8lt4FpHgbw4nW2Jvibr0TUEVVUvvdwNC6lX4p4s679ekPW5Ymdv7O KNwizJxRhyhyUWyAFevNvvG1+hBPvqN0Lf1f3z71YhqOVPKuc5vu6aFpbF27f9sSigk1 CB+Q== X-Gm-Message-State: AOAM531YoUEk0wEEryDUuTYms+tL8LeLGqBBScOFSXcoPI4WRQQsaEs9 8sm+oKjGv7CVF8SC+3a9uj+DSEUpYt33xA== X-Google-Smtp-Source: ABdhPJyryHdSGA64tWMMOW79azozgG6Nt7EquTxcCzKsyjFG/NQs271URl5bG4EYM5XKqTt54Z66Hg== X-Received: by 2002:a05:6638:3447:: with SMTP id q7mr5617117jav.136.1635893601149; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:20 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 02/30] bsd-user/arm/target_arch_sysarch.h: Use consistent include guards Date: Tue, 2 Nov 2021 16:52:20 -0600 Message-Id: <20211102225248.52999-3-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599789 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 7A25EC433FE for ; Tue, 2 Nov 2021 23:00:59 +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 3FEED61053 for ; Tue, 2 Nov 2021 23:00:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3FEED61053 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]:39904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2m2-0006lA-4h for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2em-0006U4-6k for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:28 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:39628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2eh-0002lH-Fr for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:27 -0400 Received: by mail-io1-xd2a.google.com with SMTP id h81so581321iof.6 for ; Tue, 02 Nov 2021 15:53: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=5K9w6Dgj9bW+v4mINR6IMzovYCKqh6rwlm+KG2b5Ybg=; b=WJ2X+X5Z5uuP6VuW8UMLWTQ7I7RYV7cGEunMqDGJl0v7y8WTdSTpIlaQtbg6P60IDX VOdhTU3VDjbV3dbRcG0KjOZHyaNG+FhFTZtE1nDtKmSqD3NNrJC/XAIGQFcRZVHztu5p POqaKMZmjJIV9XYJAKwjXQ0+27I3CY64eJwwwqTd+Bt8KV0RCpwan9RFvZlk3mMMhgyV 71X/5EicLpZJ/2VOstpqAYsWmU6oRRxRJqMe9ZYxt1X+UdAXUK6KJt53OhkMGg5MU4gX zmjxGUlG4eapxNapMXnnWvPZQd8QyIQpC1IA8yU98S6IYLipLafpOYuaCrpWJDHdx+5c S4pg== 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=C4podvvIqK++FNxUIhIWavSHPkJkzd+2ss7tEcCFHDGlryGUpkNzmT+JPERD10GhTv CmeZzqRnLa5lkydtcKUM3DabPqRV5CDd+WsdBfXtTcxEYRpGQgrRP0Wwl6ZveRlrjaW0 VA/25bdMtGjew/ZIF9KQ47s6Se45lGe35ftxXheCN7hYBkjMKfNY1qDf9JSaqeVaB8Bw ItcpYWPfaGNfonysvT5q6J4dZhXSiEV2hT0GYq7mR3bH/c+4MiEeyT3faQlH9f88M1pr SBICyj/lhDztMKvmAtLxozbZLuiB+WxBWNA78uADVzCcHWMHMPjHObIU30JJUfG2fdAY rI5w== X-Gm-Message-State: AOAM532lwOSNp8ivOlxMCqaI3kEmufDfI+jbqZ35qCb5nzK1TfXi68id uAEDtkSm+WpKPLdV9kVdxAl8POqS3n8O5Q== X-Google-Smtp-Source: ABdhPJxgYYnJTtDUJHZE1xMLzl9vjYaZ29b+6OCZpOEIebAErGhzpFOkA7Fo+XDfC0Xp3bOwaMt8mg== X-Received: by 2002:a05:6638:3722:: with SMTP id k34mr29810923jav.57.1635893602197; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:21 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 03/30] bsd-user/arm/target_syscall.h: Add copyright and update name Date: Tue, 2 Nov 2021 16:52:21 -0600 Message-Id: <20211102225248.52999-4-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599783 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 70F85C433F5 for ; Tue, 2 Nov 2021 22:58: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 0FF5E60C4A for ; Tue, 2 Nov 2021 22:58:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0FF5E60C4A 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]:60980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2jx-0001pa-KQ for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 18:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2em-0006Vt-Iq for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:28 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:40685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ei-0002lU-JH for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:28 -0400 Received: by mail-il1-x129.google.com with SMTP id k1so653907ilo.7 for ; Tue, 02 Nov 2021 15:53: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=3XmuKD3L8C0RdT+vaSED8BhWG5EV9OjA2AgZ0ahq8Uw=; b=iPyfiSuINy8vkik9L92tVHCkSvee55t7TKi6oopBbKAvlSxhzNzxZzOZf6zOAtZCAN P4iVjJ1UpES78CsTWu2G23WinAMULTeoTo1oJ0NH3E4CaNp/GhWswMr+9UyAes+u4hKK fEO47a0OxQWp6lGRVfsCdwwx4MTyKBnCCIqyPFukId6yRoOCIfOHvt4hQU85TjcnlwHh ZAQa4KMi5CEMk0pRGYLdwPGp5iks0mHNhOVEyLFjc3c6ZHD45EXUviufwNA4jM8xhkyh yJ9ThigJhgCSMr34RzwGzn0IBxAVqTirdgN6C8cewaAB30iZ3kPuMCTEGetmG3GENnV1 EGVw== 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=K/Upqn8ZURSC9kiHhMA7FvUsD8CjgEsCpCHc+/hd2lzZZYMmVEovRZwE3AeYBeA9fJ 7JH6xz7lhbKnkgqsYkLepFy1CYxlhOq/l9kJ1cHAaPYx4OodRRqyekmuRWeW5uh6r6fO DUyCjPQNxFrDwdChIh4ClVe6Iz3GzsPLW/cQPWc/2GtUveKhp4CE5OjbpbK8GSJH2QeH lHvn0bwMRlYaFEHQt8uyIrtPCIRWcaDWY5ku7xW+E2nZUXuAa3SlG0u7HjzI4Yzk1vEB J1j72fkiiExLEyv8ZWGYKVTqJ7zDMqffNLeVCTFP1o5q/Q8gZkAmU/uxTdD8dXMNXzvh 5l4A== X-Gm-Message-State: AOAM532qVLlWBiwgwP+eRXvvWW3HH7NvuWIOTPLmIOg2PwZQqqpGw5jn uQMzDfhdyjSmRSziHOL++IsQOEECE1QVlw== X-Google-Smtp-Source: ABdhPJwAPEE9Jzvh/AipZjx7FP/gErMzutJqaXbI63slYHqxZy7ICAz5EFwSuZPUM1FNaWBaX38ocg== X-Received: by 2002:a05:6e02:1606:: with SMTP id t6mr2909987ilu.40.1635893603334; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:23 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 04/30] bsd-user/arm/target_arch_cpu.c: Target specific TLS routines Date: Tue, 2 Nov 2021 16:52:22 -0600 Message-Id: <20211102225248.52999-5-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599791 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 BC5EEC4332F for ; Tue, 2 Nov 2021 23:01: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 88F9661053 for ; Tue, 2 Nov 2021 23:01:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 88F9661053 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]:41468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2mN-0007mA-Mp for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:01:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2en-0006cj-Vf for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:29 -0400 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:41625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ej-0002ln-Co for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:29 -0400 Received: by mail-il1-x134.google.com with SMTP id i9so645261ilu.8 for ; Tue, 02 Nov 2021 15:53: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=vWKFnk2z7P/FO7vmESDP+3rLyDPPYyXRje+b3kNtLy0=; b=SsavFzzm5ELQ3n5eUrwRAL0d57Ku+6m4olfEy8d5A3B9S0DTnNaJNSVx3dx8viAqUC +Ll8wt6sCrJqSFneu8pGy/tH8/rgzqlD+O8NbTKDL4kromS7AiAFCcz4rGmQCchzF8LJ fOT1kUj1dQT6muMyUo6xPjAAfhdsmHwaf+hdj1/FtVp0uBnqajspRt+V3b6B7qkKtDju u7tzpqgvSzTbh4P0RGU5YXW14nWqgi4P9hkWx+/FGxYO45+/g18pNtzunpi7OS/kWcd/ C3wUcJXIdyENbed1vb5NP/EPuZXRNUdfxkSboJ6nab78RVF5SfjH3FgOzzKz+NMk/Kmk Pc9Q== 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=vWKFnk2z7P/FO7vmESDP+3rLyDPPYyXRje+b3kNtLy0=; b=VDI52YEW21cJ36LAix04s8llr5d5QjliWxWVLegMzy77WA+idHkdAlyK4pUVqXmSP+ MDOkGeSoGsxvQcUmaSjCGDIOMJ27SNKAShcaO8oeUuUUXYqz60QJkDpDbhL72xLjeH99 xbSkkZbTZrkuZeyJGud9/Txi9RN/Yx6HjMhhGPGiDWzJdEe6nN53i+nIzx5JSOuTZi/n WFwtJUrG9I2LLbakJAqhq89jQ6yXr+YvooFb2zRdJHgoyYg26BEk3StRdjCrJUxdUVeO CBLMvMNPCgRNwEkyHspz6mzGKauKN5WmuqGsU3RdXjUHS3OiCGqsaQ3TAUKxJHFM05/5 NdwQ== X-Gm-Message-State: AOAM530wJmHXNWbBRTlb7WvTEx8C9EUu2yoePUB9sl32EvCcKIUbHZxy 5zOIlKB7RtgxlfHWhJPlw3PvdbWJWN88Jg== X-Google-Smtp-Source: ABdhPJxH+baiQsCG1sLdKxKgP11cO5Ifb7U7+X1NlKm/GGMpDpEhhc1Gp/P1eDxa4EwciBFNu1m18Q== X-Received: by 2002:a05:6e02:1e02:: with SMTP id g2mr27732887ila.67.1635893604164; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:23 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 05/30] bsd-user/arm/target_arch_cpu.h: CPU Loop definitions Date: Tue, 2 Nov 2021 16:52:23 -0600 Message-Id: <20211102225248.52999-6-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599787 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 7A230C433F5 for ; Tue, 2 Nov 2021 23:00:59 +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 33966601FC for ; Tue, 2 Nov 2021 23:00:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 33966601FC 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]:39918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2m2-0006lr-4D for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2eo-0006el-CV for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:30 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:37592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ek-0002m0-EZ for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:30 -0400 Received: by mail-il1-x129.google.com with SMTP id h23so665065ila.4 for ; Tue, 02 Nov 2021 15:53: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=IOY3t4AaHZe80iw8hQcSliA4Md0iNA8hrA2Uy7U0qF8=; b=lTpq017Ejx7nCI89/YhtE4NlpT5jMRw/EZO0Ibxsp64jWH4poHGiwtWgHOYy2UrFgk SKa4gQYK4baZyX0gwk9G2HlWw0LWOvIhyCWQDtx2Sk3znFsXBggY3++a6fIeiW0PvELK ScUt41xG6+7jCdPUhBxWTVIO6mJp+rTlommSwLasOQufRuCtJb8x9oWOIp7jlZUIOMj0 qaQIaggKOEswIrwJVZgtMPGShbrblQj388W4ENHc0/UHZO4UvxstJaEZIWuYSECE6scw P8blTg2TxuHbqJkkYNcKnkIVWiLng27j8Y8zV8uTORaaE5cDkUQl5auKIM1Rt2dtg22h iVZA== 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=Bhk2qkAAcxIgrTa2bhAm46PaGGvEkm+/qrNwfdObseIz24908Y/LPsUl9M7oa6/Tge pRRvfEPqn5d4/1F0eSZriS1C596Supa9y4EL4fYfnkhb6emegblsPSV0lJ3BJQhDiiQY DrkCF1mRnNgQDmn/ybkeUUDOtqRGw2Ho7vNeXAJpni7HeqBTBn6G29DxVBE2ktseB6KC 4yfZ48vu3N41Jz+85ZqU7PsfwZ6fxDch899ifDovEj3B0QNKvGNjCyNZ0JNUvD/RmVgF yy6v798p1TG3o2f8XNesSSoZmDsLcDtnXqiBk0pjUk2Ojnnr4WoRzr3AKYvadvtG23v8 cAEw== X-Gm-Message-State: AOAM533fiTVSrUdlOmkijFOiEows0dfDKfsH8aW88R1XcEm0fwCeYq86 1JheiTRX2WeoIfkFo2SEOG8/AhPI65o15Q== X-Google-Smtp-Source: ABdhPJzn0NKXdfVt+SeIVbHGMbNtdA0J64LFw/Ah2iEoqP+iIbLmxm/DAd7dz/jgHpu4W14grPPp9Q== X-Received: by 2002:a92:c263:: with SMTP id h3mr14546011ild.322.1635893605238; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:24 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 06/30] bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs Date: Tue, 2 Nov 2021 16:52:24 -0600 Message-Id: <20211102225248.52999-7-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599795 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 9A529C433EF for ; Tue, 2 Nov 2021 23:03:26 +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 4558C60E8C for ; Tue, 2 Nov 2021 23:03:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4558C60E8C 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]:48548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2oP-00044p-Cf for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:03:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2eq-0006gv-Id for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:32 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:47013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2el-0002mY-L1 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:31 -0400 Received: by mail-io1-xd2a.google.com with SMTP id i79so273150ioa.13 for ; Tue, 02 Nov 2021 15:53:27 -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=xW66KkOERG8vF6g8p4i77zHeNKm4xyF/asZ0Hqjw80oVOfq4GxPJKQ6AhwogEEeWVh v5P/u2dBX00ZZBldYix4PkCIDI2b8Ska+tCWEEzeygBJw1kxkVBQD6VkefmEkwnb31Tm 9kSiSKxgjSOmgrexhPElwABuoV2/XpcDTzweslqBAMQ+e2dbaaeECwAlY7pk398wzBfP osd9QtKgtwNQAOj3e/CCV1ZTv31/QQiLBwx67H52U6apgY7isuUS55bOVK/NNZghyoyP h3BQvWMycoRGTM2bbsvCiXVBUa6nLpvHW6RGiCowpN2GVgClg3U3KkKwPOvSI4Hkx4S0 zb7g== 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=ZRHbsSMcEg7Enon3KCDIqJgFFWdBydGUaugXqIct6eu05M0yTOAl3rqv8TwePlEznN BUHE23ongcYzxiFmenJMu14DRQiKloBkgVFcrARYmkHOj404Ef2A8eIs04p58oMjg7HX 5x6DBEOFiqiLdI0G+1r3o8aURVGsdRyqCrrD3niX11rdARTVSxEHuwkDuaGqcjxGVD7r VSeI0ZP+90QYhOQe7k6iuBeGPYWgK5fDw9V9BufkdYdqhsP9k0xM4oD6IQGIlKQmimb3 FLN/teWN9mwFUE0qZtghLslL4ps8Z7ZRHv2Zf0xuVC2o2Nw+emYHKTOMVOZXsJyzgKOH BidA== X-Gm-Message-State: AOAM533DXEb7yiwAs6eaLx3/oOXfiktrAyvjdk6fbnTzrqLANp4HRJrr 9aqeYkV7CSID+vE/UtgpWsfU7ii+WwSmlA== X-Google-Smtp-Source: ABdhPJy1Y8E7TpfQDGmxjQghpBhRF3wKmM+s78reJg/82FIUa3gBFM01uOcRkfCfbJlFT0w0Tt1UZg== X-Received: by 2002:a02:7154:: with SMTP id n20mr29728590jaf.77.1635893606384; Tue, 02 Nov 2021 15:53:26 -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 h14sm205427ils.75.2021.11.02.15.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:25 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 07/30] bsd-user/arm/target_arch_cpu.h: Dummy target_cpu_loop implementation Date: Tue, 2 Nov 2021 16:52:25 -0600 Message-Id: <20211102225248.52999-8-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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: Sean Bruno , Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599801 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 4084DC433EF for ; Tue, 2 Nov 2021 23:06:05 +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 E8BB760F5A for ; Tue, 2 Nov 2021 23:06:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E8BB760F5A 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]:57190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2qx-0001Xp-Vj for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:06:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2er-0006jB-0R for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:33 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]:37595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2em-0002mm-H2 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:32 -0400 Received: by mail-il1-x12c.google.com with SMTP id h23so665133ila.4 for ; Tue, 02 Nov 2021 15:53: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=64miHBZXEKxjl3fY4eYDmzdZPEyQwCOLyDx85z6jOa4=; b=wZvNGPtrHXL41JzlEF/N2q7voQQQRwp4E8byefibDwXxAaojQW+VwDTTsggob1Uq+W bT2YczEYSDgjKQ0dmU5FpVrDleDlqpYeOBnX8suUMLKhUX1mTRUj5arlvkV/B1sewRZ7 zga92A0ASHYJQa592NnKBEkP4eOYF5CDOhLcZ6ZXP1hZZiHGXsj+YC/cp+jX1QUTN1MQ pCSFDsK34ws5AtnSzGQfY26hdW0d7hkvjimki/kXNnzeZou9G5BythNuajqqFhRplJvX iRulTPv6+eHWE/3DOto3VTdGK7OflfafcYwsPH9hGeGMRr1PbtjYDtztFdAD7Y0GVGGJ usUA== 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=64miHBZXEKxjl3fY4eYDmzdZPEyQwCOLyDx85z6jOa4=; b=voiLv02u5k6r/JMeUu+CCAWZZsz61g46XanGs75DJNdqJW1n0bO5g79/YDieGKf+yJ EWYXEar7EuyX0/f5ouCF22EHZsJOOwEUsJjP+gzTJmLxVGpcdY6ti038+ElR+Ul9YK1w 9vSCSa70e2R4Ju9Iy7Ds73UPuAFSAdPoVvs/e5b5KQ4DxUOJ82OJb2PUWsrvVZ2CiPjD EM4uI7MGTY85o0ll/IuQJQsXy8DnLi/v5tC+3Am6nVc/NgHUA0YSqsFvOPSbD3ARrqhY JnCCTSunqpeHfOqQNDITVIfKG9MyyBCnMKYAUxn0n+vXte7M84ZfLo6KCSKoUUBEGCa/ uW0w== X-Gm-Message-State: AOAM531CeldXlbqp8y4wAKMrwmLwqzlW6LHnluT+yfxP6LgB0+r3NHIp yDx1eiq7Efhka7WpXr5CjuY0kGomWYcjHA== X-Google-Smtp-Source: ABdhPJyy6kgZPBHvGvQPHE1k2JzNf2lT/uikBkaA7cMbtL7vl0dDJAusKOihtACdK1q03116XLZdVQ== X-Received: by 2002:a05:6e02:219a:: with SMTP id j26mr20361074ila.287.1635893607332; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:27 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 08/30] bsd-user/arm/target_arch_cpu.h: Implement trivial EXCP exceptions Date: Tue, 2 Nov 2021 16:52:26 -0600 Message-Id: <20211102225248.52999-9-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , =?utf-8?q?Mika=C3=ABl_Urankar?= , 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 --- bsd-user/arm/target_arch_cpu.h | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 2484bdc2f7..609b78b4e2 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -48,6 +48,64 @@ 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]; + + /* + * Make sure the PC is correctly aligned. (It should + * be.) + */ + if ((info.si_addr & 3) != 0) { + info.si_signo = TARGET_SIGILL; + info.si_errno = 0; + info.si_code = TARGET_ILL_ILLADR; + queue_signal(env, info.si_signo, &info); + } else { + int rc = 0; +#ifdef NOT_YET + uint32_t opcode; + + /* + * Get the opcode. + * + * FIXME - what to do if get_user() fails? + */ + get_user_u32(opcode, env->regs[15]); + + /* Check the opcode with CP handlers we may have. */ + rc = EmulateAll(opcode, &ts->fpa, env); +#endif /* NOT_YET */ + if (rc == 0) { + /* illegal instruction */ + info.si_signo = TARGET_SIGILL; + info.si_errno = 0; + info.si_code = TARGET_ILL_ILLOPC; + queue_signal(env, info.si_signo, &info); + } + } + } + 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 Tue Nov 2 22:52: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: 12599809 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 7F255C433F5 for ; Tue, 2 Nov 2021 23:08:40 +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 1AA8160EBD for ; Tue, 2 Nov 2021 23:08:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AA8160EBD 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]:37606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2tS-0007Qj-W6 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:08:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2er-0006lb-HX for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:33 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:36831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2en-0002nF-JD for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:33 -0400 Received: by mail-io1-xd31.google.com with SMTP id e144so596385iof.3 for ; Tue, 02 Nov 2021 15:53: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=OWk7jgZj/MHyj5WnW05WLTLrlZ4T/i5ovr49MB5ozuI=; b=u+k0FlXwN3UBJDubPLSZYDWuSnoaXqUmWKX0o3cxu8JSvcvNU2eaDQOdL1dKvAPNy4 RoFq0MH2c+Lksl1TGjlqaQczv7mN+rVT/7ClCOS9ZcvlH+aPDRop1gRvKgX/Q2YWhBOH N9oUY0dQNRgfNg0sIDcdV+5nSUClHFN30g42GYzY3itPlWUekwIhzUOhYE58moZIUSo9 iwODhHwzAOSRxJ+pldKXRl5DFmycgS7fP4fJUfjRlSleNFvgEZP1oZTsZ1qhcwyG4XQo ULExiPjmLeLZKJHFH9w1murND3JC+r/zAKg7zH2w7dh32KDRZy126Qnk++UPgKMIE3Ml AWkw== 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=OWk7jgZj/MHyj5WnW05WLTLrlZ4T/i5ovr49MB5ozuI=; b=JFmWOmuVIGqPzq+Yt6bSuX0Pw/KXJuMSWn4gBiW/9BnDlbDzTF6gf/5MMNG1ouVBzy iZh/XTA9Uh2SbrXSNdFnElhSjravArGlwqYbB8vWYZuTiPfdjnAa3Q+nkLoRYxpM6/P/ 2o7PAgPmx/Y7iUm0qLmYyR8A/OjJGUw3n5emKz8KAhk+fwBW0oBNRNFyap4zWLaWU6oQ 6cyuLu9iUpzMfr6niHj9emgvCCbJPK/iIVR+2ZWNpaRtThMpzHNWvD5jSk317Wth2OKu ZEX7C2a5DTpyyfeA6fWnPCgJsNYNcPI4uUnf2dT3BJpTzDTD6/o+21RD+kaqT4Sy3GSf sPwQ== X-Gm-Message-State: AOAM531QiBX6LvfQQ7KBnHeEEKw4IYYtAZSVqEtw9R/cu8qOnPfpbRJ5 B+8QvBAZipB8JYq2DxHhU8LsfYJGTgEnnQ== X-Google-Smtp-Source: ABdhPJwFbeVxJrdV7whbdOQg9rJFIaLVXeUe7OWWuGNDFXuq+ykGlmw9sUS5LvUbXszKbBxmnU7eMA== X-Received: by 2002:a05:6602:2b0b:: with SMTP id p11mr28960325iov.62.1635893608383; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:28 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 09/30] bsd-user/arm/target_arch_cpu.h: Implement data abort exceptions Date: Tue, 2 Nov 2021 16:52:27 -0600 Message-Id: <20211102225248.52999-10-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 609b78b4e2..cdb9440a65 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -90,6 +90,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 Tue Nov 2 22:52: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: 12599815 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 45A59C433EF for ; Tue, 2 Nov 2021 23:13:34 +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 B183F61058 for ; Tue, 2 Nov 2021 23:13:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B183F61058 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]:47640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2yC-0005zf-KX for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:13:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2es-0006r1-UW for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:34 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:34559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2eq-0002nj-IQ for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:34 -0400 Received: by mail-io1-xd32.google.com with SMTP id b203so609368iof.1 for ; Tue, 02 Nov 2021 15:53: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=WEtSw0e1OoCnEPOeKTHBUWYo/YNsC3SH2hpvIjNKUwM=; b=c9K9kR0DBh00Ziq7FGrFBpcwY4hv83ucZrutu7YbnC/iFbixEX9uOGwYuaZ/1hQGCG dTKWaFMavW9uAw2PXYCVM6sV2Tp6VrfQ3PSp2+neWoyFDBfVHr2mYhyZBZBfAhYdEmao kiP7HcpV5IEyv76EWD8PZ3blccX9+INx7RTUy01HNldU8BkEnldx63vox6WDMyZrYEJb 0UK5/Rv4kmw9G5QEqKc9ycprjB4LY5Dq2g3XWdV5xu13FjdDzawHWWLouWgen/m8yFV9 /+zom4YKaUqgJWzJCtyQEJBvDbBB+dtYorKBDsipU85QkdRBk0NQKpjfYkmRECJdc0tB d4QA== 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=WEtSw0e1OoCnEPOeKTHBUWYo/YNsC3SH2hpvIjNKUwM=; b=vVTt/WWnP97kqoOu/yLECCUbszMbPtshdPhQ4O4U6L2M+E/ob4IaVlTZHmc2fmdSuw wW3twl5FBFzZ0S2nf80gaDfmKPBzU1LlDEA/QGdsC7Tm7kPl9y8ORYyCzPlecZRGpCjt fTn0ixg7ZdFAPzI4TryGr1ADSw23oweSacuYmaw8TfadDQO+yury5Qc43JECAPjQQjL1 R/WlPGTSw8W6uBDoAMQgua/7oUVhwAFEooxZnf5PHZtFe2WDzstOKBNmJ7VgUlhb3Nxz tvBHWECC6HIxYMxnUxGzfMkdNwZs4D/aAwyAeJcmRkuvWMIH0x5Dq9hE4EHiF3bBUzt8 hGhg== X-Gm-Message-State: AOAM532Ink0x3nL73o7Cf4e4cEry6E1Dhc3eIaxPWLuYi5bz20EQA8t8 VYEfJ0fG9VcokTBEV3fu6V2gzOv7FVJXcw== X-Google-Smtp-Source: ABdhPJzPnqI8fKdPHcfw2ARAeaCa1UQn4em2lkSDpL1W3TuDXTGFL/J4QfuE1xjVYkuWeSKEBgdo6Q== X-Received: by 2002:a6b:b5c2:: with SMTP id e185mr28878975iof.127.1635893609244; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:28 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 10/30] bsd-user/arm/target_arch_cpu.h: Implement system call dispatch Date: Tue, 2 Nov 2021 16:52:28 -0600 Message-Id: <20211102225248.52999-11-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 cdb9440a65..e784c103a0 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 (;;) { @@ -87,6 +88,99 @@ static inline void target_cpu_loop(CPUARMState *env) } } 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 Tue Nov 2 22:52: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: 12599821 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 52EC2C433F5 for ; Tue, 2 Nov 2021 23:15:19 +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 0391E61073 for ; Tue, 2 Nov 2021 23:15:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0391E61073 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]:54178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2zt-0001wO-4i for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:15:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2et-0006t2-Gq for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:35 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:39640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2er-0002oN-AM for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:35 -0400 Received: by mail-io1-xd36.google.com with SMTP id h81so581637iof.6 for ; Tue, 02 Nov 2021 15:53: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=rKLMBYjEYlw1VjEHepSl0BqgSbBEPtGPWDcDEzPgUqg=; b=s/dtzSAI51H8TR5ZhoFwmRVrAfBAtWMXZyF+/ihwVs4i4zKxWY/ulOdVj5OP5XSDYN eMcFwcdWLQHKKnWchU7aVXK3igNR+c6bz6Wo/4OpGdC2s16PSB0ZOn0Yqm3ayLfA6ZZm A6AdXUVKHmVd9xJwo9hbQ+edLH+Y+iOoBLD2QXov1ZimgRzk6DVKpoVgLNiEscwIlnuh wqWCV215rQoMGtRf030J1GMnldHbBoCPxb62dfeyWDp+4YNpA9liWLcTYIlnpIrETseV 1lPiGBOeiv0nW86UBAkE0tWwE4DSAKnmE44G8gaTaedKP8zfsT6zDKdyn/wTxFtvNdyS 8yAw== 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=6grfFuG99Pfne1c/MlUeb1p/2iBgnKmMDpVcZ1M6txrGYuA6D77DzWLnCNiEig5jfE 2p0Fg6V+/OeLzUO8YCFFMTKqHzlWuaIbMsCxNqHnq9y8dFSzMMhF4fr+9UlUZM4mGB4e k1bzhkYMMyCdVXfDw8Z29V51dBu7bT+d0ZlV2vbC6qXu/J0TTHrpRylrl+REF8s66MDc n0gfXqWfzCjEX0Tf2wvX9wkUyVSbXBnLCXbeTnvmjW9pkrZKkTGWWasG95bf6pmv3JmP R4/pmtjCgUX8g2ZxaaySdFPCN9/GWy+W4Xo+cwZd9fcGThr/Jf2hAN+oBhLo/PXf+45E vv/g== X-Gm-Message-State: AOAM530fy/TRaXB8dgL3lbe2DrqiAzq8FCMXFw2GlTvEwxIHqzJ83tD5 DYuPRDG+rMn3R6F8NLMhNbF906CXT1rmCg== X-Google-Smtp-Source: ABdhPJxZv2zX29Q8gXYvRTXEOXB2/l9gBZXJSEqZJ0FZueVXpe0dDXsIXhYIEw2VqbdzxmTpev5rsg== X-Received: by 2002:a05:6638:33a8:: with SMTP id h40mr28762842jav.4.1635893610040; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:29 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 11/30] bsd-user/arm/target_arch_reg.h: Implement core dump register copying Date: Tue, 2 Nov 2021 16:52:29 -0600 Message-Id: <20211102225248.52999-12-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599797 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 0357CC433EF for ; Tue, 2 Nov 2021 23:03: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 A0E5560E8C for ; Tue, 2 Nov 2021 23:03:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A0E5560E8C 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]:49310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2oj-0004c6-Cv for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2et-0006v6-S3 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:35 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:35573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2er-0002om-6O for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:35 -0400 Received: by mail-io1-xd36.google.com with SMTP id 62so605971iou.2 for ; Tue, 02 Nov 2021 15:53: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=1ztRBQYqWrUwRLf6NQ4W8izvboRcDbY0eKrhIvHHz3I=; b=BGD2UTLi4Ju6JmOuJFbnAx2mntUjb987wXDGhmKk6MiVxO2n1G7+hg7CumnwyXzmIm nfZ91Dz+pHJvcblcTEHj2T+RL0Qa8E5zwQFF7M9h5Fpx4H4HhgGKG2+F+rEWupuhyUy9 gBgAn/b5991fdOwRTmxzkRSlI9DPbZS7dQ4Eugj48oR1DAzGliZsa/WUHgg5sTWhv0/H IvjMajzfwfPYyKh8zIHNLXK2JVPnJo4XHfs15n/c6marXuPj+QVN5CqZMhChbOknAfag CCuZe7+wwEPU8ob5z5rlna/DwrlR754h+WkMRWi+JsvMtk8CP2H5b8xl+EQvQ+252RSX U/SA== 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=exUeEjnF23+aYrOYG7N7fa5t2+ved7JLqgWe7iErQKt4yhli3xJOo39AFX0rIQj4Zb LZGX4cbR2nZzbKmpIrPkxwrooApU6kx6pc2WQx2KgVWvCLZ2/phB+vPTEQvRJ6lxL2vs BjHRHpj5xgu06Yja0wDzEN/Ca48aWjpWSle6TglXj39ZhlR7NSA8NlprTYwKGoZC3uiR IxhDn3+fMyH9oK7utsqR0piS3tJjJji9ITyPkvEx4Us08EDNtTdwlk/mXMwo/Nqz42OD LNtsURj3/EXMQc5bZEOGhkH78r9x+/9y8m6dgUOxzOBO+sj80T+PelBH+i7Dfs5HnLED RfSg== X-Gm-Message-State: AOAM531svFMdBZvRoDEUPuAi5iCsxSUYmDMjA38Dm2/yUE2JlgpON4v+ WX7KGhhjf46AwY5ohpAFkpJgd0ZTC5adlw== X-Google-Smtp-Source: ABdhPJy+bpUQf+S/yL0o+BPYJOzY+9MbbD1b+9BkvEKNuNYvdpqSxYGj9kng++4rWuYh1R2DBSbwOw== X-Received: by 2002:a5e:9301:: with SMTP id k1mr3650811iom.118.1635893610895; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:30 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 12/30] bsd-user/arm/target_arch_vmparam.h: Parameters for arm address space Date: Tue, 2 Nov 2021 16:52:30 -0600 Message-Id: <20211102225248.52999-13-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599785 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 8E818C433EF for ; Tue, 2 Nov 2021 23:00:40 +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 4604160C4A for ; Tue, 2 Nov 2021 23:00:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4604160C4A 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]:38380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2lj-0005jP-BK for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:00:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ev-00071J-6r for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:37 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:35565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2es-0002pd-Tr for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:36 -0400 Received: by mail-io1-xd2d.google.com with SMTP id 62so606174iou.2 for ; Tue, 02 Nov 2021 15:53: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=F9IbbLGjnRnokIuDKxQfCzJoAx075CoGnpnzgfUmRKo=; b=vy6e8tNZROOdFDQyZxG2MTR1EPgOBt/EBLKpWF+ANbjnjCZLZ1vpw+TvuwivPjRe1g fkrzvYbpKXf1PP4mbLPwcs94afw5Ay3MOEEqI67KVMcYoZzpABPmqtLDFu7AejM5KNjw TwYjbiRde+0Iu1xgtZ9Dm8y4+lxsT9fWyos+cYdmTDIU6G2Ij3hoLsc3GOsG82DJstEq SWSwx839DdjTMmr97OeLYvLvInlg/OfljJfg+8Z7sQ3fUy/MpzYieNl+XYGlJqFwC+bQ 7IOeM+JC+yb7oPtZScmZ9/Zq5kEl+6OFh94KPkVQqpmIURJ6WSULm1Hm3Q30OKDDH91u CaZA== 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=72Z6OXfRcPye3+Z91rW0lhW6DUEpVhGk2wWHQwB56xjcQDvspUTERuYHoi02BcGFUJ 8cskBnvUQ8dZG9jMpO7grWWy5WGtIZTZlXq5xsM7NI2ZEupm0g2EpwvCSJUSBowUAWuf kLEwQhNXRf3kWDxlmL/oHi8UOEAI8kZgyXLcMCaMEWZlIupQg8GdDlB9vJ7xcsaoxPCz ozTKbEfxZvsnOSnEKdG+OXkyShC2s8AvKuYUPiQ52g9g7HcwNp/t34l0ENYMQWrcLx/4 1WfgMESUuri8nEMRdA3RXZyAbbohjg5lDGjsHLbpkjbrVh8pje/nQzquxXXK+PpfnDAE 2Dkg== X-Gm-Message-State: AOAM533MRYMXNim+xbjC1uWvogCloyZDsUVxTTasYVuMQ1qIM4ilN+99 PHyUZW6pU2G+ZBYWZcSqZpWa/y+eC/AGTw== X-Google-Smtp-Source: ABdhPJxtfAMNPTpfIwWljKAQYxdyJ57+wlchjUyznx7567i0U3qrmLb+O96wlBDgOiQTh1BREFWoVw== X-Received: by 2002:a05:6638:29b:: with SMTP id c27mr13148859jaq.67.1635893611933; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:31 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 13/30] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm Date: Tue, 2 Nov 2021 16:52:31 -0600 Message-Id: <20211102225248.52999-14-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599799 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 D58E4C433F5 for ; Tue, 2 Nov 2021 23:04:06 +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 76B5060F5A for ; Tue, 2 Nov 2021 23:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76B5060F5A 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]:50934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2p3-0005kT-Lr for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:04:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ew-00075y-AV for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:38 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:39636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2eu-0002qB-9b for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:38 -0400 Received: by mail-io1-xd31.google.com with SMTP id h81so581870iof.6 for ; Tue, 02 Nov 2021 15:53:35 -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=6DB47UhSMx0NROvdpxbbFKEeEEfM+Jod+IqssIJkyio=; b=YJyo8iQj8KPiGpUA+NO4uFiQIhI2eunq9LSV3pMJ80s6MTXD10JBWlMV7BySjho9wZ pt0q67XzmDxv9v59Jnc6UV76cKdNkgKUZGerBeR/o5B/8mEKb9HDvB2w3s+oTVmAGxfu ravgq5FLRsGoT1pnxmcmYB45yC5pjqfAuAiOtfraMzhdB9qRgo3jvYH50Ep9/ivRpy0+ fmV85Bqt3rQ+L8SWpY0tdVGUpoXOQS0Trjf7kWn75RXPLY3P/ohi5FtWfJWYgxYIRudF 02aHlJVefBHUNY6yj4l6hY5qFnMjHfUOlXVxBmyZof5euuK9AndOMuOTY1PxRP6s72pl kcBQ== 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=6DB47UhSMx0NROvdpxbbFKEeEEfM+Jod+IqssIJkyio=; b=u4u/1mXpCnLwEHl/dHYMvB9Eul4gfOpTFo1+2A1dgDg4+3Ej0AjJ7V/AHUA8gG9vy9 idWN6qc+EQmpK4UOl0nCv1uaneA7/tj5dvTXNTD/csNC1nkG5+iThcNjyptk5Z6y5BuK Vyr4/CLnYKy359Nf3dPQGMEidmjI0xUx+IOjzpSTO4cFUMUMEHlJsuNMBVsCDVGNzJ3q 0nk8XZedEJYz+PPkJ9NoSXicVhmWBMfPkiLQF5VrjsOG0Np+0tloK/Z8VfjVBYPhsdUJ uNL7AMVeaiVZ5MgrsTxmxsujg28Y6XR/lylIOwrvYQW9F1m/z7/ahpQwr0Q+TT+aCdhB olow== X-Gm-Message-State: AOAM53340txDxZLAHSc4XG8nULR4W+OdNy1JPPmpK81j3cX2smgOYMSt izdDr2FQBk0uv6A7eBJBfRNS8Ef4vZnatw== X-Google-Smtp-Source: ABdhPJwydmAVEm7p3xgADwaWtVOa60s2Q2rHjDp79xILx0soXN2+emRbdSe8eRt/xE+ggcRJuWamUQ== X-Received: by 2002:a05:6638:22d6:: with SMTP id j22mr8667717jat.97.1635893615104; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:34 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 14/30] bsd-user/arm/target_arch_thread.h: Routines to create and switch to a thread Date: Tue, 2 Nov 2021 16:52:32 -0600 Message-Id: <20211102225248.52999-15-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 | 80 +++++++++++++++++++++++++++++++ 1 file changed, 80 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..ae5b0d6c38 --- /dev/null +++ b/bsd-user/arm/target_arch_thread.h @@ -0,0 +1,80 @@ +/* + * 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. + */ + if (entry & 0x1) { + cpsr_write(env, cpsr_read(env) | 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 = 0x10; + /* + * 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 = infop->start_stack; + if (bsd_type == target_freebsd) { + regs->ARM_lr = infop->entry & 0xfffffffe; + } + /* FIXME - what to for failure of get_user()? */ + get_user_ual(regs->ARM_r2, stack + 8); /* envp */ + get_user_ual(regs->ARM_r1, stack + 4); /* envp */ + /* XXX: it seems that r0 is zeroed after ! */ + regs->ARM_r0 = 0; + /* For uClinux PIC binaries. */ + /* XXX: Linux does this only on ARM with no MMU (do we care ?) */ + regs->ARM_r10 = infop->start_data; +} + +#endif /* !_TARGET_ARCH_THREAD_H_ */ From patchwork Tue Nov 2 22:52: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: 12599807 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 732F4C433EF for ; Tue, 2 Nov 2021 23:07:38 +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 36F0860F5A for ; Tue, 2 Nov 2021 23:07:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 36F0860F5A 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]:60844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2sT-00047s-Cd for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:07:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ez-0007Av-CX for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:41 -0400 Received: from mail-il1-x129.google.com ([2607:f8b0:4864:20::129]:45778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ev-0002qP-0Z for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:41 -0400 Received: by mail-il1-x129.google.com with SMTP id i12so626047ila.12 for ; Tue, 02 Nov 2021 15:53: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=oLmdczkCWtTXgS+hIrrLVL8jr4D4Q93OjOn0dkypiZQ=; b=UkDisWA5favtvBrnRYgu3Zh7u4yVI2YftcY51MkpjyL8An+/5O0NfOjDRMeGBtpQVy iN63brvCs2RpRRQZBeUmA2cBOP0Gu869Mx8mrjC813dn95bRwSQWanm//YoeCnoXA9nE bRolsj0IVam+KRM5fK93cHhiI0OxkcJn9z+TvcunkrXj6EWDNHxS9mXMhIJBTgdyJkDZ gv3T3R3iCrlTTyOCxXpWYdNFv9tlKZQC52QnqjXZYYaDbFg236gsXVYn0ZnGWdscwa3d CQlDa6F/J9B+xV8JXIb31rnUr2/z1vWqr35uJxj9CNN9VpSMu7S2MM4h2m8K1IxzS/nx fqVg== 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=F05mtkWppO0xrP/8LtsAxDgKWWoePwNaWgh4uEaOVlFmw50J3RClHYrnawwjGDGba8 XTSbEj8FrM3wBbWJX/zqIHK7mYy/Z5IBo0iSocxfGPIu1JYBdcC1qepkC984f+u7sB8d vwRD3LRrxQkSm+QqTssnF569C+p9V4P/Oa8Wcw2pC8+pu8qILCM9rS9X81i3NZpzx/AB HITDwchhcKWFctqV6SMi034HOSc7WAxfsliwqucG1mikI76WFeOttjSKBZhbT6L1ODme LdRL3wa/42bspFc1lZ/fF6bC+mSvgxYazb8WFxpdmd0i70BtofDyb8IH6q88QqHP1/XX p6oQ== X-Gm-Message-State: AOAM532XktBR3yeTG57vBboU+mn4Bu/sna1IpxxZ5+TJ++HFScRZpPY2 v48neFoPwlnPq0jo6Gr1x6qvdmmKd/iKag== X-Google-Smtp-Source: ABdhPJxtEMjONA/W4p7sPlXWM/qmz8NNFe0XSg/KJdgU4A3TmxQNRJSPMyS9bPUDL0MlCvtZsSUkXQ== X-Received: by 2002:a92:3642:: with SMTP id d2mr27886722ilf.234.1635893615857; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:35 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 15/30] bsd-user/arm/target_arch_elf.h: arm defines for ELF Date: Tue, 2 Nov 2021 16:52:33 -0600 Message-Id: <20211102225248.52999-16-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599805 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 62804C433F5 for ; Tue, 2 Nov 2021 23:07:31 +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 2794160EB8 for ; Tue, 2 Nov 2021 23:07:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2794160EB8 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]:60024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2sM-0003ZS-96 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:07:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2ez-0007Ca-PG for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:41 -0400 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:46878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ew-0002qp-AM for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:41 -0400 Received: by mail-il1-x12e.google.com with SMTP id w10so620162ilc.13 for ; Tue, 02 Nov 2021 15:53: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=8R82c+oSIU+sp8WqnJE/Io3vjzLSVpjkS5kzwk9Q/Pk=; b=yoKxXzKruG38Sym/QIfwoS0rqD2TO1zhTl6i+FeuxYtn0pOo3yyrEcG3yPCkFwnh7k S3BXbiDsplLIFlIyHvrhmhBWeXru2dp+qWI6kRpxfAp79/KHFVATagmUTld1Iww4WCHe ssU4aQF++nJ5d8ysaqD8wo1CIiB+P6mV6xzl2LCQkrMWifn723rN3PvgyIFj1fwaeHdQ kuv3oApsEM9CRM5uTrzpBNynS35YIxOzz5bCeYtST/mRttRFaoq377wlSbSFtS12kuZu xuKze3zadLKiwI8Wo3iSGmsHDoolP7X73JKE/TYSQacwCCOwE9gREEWTrYiU8982Pju4 YtVg== 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=XoWcypbUWADzp9QNclzG8WpsDIE+3jIEXyry7d7gTuCu1zkCTGy1RvmS8zsYvBH5Ke loAtedyO5XYJWaeE1OtHi6sHGijagRlD7TSkygwquUuuGuAMmaFLupkNQMensvjF5HON 7MYLB6iCnCjXxNLSDfeRKYTu1p1NytyaO4s45aNdoUFyRMBAFK3P43SpuBO8kl7QAh4k QvRRKAmD1xXA7b0VRDdLuVCQZSlWcy9G0EhdUO7ym0Z+Seu5/gEBl+xrxhtkBZzxrqp9 17/h16HQ2MD069p9kgXKGUqnu52Ok+p+EVSALFlWTo1mzbzsIDPzj3DrXPftVxjL/jas S3rQ== X-Gm-Message-State: AOAM532mphyBxO7MUFzbXA/B0HfQsgMwt7H9RKUkWO1je5t2yf2R/9Wp rgpzWX0B2qIHkM7fPhSN/UuqoiaIXY+G8A== X-Google-Smtp-Source: ABdhPJyfBudhkohZ1Rnde3bBnWQaZ4bSznmoWC5R36XqYWBcO88JVj2nOC1zQhNIZJyuEY7HkMjVMw== X-Received: by 2002:a05:6e02:1a0a:: with SMTP id s10mr29411994ild.76.1635893616999; Tue, 02 Nov 2021 15:53: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 h14sm205427ils.75.2021.11.02.15.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:36 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 16/30] bsd-user/arm/target_arch_elf.h: arm get hwcap Date: Tue, 2 Nov 2021 16:52:34 -0600 Message-Id: <20211102225248.52999-17-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::12e; envelope-from=imp@bsdimp.com; helo=mail-il1-x12e.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599793 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 547FCC433F5 for ; Tue, 2 Nov 2021 23:03:03 +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 1766360E05 for ; Tue, 2 Nov 2021 23:03:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1766360E05 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]:48026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2o1-0003kU-Us for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:03:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f1-0007JI-9M for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:43 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:42558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ey-0002r8-Vg for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:42 -0400 Received: by mail-io1-xd2e.google.com with SMTP id n128so562900iod.9 for ; Tue, 02 Nov 2021 15:53:38 -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=jQWnxoEziai3SJE6ywkOR4R8P+qr1tU+Ov+7QU1XTo6Z3KuLzt+/wPT10oG4ypqwPj glsSLW+FZAB8YIZ5j7GsoOwF2xO7vTgAX/d6h4IEPZ7L5ZGO1jJ9dmd8nPMqpzDSKlZB wn/v9oNJiqDH5VOEf55NhaiTuKIk8dQCX7C8WTvoSWaB/dNJeCMx/wRFmvDi9iU6Wmdv t4ts1mUCsXCAZgrV4Jn7kIfIYNbsa7cLEvqMA72Cj6vPPE7Z2InKwRFv39NtD8Jx6s1E NDN4Ir2TUIzZvgIooexRB+YJOBHWkf+RlT2SXmB7kJvutQQl6hmDxnw3o+YyjB6yrsTs zI8w== 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=5O5ylUf0BepPRLniOA0rNCC2J96G/KKvRVNM83kiG9w06sSBhaQtkxi8ppTsAv0S0w 3dcQF0RNIYA8myLoVuusWtsFHP1PPtxgN7PEGUFWudb6kKwFVxfSrv9iCFdPMQWNJd4A 0/FrQDIcm822j09TV6s82wOrNJbqtJhNXgu9uVgTe25zGDmletgHfGMuPEB64abak3to 7yk3ZJ+vPaC+9Ti7ix1lIXA1iAEI8IvqNLAQ8A/YqxvmUSbc3Sw0qvXpdNGLeyABAABq FBBIwUlvpb4Db9oSUnZpu5a8VUKX5R7sozlwKv16auc53903ZSVem+7YlabXHW70+ZGH 3O8Q== X-Gm-Message-State: AOAM53000+w4qGIiQzhzBBtj8cOYBCLhv9lL/QJfXdfGqidN9YS5guAG G7nU3OcErnIyQjDaqEOsYeLv6pWPFrJSPA== X-Google-Smtp-Source: ABdhPJy0s321dQIXr+0Nc2hYhstT1z2z9+xitHUjyDNQ1yrmKBAd8TiN0ZzgNhFlSn629f0OMzyb/w== X-Received: by 2002:a5d:8ad2:: with SMTP id e18mr28345809iot.144.1635893618027; Tue, 02 Nov 2021 15:53:38 -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 h14sm205427ils.75.2021.11.02.15.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:37 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 17/30] bsd-user/arm/target_arch_elf.h: arm get_hwcap2 impl Date: Tue, 2 Nov 2021 16:52:35 -0600 Message-Id: <20211102225248.52999-18-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52: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: 12599829 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 C0DA2C433EF for ; Tue, 2 Nov 2021 23:19:19 +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 6BDEC60EB9 for ; Tue, 2 Nov 2021 23:19:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6BDEC60EB9 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]:35518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi33j-0008Rc-Kg for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f3-0007S9-7Q for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:45 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:39640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ez-0002rJ-ER for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:44 -0400 Received: by mail-io1-xd35.google.com with SMTP id h81so582045iof.6 for ; Tue, 02 Nov 2021 15:53:40 -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=crPhJy59MKpji7XeYQ6bfKjbA//sfiHqEKw3bAcAfno=; b=mldgy1i8lu6/cfOfAvSpK/LykAQO4D7Pkr+uKkua/homUz5Drv02CCVyO8hriLNVKP 4VxJ1talzv9UbcbnvGRHW7pdhF2kW1P5crbKiJc25W4plxCnx0fiOrjOIHym6BUZWnZP f1GsIdJ7HPZoHprBucN3R/bbwHBXw8xmYAdrme+ttUX9tUD74cn7FaT7+dbTvQbnWTEB g9CgvGKxnOzJz4E1NZU9S5V/grGnC4ykNmWgVpqoe4Ca+l/orOG9MqcjRc4Ls4AHbPVp G+OhTCAenb4B8SfP/8ltZNAvAvuXs+FJVtf0EtrTVZOPazcWhGKm+QPix41TvPNakDK8 7hSA== 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=crPhJy59MKpji7XeYQ6bfKjbA//sfiHqEKw3bAcAfno=; b=kts3s0rmRNTskULMD5avLpxxKS9seGZfR/S6wes5iX+Vr2jGplpTeOApk3dL2L2RFM ZduZEdQPEMfJMmWAZcI7FnRJ60lOI6c/P/WCQ9FXExrDuHiVyn0BTxTzRz4JZOyR1meN fsrW/0W+cNgDz+wWG8kBiDxhk+anQs1wIjPT0WGR012F0luVG4mMmbnLyDpWVFhxuj9z jxArqh6imLsdkztxIVrBGCAmVtc9bZob77rEo2Iy39mTd3Ta3z7omgm/XNIR6MSp9xFC 5ydAEEWc4WK25cmpxn0ATxhopR/kFfyWN61/mtKf/DteYDUUarTAtDwIvOLZpstOKsC6 Noyw== X-Gm-Message-State: AOAM533NyUb3jJUQMBMmkbUeLHzeOJff7xXGahjl9J8Nqgut/9eAktsL RLQXKBhwB4Wqurkr950Z7yGjE8NxGoPZlg== X-Google-Smtp-Source: ABdhPJwvdtHjh5SxFQ8ZPp7UGoVcro1ZZu9OGqWRjNoyHPYleyi1mJCJ0H1cCNseHuXBAGkcxENIeQ== X-Received: by 2002:a5d:878e:: with SMTP id f14mr28773240ion.111.1635893619122; Tue, 02 Nov 2021 15:53:39 -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 h14sm205427ils.75.2021.11.02.15.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:38 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 18/30] bsd-user/freebsd: Create common target_os_ucontext.h file Date: Tue, 2 Nov 2021 16:52:36 -0600 Message-Id: <20211102225248.52999-19-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599813 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 AF48FC433EF for ; Tue, 2 Nov 2021 23:10:35 +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 64F2660C51 for ; Tue, 2 Nov 2021 23:10:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 64F2660C51 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]:42012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2vK-0001z2-J2 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:10:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f3-0007Rc-33 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:45 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:40771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2ez-0002rQ-7V for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:44 -0400 Received: by mail-io1-xd33.google.com with SMTP id r194so572038iod.7 for ; Tue, 02 Nov 2021 15:53:40 -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=CQcLloqus83jhu7E3RBsymu81cuJi2Z1w1VoTvGbHwKnSW/Ix9A6Pe/0aafQyHJ0Bk 0JyROYTPVof1Z8hUfb0R+66ErFufTNmPSaPbsZhgQuOKUQpFxrNow5TlQ+Wb9nLV9Png oQyKxwickPqW9s0fdf4jL5zPEnlR/toVO4KN+Jd8Og2ciFy6YtSR6JfqC9vxfgRrNAXm 3/BeD/BACIHobaUO7H3ktZrnR15TIzksS/Rt9dkDpzCnESz/Py9m7KrcW+vlvy9jrFuc uSHh6CCG5ULHqHfQJ7KiDbXsOjNCaNVHAlk0wPujez6RbmZZMjtuSOnNMQ9dRaIioPuF XsxA== 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=fTitLr6a42saDfKDlflG0s1FraVF0wu1OjuwPgOnqdYv+F5sax1808sQuwdP2qJaO1 LJRonpxo/HptNmSMh52sJELKvLWx9/Nivwr0KaO8/BkMkf2MDAN9ulcj3SlNxITUXid3 wkji4AGDSv/GU+UwU0x5+n7hltiSVcBCzjh4sUnKo274mGW3W5NC5nrWan8NjMjZCvPX vDx6175xHJAn+uld6R1LfBxwW1nU8XKSIOKzsMkNTeQlHyotoi6FyPHNGcLvua1v0tzy Sw4QSjQQMuf6r6oM2nTEniSqXmF5OPjd6/c/8PCPkKwFLJoecxjsAvXoWIqStc0y40dU MmGg== X-Gm-Message-State: AOAM530idqdoabKL604kfxC/hGKVrHyO7sY56SdDFtR4Z8seG9eU+exs KqOH3soMjDiFN6ZJ7839vJxyt35ZWP1IlA== X-Google-Smtp-Source: ABdhPJyXbOvz4fwnQoZ3uH6kM8YSVIUOS38lJGC3fXbnS52n8Ee1D5V3XVeyXbno1EuNK5dlmMlF6g== X-Received: by 2002:a6b:e903:: with SMTP id u3mr27574447iof.36.1635893620053; Tue, 02 Nov 2021 15:53:40 -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 h14sm205427ils.75.2021.11.02.15.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:39 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 19/30] bsd-user/arm/target_arch_signal.h: arm specific signal registers and stack Date: Tue, 2 Nov 2021 16:52:37 -0600 Message-Id: <20211102225248.52999-20-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599811 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 4BE87C433EF for ; Tue, 2 Nov 2021 23:09:24 +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 06A4760F5A for ; Tue, 2 Nov 2021 23:09:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 06A4760F5A 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]:40360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2uB-0000o9-79 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:09:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f3-0007So-9V for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:45 -0400 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:42562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f0-0002rn-2K for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:44 -0400 Received: by mail-io1-xd32.google.com with SMTP id n128so563003iod.9 for ; Tue, 02 Nov 2021 15:53:41 -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=vbCTh54/CADMH+2MA3WMBgkSSWLDBfiuc/042J+pOc9s5kz+L+ZOzpr6YtNuITV8f0 Trr4IH1R/Rmr6ZB31dIcNe4gvU7c2qrlKoN4ZSbfBdVyDoxa86suuPMBVSXTGNN8ZG6A Qdxr5v2SlkIn4+8iMjpbRvk2jKCUQekFEjcXwfkQqVZttfZIrsUXYse+0B79lzNaU4B3 fKvNTFmQbwBwtDlWCP55Lq/mPx+lb23flQV3LYWFBMJGqgeA0BRiZKJiuFf7XXHqzFO0 ELb6IW5OcB0MqSIW8PKkTNn6zddB0yKz/kxte83AJmzspmJHWIxlLU57VwrYY6RCTfG+ r2Jw== 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=PE7Qi/NCv1eEn/qC02GgiNUH+kK2U00tCajypAX5wVPAZ63oheiXEB74MX8gMQOF4z ziwV1PqXvze31NPdX0IsIYANHTf9ADrayRPHSO1j2aKxIIQLI9uI9fG510vfHJ0liA37 Ng+Kmjr3YC4G00ggV6waW1pnB3v+4vnmF88wqc03xF336Hl0flsIqnyl5JC8FMZv9wV8 X8EPIkRngpLV7KzqN/rihOACfrg68qC6s7FSCZtiwqhfmcK9+e9De8QER6LOiu6Z1eef d7a0/HqvuuY9I5umBrynowYP09MbUjrcRMJYzUYG42PywjYrFWvx/s2tfm9NjZbGLkRm Z7+A== X-Gm-Message-State: AOAM533wydUboflky+mK5Lkg4AbcopYAfyTS6KClFarb6zldFNrs+YL9 PIe1ArlhPr493RC+gJVq3pMIX8DuRu2ueA== X-Google-Smtp-Source: ABdhPJxF6umoMF9236OevwoUlaRrGwaQDt1jCgcqMbXn7J4pRuhLe2jZhE+r4aZrYh/tH+lgLXwVjQ== X-Received: by 2002:a05:6638:144d:: with SMTP id l13mr30268056jad.121.1635893620870; Tue, 02 Nov 2021 15:53:40 -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 h14sm205427ils.75.2021.11.02.15.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:40 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 20/30] bsd-user/arm/target_arch_signal.h: arm machine context for signals Date: Tue, 2 Nov 2021 16:52:38 -0600 Message-Id: <20211102225248.52999-21-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599817 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 242DCC433F5 for ; Tue, 2 Nov 2021 23:13:42 +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 C225961058 for ; Tue, 2 Nov 2021 23:13:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C225961058 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]:48102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2yK-0006IO-Qa for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:13:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f5-0007XE-B7 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:47 -0400 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]:39631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f0-0002s8-SX for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:46 -0400 Received: by mail-io1-xd2b.google.com with SMTP id h81so582152iof.6 for ; Tue, 02 Nov 2021 15:53:42 -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=FEuU61Uh+4EG3ZU8JoveHONnvV/xarjms4F54HGX8Uo=; b=C8zF1FxZcfPL5gs6X+o6Ch6SRVNM+soRDtSVqQmH9TSWmZfzClag66Ose5MpFUtxWy VnAHbBj/0g6LsBTGim+NJBDE6DvkKgVeLR2d7/2Cc4sydX2YmhGfoTrZ2ScnOSpauN/H PIYV8JI3H4A0s1mRlr3jE6ZeP/0CTjroMPDFxGdvTKtI5VmekmNji/rXUwntzBtcH6fp v9zlx7x10owydZVoi/ANn+j3BoFncj2dT2Kr1rAADISM77IxozaPc1Hl/bM41Qq72zzd LE3RmwKx70FthA1Q+3p8ZfqQCzdHa0GmMjTSwUKsH7koy99DQMBB2y3xq+XP156JUGTf RL0g== 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=FEuU61Uh+4EG3ZU8JoveHONnvV/xarjms4F54HGX8Uo=; b=6Trze0LbBAkR6Q3P4zAj40YX1p0mC/wfKI3r0Py4/JiTV6N5Dj49gU47NzTZS7V6bk +jzMaWe78ryJ4J/gkqg5WPmb72WYBDTNgNYIePM08h0bIlAX6EJagcEsAopuF4qJugBS Eio5zGfmwIXnQf66pSpol5JM191eTsZl8ySosLZB/5yDq2koeNOK+gQuEXi90nZ/2rss ef5Mrnt4LUdVF+HsGKWbJ5Qp8hfBTP1dxFTQh6yKyKu2Qb3wDNpfhjZWyPvhvEkQSlHz ca3uWai1RCWF3kzGpWZEUuF43prcZtk4kBpy3hEMAufcyrlBupCuQ2NdJBxUlrhfkFGn 5SpQ== X-Gm-Message-State: AOAM530/Lyu/2fIF+cgIAZjMm6bsE6QfW5wA+QS2BhO7v6VDP+GMZS+M kzyKJ4TFvy0bZZV6cwEQDcCsiVFTY4Dtzg== X-Google-Smtp-Source: ABdhPJyR1CMVeZvbTfwS3TaVEje4oR+EdfxM3Vxd9z5Av7/vwk9Xf4erDKsDMEy8s6ZDVhMWu8cCtA== X-Received: by 2002:a6b:6b08:: with SMTP id g8mr4204941ioc.150.1635893621720; Tue, 02 Nov 2021 15:53:41 -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 h14sm205427ils.75.2021.11.02.15.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:41 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 21/30] bsd-user/arm/target_arch_signal.h: arm user context and trapframe for signals Date: Tue, 2 Nov 2021 16:52:39 -0600 Message-Id: <20211102225248.52999-22-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d2b; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2b.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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599833 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 03CFFC433F5 for ; Tue, 2 Nov 2021 23:22:40 +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 A588060F90 for ; Tue, 2 Nov 2021 23:22:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A588060F90 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]:43476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi370-0005TD-OC for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:22:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f5-0007XG-BR for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:47 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:38833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f1-0002sX-Np for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:46 -0400 Received: by mail-io1-xd2d.google.com with SMTP id v65so584918ioe.5 for ; Tue, 02 Nov 2021 15:53:43 -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=z1Wl9T8L67x7bSGj83CIsbFNGgACyBDJDUbwpvxuohI=; b=YKxiVfyqx92Al9EOD//eWmoDlwcHD2a7uNpaN4JH/gscWMTJj0AYcW+0KAKksa4Sed /9B+6/YKyEZauAZh9cWdGvFZ3fHav9H/S4DkcNc0//PnEDclCU2JJGqOc/uNoM/h6q+Z XJH1UqLLVrF8g0Sxma4tlpXaELufMUxKthcTWo8bLmBOt0dhhoFVZ/m5Y7/LobxBjVJB aP9LIgH8DOarAGGHswacrCLE5lpOnuj4dNj9SpYAmwcMpg3yH+YViWuDuKAoWZ2jEg3I ue0XW36S51RYJMksYLAFPCvl5jswccfg7vkFjdmb0WFhndhRhrjA0V9n42CLUuIdudFp W4xA== 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=z1Wl9T8L67x7bSGj83CIsbFNGgACyBDJDUbwpvxuohI=; b=DUyij2trxZyuKPTrgiYanm3wknn+MNEAWDp2AjmjgZ9j0koXGtmIQai5qqGwDLQRVr mTVXzeLS1fUXb0fPLC/OIZl7SZJPljMExva9rpuL6MG31UT/pC/55QQcokhoKcwdgJDZ FtJu2eQ6dEqzH8+elNgvbT3sH0GMzsQiY92Z1h3zBF61zNFjUQkJhDfXPOzYC+5KIFK5 ZoBG4bZ2mJ5nP4rdzV7xzUCnJ89ffmp1iHlbMwurs78kW/5B1FfjQh60MuEsq2zH+lKp 4S39SLqWZp2PoF9Jjdkk+8YOtOPPFObczawWEiu8S2nBpcAPAuiGhmL7AzD6KrZ9iNrc HL1g== X-Gm-Message-State: AOAM530F7ZMg0mqATyg68zSwf2z9LhUs/qUn/aXRl5ffZoDuVEnLwDa0 Efn39y+oK6iau7/SvfCBpsqfm23enR4oiQ== X-Google-Smtp-Source: ABdhPJy/s4GnIXvCoV0Af6f51xFUMtjGtgZc6P9QgVo1Kwd3cBL2y3OOl5KcgiIzX+6hmminh8x+7Q== X-Received: by 2002:a05:6602:15d3:: with SMTP id f19mr17319677iow.14.1635893622540; Tue, 02 Nov 2021 15:53:42 -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 h14sm205427ils.75.2021.11.02.15.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:42 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 22/30] bsd-user/arm/target_arch_signal.h: arm set_sigtramp_args Date: Tue, 2 Nov 2021 16:52:40 -0600 Message-Id: <20211102225248.52999-23-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/bsd-user/arm/target_arch_signal.h b/bsd-user/arm/target_arch_signal.h index 4bdfcbb8d7..61440b51b4 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -82,4 +82,51 @@ 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) +{ + abi_ulong cpsr; + + /* + * 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 = cpsr_read(env); + if (ka->_sa_handler & 1) { + cpsr |= CPSR_T; + } else { + cpsr &= ~CPSR_T; + } + cpsr_write(env, cpsr, CPSR_T, CPSRWriteByInstr); + + return 0; +} + #endif /* !_TARGET_ARCH_SIGNAL_H_ */ From patchwork Tue Nov 2 22:52:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599819 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 4B4D3C433EF for ; Tue, 2 Nov 2021 23:14:12 +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 05F7F61073 for ; Tue, 2 Nov 2021 23:14:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 05F7F61073 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]:50166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2yp-0007fG-6K for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:14:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f6-0007co-L7 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:48 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:42806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f2-0002t5-LI for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:48 -0400 Received: by mail-il1-x130.google.com with SMTP id y17so641528ilb.9 for ; Tue, 02 Nov 2021 15:53:44 -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=+r01BN2RKWDgyocvJBPU5Kji19m/VGVQeGkX/VmFsS8=; b=JStp4w00RfzOkx0uDorl99c+l/aYTj4LwDf6dNSwDDneQhTGojjqE1yXijXgX+wCJ0 X8TXMuIHzC1ICNzuBwmUNXvygyzs1ZDt9vX0jBl7OG289nbSuhEsg+hC+d9Kr77GbDSy kdrSVSARdIITrmiwvo9jQ2nK3ZzBKK4dkDFAqUv8UnDYmR9fLZcoRERxgaeTPFbttBUK jZtC7nCMR+PV0dOBoed/FJ1YJfSLcUg8PP0LecUnkEnrMTx66DxEFebutsogTx2j2AfE QbotXse/bw39ZPARZJO7WkBZbi3NLj959DYzHIcAnLekR3hR9SEAD0fOOWYEZdrJSUUb IQ2w== 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=+r01BN2RKWDgyocvJBPU5Kji19m/VGVQeGkX/VmFsS8=; b=qg9iyRLsyl/qeLDV113kfSF5UgIJ7qQ1eDKvs4y6xw9I+MrkLwTVnSsLuZ5HmEtbnd YluudnKEIBo59hzlujZ1lHy1juuw7fqy5O5xkhVbc/g+xoU8pyrvge+IP1nr8KZvw8NJ IxD+3Bsm9leUhnkc9S1SAR6JmNvZwu7+oM3LxBvulL2FL3hpafxaqZyhqLP1tnefX95k W1iKkJaubhqpWZJXe3JegQ5FC9y/eUA6GRh0zz+J8nbZ5ShVU3ShxGo3W22qEFg9DYU/ E8aE209dwM0EUZFQ7JVwJfLF/mCkOlt5WTWaAu/tVLpd6+2o6aMk8f/mhzoyl1+/djh6 Olsw== X-Gm-Message-State: AOAM532vPT3v43tss7Thi2ZscZQFdmFXn5xpfCpAVFxiGBtR/v7PRIBR sRGJ9+xYUaslaFbwaPuYyS/LP080IwLHKw== X-Google-Smtp-Source: ABdhPJy4eWfcJATw1ghGx+/PutfwVFhsLhZe384iRFNY7TFxO5VgJv3sqH6MPm9N4Mbqx1GXub/k8w== X-Received: by 2002:a92:cda2:: with SMTP id g2mr17147699ild.2.1635893623411; Tue, 02 Nov 2021 15:53:43 -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 h14sm205427ils.75.2021.11.02.15.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 23/30] bsd-user/arm/target_arch_signal.h: arm get_mcontext Date: Tue, 2 Nov 2021 16:52:41 -0600 Message-Id: <20211102225248.52999-24-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 61440b51b4..b42d08402f 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -129,4 +129,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 Tue Nov 2 22:52:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599847 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 9A3AFC433EF for ; Tue, 2 Nov 2021 23:26: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 29CD960EB9 for ; Tue, 2 Nov 2021 23:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 29CD960EB9 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]:55234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi3AR-00058J-5a for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:26:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f6-0007dm-UN for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:48 -0400 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]:35538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f3-0002tL-Ii for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:48 -0400 Received: by mail-il1-x12a.google.com with SMTP id w15so680094ill.2 for ; Tue, 02 Nov 2021 15:53:45 -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=X7DlPXDNylgG9L9OMjAZVuV6McHnJtmGCnJP66iZ/V0=; b=0GrDpzGzUnL2q7QcKNjyFF3psE1nmF5w4V9g67GR2ZcHRVnx8cOsLDkI+wm+oEIgOH lDixzT9W5OD2wpSzzdyLLyT45r6zn1pHs2AtKqhn7EGI/6btIxbCllwyAMrPo3CzgQip PgGTUmPwX2ZXPWWNmiIUq8Zsa3ewVNvIxezzYbx++rpAveQPV+vOOV4vddPDHVz1uA1Z /DeML1s/xzKsRA3QaeHWk/LZlyl4wsi6s/w8dqCvcfRf6sQyVUfo6Ag9sQhoI/A/tnsq cx5gMCKlr80AGSL0PQ9b73CVaWYApZAT9NBqAcP65cjDp2KrB4mNLwLJhXjn07OdqeEN +y/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X7DlPXDNylgG9L9OMjAZVuV6McHnJtmGCnJP66iZ/V0=; b=CQQut+v8AJDglITIr+sb60XfR2G8YG/I7JpUVkQfnSDsKIjAzf+MOcJ5tp/nLoqTfD iR/kWWezCZ+J5t2gRg+5SeEjbVGCakq237YJ04EXUlm7vRcDusTegca5Z7EIXfGGWuDc ZR2vA2m7ofRRDkoVnSnbyKPYrrx+cNHB0oEwfv2ror7KX72xIpvPVEeM8NRINjiup/Uc x730NE0ELeAY3Ppay41U9b2GXAiLtc0vvcAOBWoYL46MWdvzVwih6btDct+07Aqgrq5t yG0mkUxLqznO3JMG6AC5XtP+fY7KUzDYG/OAGReHHugBPLmtI4i6dLYAFJ79w7IfoZg+ GIKQ== X-Gm-Message-State: AOAM530s5gveEgzPxHE2yjo7IWFjt/zkmgFYB3xaE3jDo0djcyg0xs3X h6SFrXJXc/5lvvJERKG1PPjlWXotuxPwIQ== X-Google-Smtp-Source: ABdhPJwnVMcNJE/vEy3wejnae1l4MChnUEKQjYo18du4HPTjIW2as+8C6A8BlLQ76iElKdK1ROUlRw== X-Received: by 2002:a05:6e02:1a4f:: with SMTP id u15mr5506251ilv.115.1635893624300; Tue, 02 Nov 2021 15:53:44 -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 h14sm205427ils.75.2021.11.02.15.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:43 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 24/30] bsd-user/arm/target_arch_signal.h: arm set_mcontext Date: Tue, 2 Nov 2021 16:52:42 -0600 Message-Id: <20211102225248.52999-25-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 b42d08402f..3b2f56ffab 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -179,4 +179,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 Tue Nov 2 22:52:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599823 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 2B78DC433F5 for ; Tue, 2 Nov 2021 23:15:23 +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 C32EB61073 for ; Tue, 2 Nov 2021 23:15:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C32EB61073 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]:54494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi2zx-00028s-VI for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:15:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f8-0007ki-DW for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:50 -0400 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:42555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f5-0002to-1l for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:50 -0400 Received: by mail-io1-xd2a.google.com with SMTP id n128so563160iod.9 for ; Tue, 02 Nov 2021 15:53:46 -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=rJiJ1S+SRfN5kNalL+C6IW22wSVGuIlNDO4cLpe4SBI=; b=rSdUu2pCVF6F4heKIRirn25rYOtzWyQmcy1U/EF2rzjgHTG3Qg0wmegAMNdDaF3cEA S+ezPeHudPDuzSQJ5QoDnrgIQt1lgZl8iJtdnUXMatfSQrs3OLqbQZ7wZEr+e+IUx6m/ rXshAx7/HJpJzTOLBA8xU+hRNxwOSSbKZMgdrjlxf1+GeQgtzVz8Lg+GaimXaqj8CQvw k9s4pE94KEwUiFciB18pMWaLOvqthXwFEGfl5EEoY+9EzCHpolittvFyo6MnhH0hM+7K 4n+vK68WAUlBgqwsGvgZr+9hCJvjeoAl7pdyYNg4yticbztJggDbeO5WI4JcrQS5ge19 fM/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rJiJ1S+SRfN5kNalL+C6IW22wSVGuIlNDO4cLpe4SBI=; b=AWVZuY7MiBuim0oZdmLQFr/9xTKKLw3guQXy1zVfd3plLYrxxzhVBZuziwYndjWxVz /uuhlV74TaGfpJI/kWAx7PyppBHRcpBaqSFFZyYLzXAstS6uEoiEGK3rYhXIvRM/cXMO NRV5ToYpnYyZg8/RjXJamXfmloSe189waq26Afz24vmrMRRlP2pp/quTmF4bhMM9Hm29 TEdZCXdfjhBrBRg38vdGNy0Bc29tSEZrfAinGYXty2QvnvsGrm/3iQU53WHgrcSPVHHd dFwQCbJcutkH8ySQSFnZmRbXGvadPe/qDdhmW3+hMH1HcBefUPptOshhmW6Iqxz1L4/C g/TA== X-Gm-Message-State: AOAM530mDlh+hRDdafhKAjKgJgw1m9dGgvxRi3YW0fB3Ds6E9IIT1C/s i5KsSi1dfMZh5uJpigP9USiyeNQryMTeKA== X-Google-Smtp-Source: ABdhPJw/2rMlvLO+ZgW9tKD8PqltL1E7TNRKQXBulAiN1Z0s4fdyAR1aUPp1HkG1QNCAO2I5rSPirQ== X-Received: by 2002:a05:6638:1242:: with SMTP id o2mr16083297jas.68.1635893625234; Tue, 02 Nov 2021 15:53:45 -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 h14sm205427ils.75.2021.11.02.15.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:44 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 25/30] bsd-user/arm/target_arch_signal.h: arm get_ucontext_sigreturn Date: Tue, 2 Nov 2021 16:52:43 -0600 Message-Id: <20211102225248.52999-26-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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: Stacey Son , qemu-trivial@nongnu.org, Kyle Evans , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 3b2f56ffab..3db76c9201 100644 --- a/bsd-user/arm/target_arch_signal.h +++ b/bsd-user/arm/target_arch_signal.h @@ -254,4 +254,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 Tue Nov 2 22:52:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599853 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 457C6C433EF for ; Tue, 2 Nov 2021 23:28: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 F1F7060FC4 for ; Tue, 2 Nov 2021 23:28:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F1F7060FC4 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]:35220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi3Cs-0002OR-6I for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:28:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2f8-0007lG-Gk for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:50 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:38423) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f5-0002u0-BK for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:50 -0400 Received: by mail-il1-x130.google.com with SMTP id f10so664900ilu.5 for ; Tue, 02 Nov 2021 15:53:46 -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=IP/CrjZ71MNpMBK9SbbROnnwU4huuf4Ai9hfA2D/slk=; b=XQqB4KgxunMQWpH3GPrDFJpoHDCdxNMVuDFedzg9FmRF54V/y7PtRbFjhLxRpI3PUt k9gPzClI9Vbf/THMfRGr0Opzy/ZPx6O7xRqpTNsfi81I0buHfLLJ0SZIWAseB05k+xOr HIS9D0njSp4gScV58PdmlBiUsiRI90gUtf2f6/LXz8AG6SC3Pl/VSuPGcgIYauXEziXC aNkeiwBAugBafN5j0d2meGmyBYEFbLgjlc+hmkFi5lvb9GBdbgKa2yK29ZGktmAs3Lxk hnqtgpUQghAgu10fAzgrxYg4sM+QyFJ09KJvsHOvCyHwEr5thXVDgfR1zKDa2pEnZSM5 8XhA== 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=IP/CrjZ71MNpMBK9SbbROnnwU4huuf4Ai9hfA2D/slk=; b=A0kwtKHmowkzOxNHOTUgBQ3cu4WW4ufRQX2zK9AxsrW3+7GDDS4A7zNZEQI7cCZ9HX 7N6uv4ELkvdhDeFmu7fiNzgh0NqYXJyIEkDqSPMJy1QWYpHZC9cTMo7JnhJet4RmjDtx YpjaTLmV20lNRUNR5Uw9SJriZJpaMukncqLuK1jELJZ5nvPyAkdiL9iuAYC0j1Yuk4Xn iIFS/ujTDFF6LunJqeXZhHrvEsrkdvp7Yn87pVJTLPVzrvE9U/Yo2yN/i3I8P9kK6mzr Kcop9+4jpSeTI2PMgBPDZgTjruQBM91tGQk9UwclMz+DpgHqFgyhlZVu+quBfXEB0t64 CTdw== X-Gm-Message-State: AOAM5336qDh2/A80Eut7t/q3xI97xLiVLJhezaTg9NW5J0c0K2O2Y6C1 k4vXcRLlIbVpUIj49/QYen3HJeu6xLdukw== X-Google-Smtp-Source: ABdhPJzVaBFfXxNzN017erO6cqwFdJ9t9sfNtUCHSkAtBorFFzIICmCkiUfiHUBJWoqGW1XoFMlYbw== X-Received: by 2002:a92:9513:: with SMTP id y19mr26490865ilh.300.1635893626055; Tue, 02 Nov 2021 15:53:46 -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 h14sm205427ils.75.2021.11.02.15.53.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:45 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 26/30] bsd-user: add arm target build Date: Tue, 2 Nov 2021 16:52:44 -0600 Message-Id: <20211102225248.52999-27-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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=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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , Paolo Bonzini , 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..90b6533195 --- /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 From patchwork Tue Nov 2 22:52:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599855 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 ACCA6C433F5 for ; Tue, 2 Nov 2021 23:31:25 +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 5DCDA60FC2 for ; Tue, 2 Nov 2021 23:31:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5DCDA60FC2 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]:41266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi3FU-0006am-J5 for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:31:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2fA-0007sV-1h for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:52 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:34560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f6-0002uX-3s for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:51 -0400 Received: by mail-io1-xd31.google.com with SMTP id b203so610138iof.1 for ; Tue, 02 Nov 2021 15:53:47 -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=qscs9QmnQjITLDaFiEf4Oo6T7Y3KGHp4Rky0uLwfUp8=; b=KJekdd+GfjIYcouCPvv36UZHH7c0W95GcU4321gQkVaCPvcev9Y1o0mzCWS20zgt4D 8nwapjj62/AlfJqTHCb5uP5IoMD8z+8oUqHP0a6FdV9m+Z8OHLyy2Lzic9ZuOhTUTiH3 DD1elde+2GE51hkXjcpyTXoidBnncR6kbt08ir07bId3F5KFOAzpgpp8EKt2GKdeqZ94 9f8qpiBswc0fJJ7pj4AIOUoYF6e/gPj5/kVA6cMbVrAbZWozCgdTNP+WSCQXjq/NdZkJ R4SzFSTQXt75vq25bhVreaUiDgyy5zcFz6HQ/K1pVAp00B1ElT6+IKVhritPhK9IRCUf y5sA== 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=qscs9QmnQjITLDaFiEf4Oo6T7Y3KGHp4Rky0uLwfUp8=; b=4jFO9YPc/eHsMvqBq3zdKZ0KL7WYu577WiYV5YWqzBQ/U8POpYxcvzz0QI3TSQuzNo WYLpXNayNjwSPoTdjTheQ66G/9a0u6ea3ACigG4yWlWnqjKji7JIvFAw5LkDyoevK4Gi xKd3oIV8amy1LD4sqtdHd+/iURmoW26nmlpDCLgHqsfZoN9hjasB0tOP5N/gHLXoZ0S+ XlixfNsqg4Fip8Wz3kYQEEjybMG6nyToTkV08fuO/vdfzy/4KQIlr3ybO02ru6RBPOJp VXURcGl7OXu9WaJYIV9apGUDot8UubRpRNnmxJQ7qnb72Dt5jXW38kq5KCMpwKDMJoeH gHGw== X-Gm-Message-State: AOAM5301ldp7VgGTS5ABfzQYGW7zsmu+HW96740dxD8dyG1QG/QVKVyU qGi9zRUe//uaRG3qjaZiTJOZU+XjieKxCA== X-Google-Smtp-Source: ABdhPJy3qU6YeuD1ekeCrOU4G90YuWMTkq7fCzQATCjHa0Wo9NLcsQuAxsxgGwIOExpgsNBNWShN8w== X-Received: by 2002:a05:6638:258e:: with SMTP id s14mr14958830jat.111.1635893626997; Tue, 02 Nov 2021 15:53:46 -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 h14sm205427ils.75.2021.11.02.15.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:46 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 27/30] bsd-user/i386/target_arch_signal.h: Remove target_sigcontext Date: Tue, 2 Nov 2021 16:52:45 -0600 Message-Id: <20211102225248.52999-28-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d31; envelope-from=imp@bsdimp.com; helo=mail-io1-xd31.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599827 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 D19D4C433FE for ; Tue, 2 Nov 2021 23:18: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 968E760EBD for ; Tue, 2 Nov 2021 23:18:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 968E760EBD 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]:33400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi32i-00070N-TP for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2fA-0007t2-6W for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:52 -0400 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:36837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f7-0002um-0a for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:51 -0400 Received: by mail-io1-xd35.google.com with SMTP id e144so597252iof.3 for ; Tue, 02 Nov 2021 15:53:48 -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=SBbYIrt8GgDPy1/4QZKIQdNANGpuq0OiEn8qWDZ8UEI=; b=Q4VzVpf+cOExfAXn3gy3wLjiuPaQWSjqH2k3f/0D2iWiGYycbF/wKUyZ+au+kDUX2Y OSyZg7k/C+qaP8VRMpJlsWmKey9UcTRQXg5plF5rphSfzyuI2/ov2j7AgsnXls6eU2J2 dvWR4GSuJuT2/1hp/ihqmu8W4uHq0D8EXlvTnXDhgFMreRdMfeiIT7WJkWx8cETFY7sk aripA5LT5Wh0qsB+PQOjh+ilFHmnmG1ROYPX/dh2JGYtgduoDJK/lGdw6cTVYMOZIzW+ tou5xreG/Rg0VZKfwbeNK9PFIpWcUTTVDQzoOQBqzoqk/X9055ZExf1cFKF8YHEN6oFk RRqg== 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=SBbYIrt8GgDPy1/4QZKIQdNANGpuq0OiEn8qWDZ8UEI=; b=7uNsS1GGbA5hCwwpRulySqRGOTuLiHF7/Dpuzhn1T3juTNJzFA0LJLEG6SIiHLD7YI gUB/d8mOyc85+zsNX7SRNUqDDUVRJzyaF3subBUf8//A0mlKzCc0OM/Oa8s5nvMjrDep Ku4v8WMmFO56M4COebdECtO5n4Jy7TZBwnszwyybSr6xa2rzoFncaGcbWxwVKM5TnvHE 2lSAd5XbYX/6vpNjsK+oB6gQa2YFy7zifRdhOQlK3vDEhVIxJAm7fhydFZ2Mn9rtX8kc 9z4tET7WjNCY+oOmspuS9DWncY4xd+a6VnQrQ1HcROBuoPoKVQBc/px3Wa8zq84Gzhja N2sw== X-Gm-Message-State: AOAM532wqSrr9Ap/KpVVqqS2daAn2f8JMzPwq9DDZSm9gYbOsxdpCO13 xuQXeHsLyD9IoO8wyhDxc4tMkTHwe/R5lA== X-Google-Smtp-Source: ABdhPJzgssMUhigVRBLna/CcLAtTXTDjEOYGJCYKQRaThHR51obui6BX/6nYT36D9vnrCjXZ21tbtg== X-Received: by 2002:a05:6638:1502:: with SMTP id b2mr30614514jat.131.1635893627807; Tue, 02 Nov 2021 15:53:47 -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 h14sm205427ils.75.2021.11.02.15.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:47 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 28/30] bsd-user/x86_64/target_arch_signal.h: Remove target_sigcontext Date: Tue, 2 Nov 2021 16:52:46 -0600 Message-Id: <20211102225248.52999-29-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d35; envelope-from=imp@bsdimp.com; helo=mail-io1-xd35.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599825 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 64FD6C433F5 for ; Tue, 2 Nov 2021 23:17: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 14B706109D for ; Tue, 2 Nov 2021 23:16:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 14B706109D 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]:58756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi31X-00054e-1g for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2fB-0007zp-FD for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:53 -0400 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:47017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f7-0002vN-VU for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:53 -0400 Received: by mail-io1-xd2c.google.com with SMTP id i79so273955ioa.13 for ; Tue, 02 Nov 2021 15:53:49 -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=VxPcRIshgsvl8wAv3aQLcUXSiDUtiOGCvbo2dc4dGpo=; b=WUyM68vXwyWTYyHHnrxeSBw6gP6uUcgK334xacx6SvmxvKvL5O1lcqARneRw3pPlhb SIrYhwP4Zmu2+4TobSs9bMWb9LIBWeoF7w20iPxCQEy9hOGrTvw6TSaC7g1exNAX3wVj ttDiQ2XnHWKAEEFgICW9TlKrTnChtbDTeqTtCTk30IunGV5EqhlbaQk1oh6K9ZmhH8rC vRv56/Re0GSKF7k3rsVdZ1yRyoFI177MwVTGec8xAZHLMb9uEaNIF4JkXoQIqulOxaJY Z7TVP3eF4Up+Rh3uMT0DQ14PNkdJxLQJSUveLm2jC0PUaL33nkh1popTiA1kPq3zmZRV TdmA== 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=VxPcRIshgsvl8wAv3aQLcUXSiDUtiOGCvbo2dc4dGpo=; b=YYIQeW7zrpxTWFpg0CnkuW0Kv6zf0/sg7R9nvhjbP0BxcN9s9SPqZjXITBAGA9b9Tn wbMzwc4HVJEngdRR2pzck1CPE1MQv+CYXu0NouoqINJP970FI2acnfuZQZdjRY/HDi5x NyV9mYfbQlPSmIt30iCngAOKea9QsnEHr5g89bx6WUgFE5eY89L/MmOWwAWOEbAG4XwD oomrJrEaMCnVVi5/MC408jRywrY5ZlxVNAWVQDhO+zc48S5tx3Ugo09J9mkruc8bCcc6 M3jPFfi2RQHYeAzf4diw1de0Eo0zB6MJfJmc2EzZAbxfdnSmyaR6bvIMqqLL4D4wMxph i1yA== X-Gm-Message-State: AOAM533CEPHQyqtIxZShvOfyzOgJuWNgH64+l/qop7c8EurAYol4YedZ rt+VFsmTicyVa/Cmuva0QW4NM71svUciKQ== X-Google-Smtp-Source: ABdhPJxQ1KwX5N0CT/3qsd3ALOqGceisUddm1McUvN8wrCGzEq6jwj5oPzpioJomY+RpruAtpPCbEA== X-Received: by 2002:a02:cb58:: with SMTP id k24mr30397443jap.59.1635893628833; Tue, 02 Nov 2021 15:53:48 -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 h14sm205427ils.75.2021.11.02.15.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:48 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 29/30] bsd-user/i386/target_arch_signal.h: use new target_os_ucontext.h Date: Tue, 2 Nov 2021 16:52:47 -0600 Message-Id: <20211102225248.52999-30-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-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: qemu-trivial@nongnu.org, Kyle Evans , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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 Tue Nov 2 22:52:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 12599831 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 99DABC433F5 for ; Tue, 2 Nov 2021 23:20:15 +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 501A76109D for ; Tue, 2 Nov 2021 23:20:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 501A76109D 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]:36830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mi34g-0000wR-AI for qemu-devel@archiver.kernel.org; Tue, 02 Nov 2021 19:20:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mi2fB-00081h-SE for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:53 -0400 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:33281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mi2f8-0002vl-Nk for qemu-devel@nongnu.org; Tue, 02 Nov 2021 18:53:53 -0400 Received: by mail-io1-xd36.google.com with SMTP id z206so654169iof.0 for ; Tue, 02 Nov 2021 15:53:50 -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=V2bQIWGL0XqjqPbzVAf7nqAzcBUhtupJ0ypcSsardcc=; b=FbyWJOPN4JgY8FvbYmqNCqW46yYYnQeEM76xOFFYhjX6a2jnCf6h1BQEgls21Rh4ks 7ob40dbj9agR0pXGYKB3ZuNVMum6PUaWmrds6b9G2Gukmbq9wJyM7dY+PcGsMfoKLHJL eNDCglkVmwlFA1oMIPCRxv4HqJoQ5ylCpKxaomv8Z+nfTA95iDB6fPcH2xkR+GoRcinK kDeHE561o3r8Xrj0rv9w0kjg8vFnoWlmlf+9zF4MNq+UGBVct7wrIiga+n9R+dxsAgBC 8yA4L/vsa8hjtLj7UeCsDY2wbdcpsYmR3PlkYI9QcfZZz32HkY7R9LurMWBvvUNvhZhp DqJw== 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=V2bQIWGL0XqjqPbzVAf7nqAzcBUhtupJ0ypcSsardcc=; b=vbxMhV0Wgx00GPKd2ZQgdGuVOx0+n5JDNbVgu+dcugu78CosGqmcPbjfFSDZMKulBJ bpXXYk5vmOw3ud6iQH6ASkgdP0L4eJSFKTt/ndxqL6dxgAip/UjzTyngbW8l+GYfSaLn WpxZ4aEpL1uFWEhKcb0c7qO8WG5EJCazDfq7Qia2mubw38QB2b1pMx5hVtoyH2JpTMZD 7HWCV7y2eK7Gugr74IUv6Ns0/3v6USJ7QO1taLs6jQwxc3RDxgQIAoC7vZvkTBQLMOQ8 ua6NF2kTg0o/Mw05VRIQ5nZ8hdLaoSRV2+c5Xpbu1PMe/9B4DIp2/7LaL5Pfx04Knlii 1Bkw== X-Gm-Message-State: AOAM5311rYbrYLInYnyOP2uG8oE0IWYRoJ6HuPUTvs2RuQi8ctDsspq6 yVGKQxdv0+lL0wWi8zhiFDih3dtUklY/Sg== X-Google-Smtp-Source: ABdhPJw0oSesAjkdoGIfe0Yp23QLnB7YgSIf6XSVFk3U1gK6kftBL64Ofezt98ZmRBfyXwfWmQIRnQ== X-Received: by 2002:a05:6638:3052:: with SMTP id u18mr30704277jak.148.1635893629646; Tue, 02 Nov 2021 15:53:49 -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 h14sm205427ils.75.2021.11.02.15.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 15:53:49 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Subject: [PATCH v2 30/30] bsd-user/x86_64/target_arch_signal.h: use new target_os_ucontext.h Date: Tue, 2 Nov 2021 16:52:48 -0600 Message-Id: <20211102225248.52999-31-imp@bsdimp.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211102225248.52999-1-imp@bsdimp.com> References: <20211102225248.52999-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d36; envelope-from=imp@bsdimp.com; helo=mail-io1-xd36.google.com X-Spam_score_int: -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 , Richard Henderson , Philippe Mathieu-Daude , Laurent Vivier , Michael Tokarev , 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;