Message ID | 20220317050538.924111-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 u19csp885285mag; Wed, 16 Mar 2022 22:34:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe3cPU7IbS5Nvc9imQ/7nHktPNxc7ft51DK6TLedxF2cMD9tsIWRY5WNvZEh1OdU1/c9rY X-Received: by 2002:a05:622a:650:b0:2e1:e5cb:e47d with SMTP id a16-20020a05622a065000b002e1e5cbe47dmr2483174qtb.223.1647495268019; Wed, 16 Mar 2022 22:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647495268; cv=none; d=google.com; s=arc-20160816; b=mBW0SJ659V8Lywi343UTU8jRd+Ptc/gF27hbpzq4Hl7Vbdg6QppPqgt5vIHpdplvcQ tePIk9nvY37+GlR/d6jFVgjHeotrmk1eSCV7CDqeI3OhoPHAUWFHLQiRilzsnJHmKWuh 8eqmjjqaZdYe74HDNwADbssF7ScOE5K2Lc7ZHu4jyyVCEf6C7g9elCGIid6pYlWvIIsH wBkJ0Bwd3cA4ri8zic9ieC2/HpCmrYYGEbbHMvgu7Uzs/ECc21bgtpAXAqGEPpjuuatw /1stEHQL/hzFlea9zljUeMFuv2bTgUoVMKwkvRWTCbU0NoeJJlZShPvw9BoR6B+OQAWN 3zww== 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=5de5JN0djpoCpESfODi2INQYJ/S5KNFn/Rt19ewlkfA=; b=hltSkCgICZszl5oxtXmVFgkoWQMf06rUAGKf0APMaO/+a9hNzL4E+6JThKEu9TfhUu N4KhwDIcSGWhjGZ6o75EmIT9D0k4Q5KOTBkozrnB1ebp8IBhxqAIqUIEXHtt5YEYPqi9 boNipxF/SY3q/2cMYW8bCKLBmRfnRDU+KR6ptmGyfqyn1E2kmd8yQFFOg9P+GpokfaWK 3f5EYNCuO3mE5urB89ZUkWJW8hC9TB5pZol0rrRXVmeKwKKK2SpoggGe6qGLNkg4RpkL HF42VDKsv4tD4oQgHbcrPb4lFpifA16mk+Jl+5slTXrsBT50g5ruAxqazeEBwReDrfhF o+uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SGOpv71I; 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 f11-20020a05620a408b00b0067dde524ffdsi1155646qko.137.2022.03.16.22.34.27 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Mar 2022 22:34:28 -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=SGOpv71I; 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]:54198 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 1nUimJ-0004hV-J3 for patch@linaro.org; Thu, 17 Mar 2022 01:34:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51136) 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 1nUiL4-0001Uo-HN for qemu-devel@nongnu.org; Thu, 17 Mar 2022 01:06:19 -0400 Received: from [2607:f8b0:4864:20::42d] (port=41896 helo=mail-pf1-x42d.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 1nUiL0-0002Iy-BC for qemu-devel@nongnu.org; Thu, 17 Mar 2022 01:06:15 -0400 Received: by mail-pf1-x42d.google.com with SMTP id p8so5885120pfh.8 for <qemu-devel@nongnu.org>; Wed, 16 Mar 2022 22:06:13 -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=5de5JN0djpoCpESfODi2INQYJ/S5KNFn/Rt19ewlkfA=; b=SGOpv71IaKANlR+ST5w88ZsiGxfarPuTYBpEO79CszyARAtHQ+aznHE/icIoGGE3VL Iro4hZrMjQDOFTRCoTempDhujfBmUVWKXcPfNOE8JkP/TXxXEt3Z0g4rQwBGxW3uBkQF +E11P64cY78YRFZGKjR2F3HS1MwAgKwvrsIJhvAnkuRCCr5HYquZKpaLasDL11Ov/aIr oEeo2IbV+g7v1+qPtj/Dw3DxKxYSzWZaGLiAJ/D66zfXiMFdEkjuSu0M9ptOZXH/z+Ad fSISgtntkQBbIoVtEKILkzm99tegdiSp7LsaWNkPXqHzLo7+BdlRgb+h2tcfg9PNRqzk K7UQ== 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=5de5JN0djpoCpESfODi2INQYJ/S5KNFn/Rt19ewlkfA=; b=YUZT0yLCPXPj27WQM/2ybLDR9Fa35LWogNIgvigIryKaw69zKpUWrFcl9kiJcYWZii N63njljDsVuUiHPqJNX3a8riHzDY1Vtz1sUrpwmT5fGT6SqOXHdzaLSIQiIIu+QkTxxB VuwT6Urp0QZE30fxs7rHjI7Bv5nk/HFD6vHlh3xv8VNKUkH1Qfk7z53mcv0pwP5+Dmeq ljgw7yx/mEPee2jRI4rW72cOxrimkNeldcySPmzOwZi2HxtdLPrVCK4pC1RyM6X9uhxf 7+6CF3HaaSsI5bYMLG5rKQXL0/WAhniANH0nPN8nZZ3aL0RsWlTaiPlyKJxjr0DMYUg8 WOjQ== X-Gm-Message-State: AOAM531oIXvsYrfjo3U9hKCHdWvpqhehm62dkwycJimKy+XC7rRkwb7/ DwVn7H2dcNQeNVDvTEHd/W4yIMY15FKDUg== X-Received: by 2002:a63:388:0:b0:37c:8577:c8f3 with SMTP id 130-20020a630388000000b0037c8577c8f3mr2369102pgd.148.1647493573102; Wed, 16 Mar 2022 22:06:13 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id h22-20020a056a001a5600b004f7c17b291asm5101357pfv.87.2022.03.16.22.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:06:12 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH for-7.1 v6 34/51] target/nios2: Enable unaligned traps for system mode Date: Wed, 16 Mar 2022 22:05:21 -0700 Message-Id: <20220317050538.924111-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220317050538.924111-1-richard.henderson@linaro.org> References: <20220317050538.924111-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::42d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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, 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
|
On Thu, 17 Mar 2022 at 05:35, Richard Henderson <richard.henderson@linaro.org> wrote: > > 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). Mmm; the instruction descriptions just say "the operation is undefined", so I guess we can do whatever we like :-) > 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> > --- > target/nios2/helper.c | 4 ++-- > configs/targets/nios2-softmmu.mak | 1 + > 2 files changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
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, 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
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> --- target/nios2/helper.c | 4 ++-- configs/targets/nios2-softmmu.mak | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)