From nobody Sun Nov 16 05:54:36 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1598614888; cv=none; d=zohomail.com; s=zohoarc; b=lKzFWIAoMcHI+00E0x9c9yc6ZlRYi6Zl/mrivAen1LXO0rnrNj9cWjMayNcCjl0+LZs5Fx0FCSYhKeV763DmA0LICNfHZk+n9onMp+qvpAQfV/NYTQoiOyrKaW+hFoAYXtKZX5fTJa1ufvWGvOxZntEWkNSx+l5ttGIt/ZpyflM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598614888; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kL3W06mXnWndmR6GJLLJiTkowuaDiYxG06aqX/GvAOo=; b=bYhbhU14oxAkpElt3U42s8dF9cZnIOzDm3jLL5tP+H3Lrh+WpbMy/KpLiYwvFkqRCBWrjpSnGbAbP3nJr7aBiLZGhGP6paPcbLuuGd6LYTmGGMjyh1LjtEqYKzpfQo5qE3FdmY1X0a2cnQRwRAhzsgAM5DqETSl9jp55JR+wsXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598614888217607.7937341507508; Fri, 28 Aug 2020 04:41:28 -0700 (PDT) Received: from localhost ([::1]:59454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBcl4-00025E-UV for importer@patchew.org; Fri, 28 Aug 2020 07:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBcjL-0000Pq-Fq; Fri, 28 Aug 2020 07:39:39 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:32912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBcjI-0004Q7-VG; Fri, 28 Aug 2020 07:39:39 -0400 Received: by mail-lj1-x243.google.com with SMTP id r13so955860ljm.0; Fri, 28 Aug 2020 04:39:36 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id a3sm155223ljm.7.2020.08.28.04.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 04:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kL3W06mXnWndmR6GJLLJiTkowuaDiYxG06aqX/GvAOo=; b=Ds+A/DpWxMr4QUhDXo6LhmvMvEFdmuMAVsOegcyAl16/FNjVRDcwyC+T4e8xBL66/J tF7mCS9DU6sJJu+u/5N9I7k8fOtlNnzZTsYqRWk5+uR6k9eQT78QVj3R+3ETVC7Cpekz rM3LhuJEw9JYnXustqQIPFsUE4Nli07/MGVKNnkVS7aL8YyB+iDKTAfFiy5H5o/+jsMo PpHoRlpc6O8SkWn/fPi+OVZ63elVe+NwUnGf1Jr66K/eStLmBSwibDyLymofNVsOK8pG xA3/7npmEMkwKobOSLWAxZyGYExkBrxcoyns6jGbDdNU2yTejW+PAd0V76xPYiIZBkH5 U68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kL3W06mXnWndmR6GJLLJiTkowuaDiYxG06aqX/GvAOo=; b=mmGP2RKN7Y6bxyXEQtISoVC5ShhgmpYiA3zYlITTgrMKAQ30XN1Bp+yFkUxS9zbjxJ p/dhFxrELeocrufNCXMMVkP3FmXXVWI5XHsvD4W2/Ra7cfrA/oxLGmxPcssTQ5199PJy Kbz8Nq8JMMsj4xvzhC24zRzlYiUM0UpnWsDfhvtkAWTIyG3yR0D4BQO9IPxgz+hRPY8e jR8GfIvaGBlb5x975ZsKvkIGChNfcr8GIdWa/kxwTjps+VWkyVA1L6Bhw5trtPHVaIH8 WU7gPEwwOZlKVNucb4IJQx0sRiSXE280S3A8IxG0L2qfFlkSFK2egQxb39GH8Ogg2lyR P52A== X-Gm-Message-State: AOAM532/MoscsaBkgXc2BZEjJLcnck7VIE8N0Ke+YH+oafCTK6RDnRnS C8P9mSA+fgMNT8JdmTNgBUoixT33/oA= X-Google-Smtp-Source: ABdhPJy3M8urRwgid9mYK2ZdjxdftHs4YuzfyFQZePU305mFcgba2qjOqqfL6LTz8Ay11OIwXGBHjQ== X-Received: by 2002:a2e:9b8e:: with SMTP id z14mr687999lji.47.1598614774836; Fri, 28 Aug 2020 04:39:34 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 2/2] target/microblaze: Improve transaction failure handling Date: Fri, 28 Aug 2020 13:39:31 +0200 Message-Id: <20200828113931.3252489-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200828113931.3252489-1-edgar.iglesias@gmail.com> References: <20200828113931.3252489-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x243.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 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, FREEMAIL_FROM=0.001, FSL_HELO_FAKE=3.425, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" When the CPU has exceptions disabled, avoid unwinding CPU state and clobbering registers if we're not going to raise any exception. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel --- target/microblaze/op_helper.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index 13ac476199..190cd96c6a 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -483,22 +483,17 @@ void mb_cpu_transaction_failed(CPUState *cs, hwaddr p= hysaddr, vaddr addr, cpu =3D MICROBLAZE_CPU(cs); env =3D &cpu->env; =20 - cpu_restore_state(cs, retaddr, true); if (!(env->sregs[SR_MSR] & MSR_EE)) { return; } =20 - env->sregs[SR_EAR] =3D addr; - if (access_type =3D=3D MMU_INST_FETCH) { - if (cpu->cfg.iopb_bus_exception) { - env->sregs[SR_ESR] =3D ESR_EC_INSN_BUS; - helper_raise_exception(env, EXCP_HW_EXCP); - } - } else { - if (cpu->cfg.dopb_bus_exception) { - env->sregs[SR_ESR] =3D ESR_EC_DATA_BUS; - helper_raise_exception(env, EXCP_HW_EXCP); - } + if ((access_type =3D=3D MMU_INST_FETCH && cpu->cfg.iopb_bus_exception)= || + (access_type !=3D MMU_INST_FETCH && cpu->cfg.dopb_bus_exception)) { + cpu_restore_state(cs, retaddr, true); + env->sregs[SR_ESR] =3D access_type =3D=3D MMU_INST_FETCH ? + ESR_EC_INSN_BUS : ESR_EC_DATA_BUS; + env->sregs[SR_EAR] =3D addr; + helper_raise_exception(env, EXCP_HW_EXCP); } } #endif --=20 2.25.1