From mboxrd@z Thu Jan 1 00:00:00 1970 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 44657C433F5 for ; Fri, 1 Oct 2021 17:28: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 C53436187D for ; Fri, 1 Oct 2021 17:28:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C53436187D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMKc-0006XR-V9 for qemu-devel@archiver.kernel.org; Fri, 01 Oct 2021 13:28:22 -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-Google-Smtp-Source: ABdhPJw62XuAkRyWBp5HmHG8Ga7OZi5soKt+KMF6UhB9M0+B0/e8oQWseAktDpSeoCnU9YBT6tlxqw== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.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 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) -- 2.25.1