From patchwork Tue Nov 2 11:06:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516647 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp4411931iml; Tue, 2 Nov 2021 04:29:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu/NeAewIIskk3rLMgo8huYtX8Ne6e+Zeh7CtSKgn2YFILUxVDfn8z4Rd6KN7ZRkMusNE1 X-Received: by 2002:aca:783:: with SMTP id 125mr4620548oih.29.1635852550311; Tue, 02 Nov 2021 04:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635852550; cv=none; d=google.com; s=arc-20160816; b=fT026TV2XM7+JSZSmpiM5yJoaFGbUDfzYjO7V4GKheSMpK9GHKsN2uhOYBuxbnir5m XbtRvoTERJOSDOZtPVoxbWAxmsco9aFITq6pncAH9BH5ZzS1cAwW5r4ZUIOYr7uXPuJ/ rQbjL5VhAYwv0Ku3DFvAkQeZO1FjKucl+cNUqYPvsWxyVEAOdR6o3vBg+HFGdAMyV1+A xnJp6wLypMFI+9H9ZUjk+NVUyJmFNAXsCACMDxIlZcZAjm4jhaspIqXFXXlUByQI1QdJ R9VbdR/2rp48jeWOETGTjTdJ9KVWDc7qk2/058oySl1eW5rdYdTL03/ijt/3guHhqMnG JsPw== 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=Xi5Xc/by+fXO9rb16n3Qpt44Vj6KLnw5qZ8SYUB9TCU=; b=p3yGql4p/rq1zjxcTa3yi6nt5HsZPzF9v2ivVyftO21ebfQX+bNtxsusUqQ6q3ni4E cBnbtZrIzNoxUf2YAfg7ZaObrtnz84SUsSJAf0D8+6EmQfcJzOPPiodkGPMkbnEb6Gkk RLPh4gOzH/4IfjaGXfLYjv+rYMuomjhHuC5pRaEDzA6ablKT83Q+PplwW9rTUfw+AIiH L/Nrig7BYm8+WYyJ3SEVKzk9ZJjQer2X08nUAATAbPlXU/8B2Xi11cHmqLz62JMC30yC Z2+S4p5ijZ9Z9LuAUusNKlv6OYFoQn1FkLoFlOolVKSXGr1wKB7G13JO5Ju4T9Au27Om k/YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QQrtI7EZ; 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=pass (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 bl6si10803010oib.175.2021.11.02.04.29.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Nov 2021 04:29:10 -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=pass header.i=@linaro.org header.s=google header.b=QQrtI7EZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhryX-0007lh-LV for patch@linaro.org; Tue, 02 Nov 2021 07:29:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhrdz-0003jj-RY for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:07:59 -0400 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:47025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhrds-0000sO-7G for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:07:54 -0400 Received: by mail-qt1-x82b.google.com with SMTP id s1so17057747qta.13 for ; Tue, 02 Nov 2021 04:07:47 -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=Xi5Xc/by+fXO9rb16n3Qpt44Vj6KLnw5qZ8SYUB9TCU=; b=QQrtI7EZahGS/Rso0AXET1VU/SFI5k/kagepGctStPT7hJWf/c0IEO+sF3H3B422oK wcfGvOcHI3tnd1MqOt18Mf/aLT2165PY1ufbWKH8eFiCZY6BHG16W2q564/Xwsrt9gTw ZMiFkvmWK9Vu86RQXGDvNT52qHADPhT3uATl4OElOwZKsOb8S2TvPybPN586d+aC9Ohy LpqaE1YgKI4BCjQQpF4X2oAD38gAwoS/g/IDRtY2a2usMM5uCptF9c/Wtf/NRXqkJhJS AzSMBwNV+rXPZS4OjGho5tOkj2wpDtTJU6mYZaC3sFN8Obh8PV0/OMvxZucNSqIsVJci Jr0w== 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=Xi5Xc/by+fXO9rb16n3Qpt44Vj6KLnw5qZ8SYUB9TCU=; b=F0X90bK2XvkGeMTGWOa4JlFXmDOn2ufSUpRkqBxxcE+6MfRBstbLvrdfPJj5PaQbyD ki+9xDOqkDjvj0UHiTF0IM1QRnairGsvmamKIogcLNd+oK9URvTVsi3UQ5Csn2XQtiQM stsYg+z24arX3AAAmPywcCvJkvsTG8DhRz7hSiW6FBCXdXy0J/ucXv2tWLH3hn4TwNd8 NF8a1IMGW+FqnN570LPjgrLEnPWNTbCzbdeF5qilX5D6IaOngnV+xbuIw6KwQjYhzD4v FHAY6sy119/GWb/NQZ95VTJgG2rbLTO0aUlnYAr9QnseH2xS/0hJM6qLWnQttvR1gAzh +DbA== X-Gm-Message-State: AOAM533XVPcKg2bn+wH+e+IGKpmjJrzGWaMc6kv0YCoY2m0z+C2of77+ EJ7JrTaWYRDbPBaCyvncB8s5Ro3o1Gds0g== X-Received: by 2002:a05:622a:1aaa:: with SMTP id s42mr27799400qtc.376.1635851266962; Tue, 02 Nov 2021 04:07:46 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id bm7sm3568612qkb.86.2021.11.02.04.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 04:07:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/60] linux-user/host/alpha: Populate host_signal.h Date: Tue, 2 Nov 2021 07:06:49 -0400 Message-Id: <20211102110740.215699-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102110740.215699-1-richard.henderson@linaro.org> References: <20211102110740.215699-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x82b.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_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 | 42 +++++++++++++++++++++++++++++ accel/tcg/user-exec.c | 31 +-------------------- 2 files changed, 43 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..e080be412f --- /dev/null +++ b/linux-user/host/alpha/host-signal.h @@ -0,0 +1,42 @@ +/* + * host-signal.h: signal info dependent on the host architecture + * + * Copyright (c) 2003-2005 Fabrice Bellard + * Copyright (c) 2021 Linaro Limited + * + * This work is licensed under the terms of the GNU LGPL, version 2.1 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 5a0a65fa46..e9b6eb696f 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -253,36 +253,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)