From nobody Tue Feb 10 11:32:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) client-ip=209.85.208.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1622711019; cv=none; d=zohomail.com; s=zohoarc; b=U5sFQf3ykZLRWHatYbbqkexlYmqfDUKOQU3nMn7e9vO0zNBrelJAKLBkKhO3ZFI+kJ4BB8kBr3OazxTTkWSNeueLUb6/RbEyRWUTryY98pcRFcM1+eAno+sIKPQTCKl9XH1UbW7cb25kHHKDs1wbqo5c8YJGULmleGstbicvBJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622711019; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+aq3bYmzCfrRF1OZBJAm7L1BFoguyeY0vM7CmI9EICc=; b=kfowXO4bsphrMOjhLOyeg3vzBfTc2k6g3ZYdlA7KgtyTHL0LLWkyDPC/O8uwmejjOiWbv964xBdoQw1SgKsO1Mhpe2BorT2Fj1C7GWw/e/eZk8ed/TTmbllaJhbCGffQrAZZrGWml7CCgqRT78dmqi9BUnnOGFjKE0giNyHPEjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.zohomail.com with SMTPS id 1622711019240748.660277892872; Thu, 3 Jun 2021 02:03:39 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id g18so4223827edq.8 for ; Thu, 03 Jun 2021 02:03:38 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id u1sm1380327edv.91.2021.06.03.02.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 02:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+aq3bYmzCfrRF1OZBJAm7L1BFoguyeY0vM7CmI9EICc=; b=iX1YCkrvg1cnb1i+Uo83gLbx0VLvoOJCo/g20HG7dJvzW9opJ1yXwPSR4f6UwzUZGO oWTtwoSIZiGGoulDKhwlG6xXOdTL8ptcqvxnwNWcjX9zzuLdQci23RuNudm4QJ2hxuSY zK33wfbIujZx1hHfXR1/S2F4LcPjbV7cM3zxLVnUBF7RkSAcdVc8c3JQ3uxzHOZ2nNFk /C2eQ8fF+7IBK4gXZfDFR/fPIPwNO10JNWXq9DFpe7qxjNOjdP9Kk2h/RIiKUZ7ToKm+ b4aR0OVamSEeIOGYKOFx+UcyM1cYibuf8/1Ty4P9lPy8AED//B0xtwzBLhfC08HzyW1D QmbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+aq3bYmzCfrRF1OZBJAm7L1BFoguyeY0vM7CmI9EICc=; b=n5Pn/4RQQExhptqYZL/PvHTUg5rvoUpdcf51JaZh2e/5OgqUUmJYfc8aHPWEa90F3P ckAo5bc8xiuwhsVccO+CnVwDsAunE30sGIarQZfnwBY9CYAtNZ80vkXNiuspBMgN74g7 qYCbtproWPpv1DpXkUeGoP4lL6j5PhUYrH+M4KXvFXej3g1FFMQ6g2a+jLTFNe2T1zS7 /MQivkznNSet52907TqTVn70RVRiheaOmpAxYLBBHAOMy74l+kNHnNp09VWYXfA1lKas kpv1NAFx06O+28e0+oWvunred7FEHvCN2m1sCSliIVrFZvNrkNXYYbQTRNZWgAebDurF B+JA== X-Gm-Message-State: AOAM531Ec+rpPPwuvSSpAtWDbtcmPayyiNwrjs9yyKcGgNdmz1MxzH5d vRuX8QaqWkSXeSTX1U9l9lw= X-Google-Smtp-Source: ABdhPJz2l6GaL/M2V3y+cmBe/2MU0BPXO5o9vnFtKXR6Sr4RzOzk0m1areBGPbjYt8H6T1rbYNm5AQ== X-Received: by 2002:a05:6402:368:: with SMTP id s8mr27852654edw.129.1622711017284; Thu, 03 Jun 2021 02:03:37 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alistair Francis , "Edgar E. Iglesias" , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/6] target/microblaze: Replace magic values by proper definitions Date: Thu, 3 Jun 2021 11:03:09 +0200 Message-Id: <20210603090310.2749892-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210603090310.2749892-1-f4bug@amsat.org> References: <20210603090310.2749892-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Use the Exception Status Register definitions from "cpu.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Edgar E. Iglesias --- target/microblaze/helper.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 20dbd673136..d537f300ca6 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -99,14 +99,22 @@ bool mb_cpu_tlb_fill(CPUState *cs, vaddr address, int s= ize, mmu_idx, address); =20 env->ear =3D address; + + env->esr =3D (access_type =3D=3D MMU_DATA_STORE) ? ESR_S : 0; switch (lu.err) { case ERR_PROT: - env->esr =3D access_type =3D=3D MMU_INST_FETCH ? 17 : 16; - env->esr |=3D (access_type =3D=3D MMU_DATA_STORE) << 10; + if (access_type =3D=3D MMU_INST_FETCH) { + env->esr |=3D ESR_EC_INSN_STORAGE; + } else { + env->esr |=3D ESR_EC_DATA_STORAGE; + } break; case ERR_MISS: - env->esr =3D access_type =3D=3D MMU_INST_FETCH ? 19 : 18; - env->esr |=3D (access_type =3D=3D MMU_DATA_STORE) << 10; + if (access_type =3D=3D MMU_INST_FETCH) { + env->esr |=3D ESR_EC_INSN_TLB; + } else { + env->esr |=3D ESR_EC_DATA_TLB; + } break; default: abort(); --=20 2.26.3