Message ID | 20220421151735.31996-2-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp539069map; Thu, 21 Apr 2022 08:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzANnIeGWi6cOZPw5ip+s8uLT4tpf9IzLlN8rUy8UMzaqrR2/+GGkvAohv+RzgoEz8PPSq/ X-Received: by 2002:a25:8104:0:b0:63d:b30d:d291 with SMTP id o4-20020a258104000000b0063db30dd291mr188524ybk.161.1650554906691; Thu, 21 Apr 2022 08:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650554906; cv=none; d=google.com; s=arc-20160816; b=0Ed6mPcQnqkYlL7YVAItnKNmeWB5k0iE5vMFMwLC1bXPAjhq8aLiz+2JVCmbSFaHHE jYSmjD44LwAz+OdF2gvNgNT+SER5FGtLJHzIdv3MksD/LUCoHWvAb80EYCdLPnngBRDb kapJQYWSQ1j+LQnRrOIdQu9fjP7oyyBA0mGaTLbUCbSysfkNFHTDO0ePoP2YKGrh9Lp9 N0lGZunJ2N5HPTlfqwsdr8dTQ/UA29Na8Wb5DZU2yvMWOO0ICjOc8/GLXc61htHSKlnT UvASRh3TrxWVGdOoRn2G+6ciiR/nByJBtCg9K0LXKG49WbYFnCoVy5osWauiV6yO6Cu3 3R4A== 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=tcIID1Tauhkhysj1gC2xGpQ5XH6/Yfy4VHCAd2/0IIg=; b=QzZo2LH7yifYoh4G01GF/spHUrpvS6+q3ZllgC6xx7q9e92/MDkwSWruNBcoeiBpxJ ENafoBQls8h5PF9fW4E87kz9f0J9eqYjy1kYTLXY9PpBZed2sA96HXUtdL6x8FWGBsnU JjWlbhg7CIhl91I0d6lu2d//cREXUXWM1OQvm7sDGpqS0ZMp0XwR0AUqRLwTDhvP6yK8 PwsuXLA9TyuxHn6u1kwqEWUz2SgYqvtfEmw1bou0iO3AAv0jtpZiumScu3MuhYK5i90/ AD6STeuPG3hoOK9jWD6OrAg6eK6iNHnedMpJNsNnqCSvxeFUPTVgrDztWyQat6lUxpjQ pdFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b5Raj597; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o126-20020a815a84000000b002f171433f7csi2151466ywb.182.2022.04.21.08.28.26 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 08:28:26 -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=b5Raj597; 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]:40114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1nhYjK-0008BC-79 for patch@linaro.org; Thu, 21 Apr 2022 11:28:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nhYYx-0006cc-Vu for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:17:44 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:54008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nhYYw-0006C7-68 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:17:43 -0400 Received: by mail-pj1-x1031.google.com with SMTP id bx5so5228895pjb.3 for <qemu-devel@nongnu.org>; Thu, 21 Apr 2022 08:17:41 -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=tcIID1Tauhkhysj1gC2xGpQ5XH6/Yfy4VHCAd2/0IIg=; b=b5Raj597Subkv0gQafl1D/UBkwAjtXzJQnETL91WVeUVHdUoNfeQhpA0DBb7LcCQiD WmwVyLLPrVI5SQ9DUhBbiLXKIJ/8HmuonXa2FxLCZrmiXSF/wGuwJv0rXaS4e+joV1zW PS5XqYAIOWtx+w8Y6CTb1dsSXdYzopZwE+wxdQ/Jq+Hb2cOakATtc4siX7Q4P4+fsQVV dCViJ1PKny9GkrBuPQxQ+aa8dnOtTqPWtxJrIKovjMaS5QKFZEaC3w353XycSPAlNQFh A/asdEvJs51sVxnc83btmWeQV8pH+SVZTCZZRejIavnwsVdSLFJRvvw85ewF+f+gUgkx NJcw== 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=tcIID1Tauhkhysj1gC2xGpQ5XH6/Yfy4VHCAd2/0IIg=; b=4Ks6uu4f0fRTn1h07u9yExE0Sbj+ADZhAVm5WLZLXQbB26JnWoYybYwlreV9zBdLx3 Ak/TvuOE4wgol6n0TskjFcdTYznjdq3vVGt08iwonXId3ZDQWHmADVphYYagzTmcvWC2 mYtj8U5K40qfM5B52w3gldyJiKb9wOSj0rfNTtNoJEST2sLSYOv30gsqDhq58YdBZUKk QBSnFOha5nTqVEvY70Z4eUGNwmqAet8EgutQaO9TWnY/ftnZAKYDdlqH+mPjNX97IUp8 Zp41Xl1FDsHTzwh7d1ZPDI8oeoS+F+RvWEo7WQOQRrcVK68ARmR6+ksvBXblQ33RRntL r23A== X-Gm-Message-State: AOAM533eoa5ItrRG2pNO5aKmlPuPNznAAT0cd1xhnNjhCjRgcbHsChso Ue8eUjoP0X6aF1q8JYA905N35E793mjnAA== X-Received: by 2002:a17:90b:100d:b0:1d2:d49a:c341 with SMTP id gm13-20020a17090b100d00b001d2d49ac341mr173632pjb.130.1650554260783; Thu, 21 Apr 2022 08:17:40 -0700 (PDT) Received: from stoup.. ([2607:fb90:80c8:6cf3:a91a:4957:ba18:ac18]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm24616248pfh.174.2022.04.21.08.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:17:40 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v7 01/64] linux-user/nios2: Hoist pc advance to the top of EXCP_TRAP Date: Thu, 21 Apr 2022 08:16:32 -0700 Message-Id: <20220421151735.31996-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220421151735.31996-1-richard.henderson@linaro.org> References: <20220421151735.31996-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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, T_SCC_BODY_TEXT_LINE=-0.01 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
nios2 fixes, cleanups, shadow reg sets
|
expand
|
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 1e93ef34e6..2e9296750d 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -40,6 +40,12 @@ void cpu_loop(CPUNios2State *env) break; case EXCP_TRAP: + /* + * TODO: This advance should be done in the translator, as + * hardware produces an advanced pc as part of all exceptions. + */ + env->regs[R_PC] += 4; + switch (env->error_code) { case 0: qemu_log_mask(CPU_LOG_INT, "\nSyscall\n"); @@ -56,7 +62,6 @@ void cpu_loop(CPUNios2State *env) env->regs[2] = abs(ret); /* Return value is 0..4096 */ env->regs[7] = ret > 0xfffff000u; - env->regs[R_PC] += 4; break; case 1: @@ -69,6 +74,8 @@ void cpu_loop(CPUNios2State *env) break; case 31: qemu_log_mask(CPU_LOG_INT, "\nTrap 31\n"); + /* Match kernel's breakpoint_c(). */ + env->regs[R_PC] -= 4; force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->regs[R_PC]); break; default: @@ -99,7 +106,6 @@ void cpu_loop(CPUNios2State *env) o = env->regs[5]; n = env->regs[6]; env->regs[2] = qatomic_cmpxchg(h, o, n) - o; - env->regs[R_PC] += 4; } break; }