From patchwork Fri Oct 15 04:09:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515793 Delivered-To: patch@linaro.org Received: by 2002:ac0:da11:0:0:0:0:0 with SMTP id d17csp136524imi; Thu, 14 Oct 2021 21:19:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH+wf8AjE9YbBz7nsquvS2fwHHN8HH1/g32tVTur62mBNRAp7VygfP/9mTULXEsAZJjCFS X-Received: by 2002:a05:6e02:1649:: with SMTP id v9mr2253502ilu.171.1634271598763; Thu, 14 Oct 2021 21:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634271598; cv=none; d=google.com; s=arc-20160816; b=MBePT52KYdtuy9/mEHVJTIk3Upfep9hrrzTeYfLAfyjlThSdQZEGeYlljcGt94Y7Oa qsKO9WW+EncLzuJ554uQVuxGxAiKdnvQpIUtdC4GyxxbcxjqniBvk6VlMI5zyVkTV6lX a0WapJarrrWV9FczKyp+fSns+OEzpqSoxd4SJ7rf/VCWNObhbgJudzmpcgPSuJpFM+I8 oOqnyS7sR7XmC4+6nz8R3mnQcF+g1nr/i0+2lzLeu8wyWhgy+ifEygm3PIN1n2X3/6bD 3kC4xX8du/Wvg9s7h0S0A4YJrnguiHeXLeNdNV9W74+xdPpz3+Dd9poXKy9n0vxjt06n s7UQ== 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=BJUdaZcFQkGn0Ur44U4wi+Gizq9wqvJWic/PiqjpH80=; b=U7K741a2vijZv3FdlRZnwr9dSNiZHGg8pH0Hap4ekfUQSPVnZ3FvH5JIWdC3ozJwm4 ZPd8oj4HCuzWgfU+dhXlAoVNwdj38qbNABKTchfgCqCrMNnB0AvDf+BRTY/yZl5jyte8 QwvGLwzvwdHNTKOUydQB8n5NtYR3M/UtSMq5FSpK1j/JM53HFDhF/yUOehBpvVIZtWIy 2YcFHdoQsc2AgtrhyvncGNIRvRLJlqGrA5dSa2VDG0g5B7N0K3PiA40D5V+624hzH1pg SujCIvWCXwzhiZf9dWbE5/vqLJrAe/iHgCLhcNZRFFsk99bBG//c8vwm5rAON50lDYzG QwZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=H8DucyRd; 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 y6si6973715ilv.110.2021.10.14.21.19.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Oct 2021 21:19:58 -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=H8DucyRd; 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]:48500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbEhK-0007QZ-2W for patch@linaro.org; Fri, 15 Oct 2021 00:19:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbEYn-00071e-Nh for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:11:09 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:36383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbEYk-0000Bi-0j for qemu-devel@nongnu.org; Fri, 15 Oct 2021 00:11:09 -0400 Received: by mail-pg1-x534.google.com with SMTP id 75so7458788pga.3 for ; Thu, 14 Oct 2021 21:11:05 -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=BJUdaZcFQkGn0Ur44U4wi+Gizq9wqvJWic/PiqjpH80=; b=H8DucyRdyFs7Dzgt2Ow6Ng+qQogi/7hnlrrEBhxFn7AhnvPexNFAl5g9sLDV+rwNL7 GNhhN5y8dVC8Zy1ilbb99b//lxDSIU6EBJyfWCQYBAOdKacWZrlmrVaFqa0Ik+oFLXh/ eg62JbYJx4hTxYtq+A7McCMjEz2+GtE9yh8On/HICZ/TRvQv4eBWnZ9yi3i/dQm72cgQ oaQLNos4sbWkmLhZQsudIuKOuFmlIOAUEWTwG4oyNi+gJO9NxkpSNsiMtE8cUjgppa1X KJCGTJHU1wQVwmSetX0XsgJTjUSilwHZMoH+e4q3BZf6n+6WsMApqPMh04pCFDyzvESu FIkQ== 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=BJUdaZcFQkGn0Ur44U4wi+Gizq9wqvJWic/PiqjpH80=; b=Pip/6Ag3bzMO/E+Vc+SquTluMFrFHmAfrEigo6B9Q0o6lD+ZGGPR9lj4vFFqU65Y1r GuzTyszG51gNZhnjCuuPGdxWVeZutibPwP7Ml1lRSLi77k8xhg2PMmZK62PJr6csEfnt HGMUYqn8jQ85BM7p0f4K34uSWDii4rRw23bMZfwz15ZzQEDBb6fGyNwpdOe3f+UlSfTa RnKrKUUxGGl/XA/Iyi29QqcrQZtqdRfW59qkoa8ue172CqkBzpuuOgIxq532wjkd/Ohm oW/3O3DPMKUOxFYkKXPuX3SIwl95udW2pKxa3kW44+BHVokoLW7YW0mcJcGTOovljIRP cqXw== X-Gm-Message-State: AOAM532dBnZX/bFPIwPgIxqEzrugJRmbbBvO7PWieY8FBnRPeeXrTIAB 8vzyL6xcr4aPeWmMW2+JtuW0BxCrlG4Mhw== X-Received: by 2002:aa7:9542:0:b0:44c:6db9:f596 with SMTP id w2-20020aa79542000000b0044c6db9f596mr9437073pfq.21.1634271063536; Thu, 14 Oct 2021 21:11:03 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id me12sm5718006pjb.27.2021.10.14.21.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 21:11:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 09/67] linux-user/host/alpha: Populate host_signal.h Date: Thu, 14 Oct 2021 21:09:55 -0700 Message-Id: <20211015041053.2769193-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015041053.2769193-1-richard.henderson@linaro.org> References: <20211015041053.2769193-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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, imp@bsdimp.com, =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= 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 e0cc765069..0db3c5cf3c 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)