Message ID | 20220310112725.570053-35-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp923985mag; Thu, 10 Mar 2022 04:03:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz3yVWqwpedBCtgaoxwysliU0Wj1XnQ1kcfpj672iJcFyVncyXxoDsVi4KCtyfYmG4bvGD X-Received: by 2002:a05:6902:2c3:b0:624:4a88:d7a2 with SMTP id w3-20020a05690202c300b006244a88d7a2mr3464663ybh.145.1646913801716; Thu, 10 Mar 2022 04:03:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646913801; cv=none; d=google.com; s=arc-20160816; b=iHXjSXBkvHjdidUz0fENKeaw3Qfgl8b1X5c7tuDj04ZfsyYrp6F5KVzZB778x5fGd3 so8oGNR+WEo9eprjSzEWG2BjCqCq5DBmbBl253qvBPEEKyeD3mMs+NyC5BVSO9vCZYr6 yoQQgaAg45A9i2gwVAXzUQmJ9gHpOAQ5ViTxv8gE0cUj/O8ytJD5crYHMdjLgDmsBK0b bwSYorar9MviJ0Z+pyCB4z1YG3MRd9V6Az5JtJSAP3aSeqIX9a0mHBYTA5T443B7puE6 n4l2bZwLxGQg5ipGXfugzg4G48WJeifILAlwDJmz+XDxqLE0MTxRidUS++PznUXqTeoc GfDg== 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=Q//3kePGgY2lzpncF0BtSDXigvkTy7INMFgUKN7BKXk=; b=fevcr4yl0M4hl86aVNIV6PWGrc9WqP6faC/6nryAJo/1YU3wr3M9axap+XwHXEyWg7 NlkkY+Vm27eJ/MsLhBeqXdRbU3992XRHd2zErqGL0VnZ5OV0CUUh5RmFTEAZH2L0mr6/ UBop3DcKHPIqrV5rN1TA6TwJLHD0XMLf+a4azobCbEFoCP49RWn3F/+s1gnMMyTUY5Ds wXQG3UQ5J4UyMiXWu57Zae4T+zEAqA2MvZwBoRinNsZEr+WB1t2EEJH46IP4ycXDLz5/ v0EML6RJFfw/ay4CKWC8jvb706+vHlZYiMAhVybfuP8T4j6o/dlJG5wNYvldflUzc4zC 5XOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="TJ6zZ/qs"; 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: <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 x10-20020a25e00a000000b00629214beed6si2946551ybg.467.2022.03.10.04.03.21 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Mar 2022 04:03:21 -0800 (PST) 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="TJ6zZ/qs"; 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]:54560 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 1nSHVp-0002Pg-51 for patch@linaro.org; Thu, 10 Mar 2022 07:03:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51108) 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 1nSGxl-0006Gy-B6 for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:28:10 -0500 Received: from [2607:f8b0:4864:20::435] (port=36601 helo=mail-pf1-x435.google.com) 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 1nSGxj-00081p-Rx for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:28:09 -0500 Received: by mail-pf1-x435.google.com with SMTP id z16so4860814pfh.3 for <qemu-devel@nongnu.org>; Thu, 10 Mar 2022 03:28:07 -0800 (PST) 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=Q//3kePGgY2lzpncF0BtSDXigvkTy7INMFgUKN7BKXk=; b=TJ6zZ/qsnRY/oDfupoqzP27kParNBnJekeH6TmOs+t2BijfY5Yy/U+cN8QjXbTIOSN tzo0lI1nO8GiwpdYGJIRIbEQ1h/LqRTFXui4QVjgD6hAXfxpzqX1BA1GWjomYmFgf9UN g9KK6KnNpbGBu6hTzhz+uzfMU28CqrFnMmKcMngVWYQIzabZAt3w2/nx3PIrJ7vM054Z vfBew+O4c63rDg/9YS7ScLfdqL54mgD0VBQBvwFl5V6gUDdij1mMlPNVApzsDLpIayeO tsQat+gcn2LKJ7ijgvLk1BokcIHVA92NAmoEhlfvSGccyXSc31ExDthNUQMnGG4+LvV5 lLDg== 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=Q//3kePGgY2lzpncF0BtSDXigvkTy7INMFgUKN7BKXk=; b=KA3pS8/oWTYQdbuQ2GpOpnkc7NJywV7zPeZxgOjBehUUIIOBLf9JreqkveKZ1Rrrja g01CpL9Yq+Z9Zux+KZTENczpWTnykK+e2mon6hd+cJXn3V23Fb2XOGq7fOnprqMS8dCN gwQ3oGgTUAQMezUBo5/5UvVdJlW5HfekbGf8cV/0eLPIdYJSpsyIRbTHtuj9+dMGHLzF AmjBUdqC4U1q1Q7GjP8skvftBo9kGXCcurbquGJCUtxXU+rvmpfwD6GgSFWhMjRJybUy T8X5AYgp5TpC2sxCXen5Pn9EC7RcDi8w604yTVkrXW98zedYmsPaQ0utoQrFGPAItXbJ HdPw== X-Gm-Message-State: AOAM531QQEhPOBeyZo8J257qLPkVOnlV+UumiZaWa1eJ8HTFeCCMe7BJ LyS3wzxJfukSDIcNHhUEYZx2qkjrnKUSEw== X-Received: by 2002:a05:6a00:2166:b0:4f6:67fe:a336 with SMTP id r6-20020a056a00216600b004f667fea336mr4533678pff.17.1646911686072; Thu, 10 Mar 2022 03:28:06 -0800 (PST) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id js15-20020a17090b148f00b001bfc8614b93sm3114977pjb.1.2022.03.10.03.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 03:28:05 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v5 34/48] target/nios2: Enable unaligned traps for system mode Date: Thu, 10 Mar 2022 03:27:11 -0800 Message-Id: <20220310112725.570053-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220310112725.570053-1-richard.henderson@linaro.org> References: <20220310112725.570053-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::435 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: marex@denx.de, peter.maydell@linaro.org, amir.gonnen@neuroblade.ai Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
target/nios2: Shadow register set, EIC and VIC
|
expand
|
diff --git a/configs/targets/nios2-softmmu.mak b/configs/targets/nios2-softmmu.mak index 9a372f0717..1e93b54cd1 100644 --- a/configs/targets/nios2-softmmu.mak +++ b/configs/targets/nios2-softmmu.mak @@ -1 +1,2 @@ TARGET_ARCH=nios2 +TARGET_ALIGNED_ONLY=y diff --git a/target/nios2/helper.c b/target/nios2/helper.c index 460032adc0..bf40cff779 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -264,8 +264,8 @@ void nios2_cpu_do_unaligned_access(CPUState *cs, vaddr addr, CPUNios2State *env = &cpu->env; env->ctrl[CR_BADADDR] = addr; - env->ctrl[CR_EXCEPTION] = FIELD_DP32(0, CR_EXCEPTION, CAUSE, EXCP_UNALIGN); - helper_raise_exception(env, EXCP_UNALIGN); + cs->exception_index = EXCP_UNALIGN; + cpu_loop_exit_restore(cs, retaddr); } bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
Unaligned traps are optional, but required with an mmu. Turn them on always, because the fallback behaviour is not documented (though presumably it discards low bits). Enable alignment checks in the config file. Unwind the guest pc properly from do_unaligned_access. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- configs/targets/nios2-softmmu.mak | 1 + target/nios2/helper.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)