From patchwork Thu Apr 21 15:17:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564385 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp571640map; Thu, 21 Apr 2022 09:08:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbSBP3pEAmhW5AM6GUPFHlbC/X0mRxKbPlEHfHdYyl6tu0Kaqlx4iDGU2x+9s6v42jIis7 X-Received: by 2002:a81:58c1:0:b0:2eb:faf0:1e25 with SMTP id m184-20020a8158c1000000b002ebfaf01e25mr358878ywb.311.1650557284375; Thu, 21 Apr 2022 09:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650557284; cv=none; d=google.com; s=arc-20160816; b=tqWRnOtL/Vdun95XYFIu8oOaFAWBR7LRkUOiVmL0glyrGdiWYDkwQqeU4DU/3dXYaN fpdlHNyOjGFxI4JGJxbCUrh33MzwSTiD1oKpd0kHaZfoyoo8eRbASg/7Mlkq/b75Eq8W MZgT/ovKHNIhTnj3PXfkTDVxSF7P3lCt+eqfWDFvCze8OaV8EEq751n+2GMf51pwQL70 RcnN6zj2+cnSXGTftgZ93ffJQ0al58/81dOqv0Yx+0Lu5QVIMvHCqDsSVhXQn1m1Z7S6 S3KkuC++xhNs2ELSqqDFEme2NDHupXAAPfIQutzRre2+6xfRCyixMjaAdZybHItYXkGu us8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=0EK3Litbg/R+iOy2ToK0s2extd0TPN3Lzla7IqyLnHw=; b=FZmyf4iLAweEcSZnHchzookfYW9mfa1groBRUrTXUo9VcZGGbYgojwY6LGbyRvyEdD GMRM2AcmfRrTiI4ds6tRqXOWbkqByhLyaEqP2NVCBFs/jT6gHBoo+6Yw7m0ES6HfMlH2 8NOvzSbaFHDg2qVR11Um/euiVBIPyWdZH0ONzOOFd2MHOo3Ewihe71dQcZJ/d9fa2uC4 n/cT/Pu0LGlyMcaSMs+sn0Z5oGm8rtS7d7XXhPNuUAlh8wIF/536kkmXJbZJEfqm7jl7 3nvYfAeodNi1kZz9RLvHAVeoDsL4BnSeJJYH9/Fc3bjuy2mTIGHcDzif73U5xT0USFYJ fvdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ugf1TBiM; 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 77-20020a810550000000b002f4cdec4ff8si2628145ywf.316.2022.04.21.09.08.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 09:08:04 -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=Ugf1TBiM; 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]:53684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhZLf-0000VZ-T9 for patch@linaro.org; Thu, 21 Apr 2022 12:08:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYZo-0008Mu-OT for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:36 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:56291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhYZk-0006Mk-DX for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:36 -0400 Received: by mail-pj1-x102e.google.com with SMTP id u5so2135104pjr.5 for ; Thu, 21 Apr 2022 08:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=0EK3Litbg/R+iOy2ToK0s2extd0TPN3Lzla7IqyLnHw=; b=Ugf1TBiMd/z3DJy8wKTkEYQivWD79jLPPhZb38Ir/jzkn5EiyH1GU03n1c2t/Ue0yS t3NP+vI9l16cOYLtqrUxCm0eSO3SmJHzYCfdMBOXNv0wwwDZyAbE1EWhuWh9pXIQf2Te By/8nPm4WMMJYv04wUshvO8bAAU130ZfWgQE1V2Mug5oweojTDd0gMqyt7nGEWVcFHlo gZYRQdF+w57aPw4fObXNJWhuVe9h4KOgDP2fVQ0eOj1ahMO0cqxUDV6uLGnuq+hYrLJi c2kC8T+cKqHV+LWDoJ/PRV/P8HsZQA1HzoRhjSMt5/ABv8IdnowaGfjuO6UONS+0TSo1 3a2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0EK3Litbg/R+iOy2ToK0s2extd0TPN3Lzla7IqyLnHw=; b=NqfMC2Xfg0fmLhG30CP5JYFJ5JRyANteglLj9pLbliCMSg0CShmET9Wrvg5qHaKmZl xahilexs/ecbjiHk/QicxE4IuRrtk2P9NU6YvcnPcZ/EOAoI1P5O+FVnGNSAPDI6ElOn H+ZXbsqJXfMD3Vk+SyXNKX4UlPKTaXHNY7r0eI5FDdjCNcRGSxYYwAWMHFNVR76gP9NB QtPe4Ra2vtA/n8oBx38nmHHBCEobFBR0QYMlwHdL5nUlagzzDLY2PGhXxf9M8Z/r3obG kjGz2yvfZk3cSUMruSWO5IEnrUmHb/tRXATYksCQ4+aLYppQfZTqBoVDdOGLT2ntheH2 LU6Q== X-Gm-Message-State: AOAM533D0fFyUun6JU+BzYhSLkNspzgex6RIALzAkSySxsmvotUqhmC9 13t4KGibhC7z9SSrp10uw0if49njaydwCw== X-Received: by 2002:a17:902:c944:b0:158:de4a:6975 with SMTP id i4-20020a170902c94400b00158de4a6975mr25704716pla.131.1650554310842; Thu, 21 Apr 2022 08:18:30 -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.18.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:18:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 34/64] target/nios2: Handle EXCP_UNALIGN and EXCP_UALIGND Date: Thu, 21 Apr 2022 08:17:05 -0700 Message-Id: <20220421151735.31996-35-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 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While some of the plumbing for misaligned data is present, in the form of nios2_cpu_do_unaligned_access, the hook will not be called because TARGET_ALIGNED_ONLY is not set in configs/targets/nios2-softmmu.mak. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/nios2/helper.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/nios2/helper.c b/target/nios2/helper.c index c57ffd64e0..25a89724d0 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -99,6 +99,12 @@ void nios2_cpu_do_interrupt(CPUState *cs) case EXCP_ILLEGAL: name = "ILLEGAL insn"; break; + case EXCP_UNALIGN: + name = "Misaligned (data)"; + break; + case EXCP_UNALIGND: + name = "Misaligned (destination)"; + break; case EXCP_TRAP: name = "TRAP insn"; break; @@ -147,6 +153,8 @@ void nios2_cpu_do_interrupt(CPUState *cs) case EXCP_SUPERD: case EXCP_ILLEGAL: case EXCP_TRAP: + case EXCP_UNALIGN: + case EXCP_UNALIGND: do_exception(cpu, cpu->exception_addr, false); break;