From patchwork Fri Oct 1 17:11:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515070 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1008743jaf; Fri, 1 Oct 2021 10:28:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziTL4wmMpVUH7dk8o7Y3ghdcgav75X0PnuZDKW+HzlNmrm23ChVgWKfK4b6vM1NzPIuIdX X-Received: by 2002:a05:6122:1681:: with SMTP id 1mr8554096vkl.9.1633109280429; Fri, 01 Oct 2021 10:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633109280; cv=none; d=google.com; s=arc-20160816; b=kpl4pMP8FPmVenPfuMhFwuPR+d0r6ahkDqWVQnsQFjXz6NL80D48Q5otg2ffV57k9i J0ZlwXEQC2uOkVhWDUtu+ynI/09tZfSqtZsVxbiOBQ5YwbPrPty0WeZprZ64SF/Sd+X9 16Frw5/kmnGN2nBNb4YnA6vCGiAGX9TC6f/wW2s8BH4xupf7rd0V67RYP365s2CqrHY2 zkpUa2jgUnonWTLjpuHc/p5hRe1g7064VoGW2KcGK78forQrGkPstKmvEWk6T0h63J9o JiDJfcMgxhqYnmVy0T1UNtzgLPG6MWTogc9VSYE7WB9pQLfft7cPQgpPChAdCEYRsBjn A12Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=lavEGkgqky/ZtxbH6vUwcfGBAKCbGr33b9BznRGO5aU=; b=DkL0RLkdsiTr63DUkhN9Eqq9dI8UD7LW9xiTsRzk/35WKifUMv64I5G5DXf+4fS6dP ug5b75U6RCRDwV/0rHGROa6LYOltgN10jkJS46xT8X6sBLaCR3SJnY3h/Y5O04OtQde7 1Q56OhWOfxOY8GHC9PoQMAO1X1O+1R2UNRelawOqVEY/uOo1css3TqoyMf79miqmYp1V fDGd8EldrbH4ieYHRLrC7jD1UFwRRRbTrdJPMop3EwdFRoh68lHRpjuiZR3u/5efeUOU kI4vSKRbn8VIeRxTU3b+o5rH5iIbRrjFDIBZAVKtqPuIUaHAR3YxdhrQTeOv/e+QbYvi 4YPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zARl9BpO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k2si2622051vkn.39.2021.10.01.10.28.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zARl9BpO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMKF-0003wh-RC for patch@linaro.org; Fri, 01 Oct 2021 13:27:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWM4t-0004gu-Px for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:12:07 -0400 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:44987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWM4q-00050S-H1 for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:12:07 -0400 Received: by mail-qt1-x82f.google.com with SMTP id r16so9588788qtw.11 for ; Fri, 01 Oct 2021 10:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lavEGkgqky/ZtxbH6vUwcfGBAKCbGr33b9BznRGO5aU=; b=zARl9BpORiMdLKBoL9tIxF920e/AQULOqqM9vtZqXgmsIurF6AA/as5mLLVXlJ9yHg eTKuhftoW4epbDwDINPGSCndyrV31PM+URBPDeMmYV51pT9b1avsHkfeqCXIozUa8bd0 +GJShsRrzuKpTknwmZW9KtiGeUUDQ3D1yN5Aa/AfX6472qzgqK14DJruB7nN18yNSUz7 Nsgq2GIOal8MxIfScptaHQm/HPj6uZbNz4f1AHWlyIaz9rWXya6EgEEiaHSXx+ymZk7O SR9yUqo6nEzQ7bhK1fSqwhavoRhNfhhIG3VHA4zsPq9Dt0RdfBnFpHHQeeLW+bmwVSgt EXsw== 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=lavEGkgqky/ZtxbH6vUwcfGBAKCbGr33b9BznRGO5aU=; b=Jxxtxlp8keWfT+4YKYr5rmwxlVYYx2QSQkFULT8pqET+4bVCtUZhXSgfa7CKoloqAL An4oHSZWHCo6A+7x9ygt4CHpswFsbbzRNKb8r5gwyGpbXKmhBBHGpP/sevawy1KpOUJi BRziomtmvbx+7/RgkQPBY7adoqY2n/ZQQlQrCQyoH6aa8iGUcSIMATokojbqBgGqMqVq 6SaNt+9ksmn9iC13vtmL74ymyWv1XTu+dAiv97QbQzw4vz3RjPBHqKH1lXIC4FCFvCGB BDRBspO6nWf4rEUYYqLddNBhIAf03MvtAojJFzqC3pjeqwvCKPVZbgM40/8lwu9pHRQo duMA== X-Gm-Message-State: AOAM532ss27jGt0Llzllg2ZpXI0VS2+cM4/ejWAERZLNCCE+bGJOlaJE HouLHMK409i8g7NywFgPHQtBh/nN9go8zQ== X-Received: by 2002:a05:622a:130c:: with SMTP id v12mr14129936qtk.315.1633108321361; Fri, 01 Oct 2021 10:12:01 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id y15sm3557250qko.78.2021.10.01.10.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:12:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 09/41] linux-user/host/alpha: Populate host_signal.h Date: Fri, 1 Oct 2021 13:11:19 -0400 Message-Id: <20211001171151.1739472-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001171151.1739472-1-richard.henderson@linaro.org> References: <20211001171151.1739472-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x82f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-?= =?utf-8?b?RGF1ZMOp?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Split host_signal_pc and host_signal_write out of user-exec.c. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/host/alpha/host-signal.h | 41 +++++++++++++++++++++++++++++ accel/tcg/user-exec.c | 31 +--------------------- 2 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 linux-user/host/alpha/host-signal.h -- 2.25.1 diff --git a/linux-user/host/alpha/host-signal.h b/linux-user/host/alpha/host-signal.h new file mode 100644 index 0000000000..e27704d832 --- /dev/null +++ b/linux-user/host/alpha/host-signal.h @@ -0,0 +1,41 @@ +/* + * host-signal.h: signal info dependent on the host architecture + * + * Copyright (C) 2021 Linaro Limited + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef ALPHA_HOST_SIGNAL_H +#define ALPHA_HOST_SIGNAL_H + +static inline uintptr_t host_signal_pc(ucontext_t *uc) +{ + return uc->uc_mcontext.sc_pc; +} + +static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) +{ + uint32_t *pc = (uint32_t *)host_signal_pc(uc); + uint32_t insn = *pc; + + /* XXX: need kernel patch to get write flag faster */ + switch (insn >> 26) { + case 0x0d: /* stw */ + case 0x0e: /* stb */ + case 0x0f: /* stq_u */ + case 0x24: /* stf */ + case 0x25: /* stg */ + case 0x26: /* sts */ + case 0x27: /* stt */ + case 0x2c: /* stl */ + case 0x2d: /* stq */ + case 0x2e: /* stl_c */ + case 0x2f: /* stq_c */ + return true; + } + return false; +} + +#endif diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index e9e530e2e1..b895b5c8bd 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -255,36 +255,7 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size, return size ? g2h(env_cpu(env), addr) : NULL; } -#if defined(__alpha__) - -int cpu_signal_handler(int host_signum, void *pinfo, - void *puc) -{ - siginfo_t *info = pinfo; - ucontext_t *uc = puc; - uint32_t *pc = uc->uc_mcontext.sc_pc; - uint32_t insn = *pc; - int is_write = 0; - - /* XXX: need kernel patch to get write flag faster */ - switch (insn >> 26) { - case 0x0d: /* stw */ - case 0x0e: /* stb */ - case 0x0f: /* stq_u */ - case 0x24: /* stf */ - case 0x25: /* stg */ - case 0x26: /* sts */ - case 0x27: /* stt */ - case 0x2c: /* stl */ - case 0x2d: /* stq */ - case 0x2e: /* stl_c */ - case 0x2f: /* stq_c */ - is_write = 1; - } - - return handle_cpu_signal(pc, info, is_write, &uc->uc_sigmask); -} -#elif defined(__sparc__) +#if defined(__sparc__) int cpu_signal_handler(int host_signum, void *pinfo, void *puc)