From nobody Wed Nov 5 10:30:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499394517305293.44095101717653; Thu, 6 Jul 2017 19:28:37 -0700 (PDT) Received: from localhost ([::1]:54130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTJ0W-0006Mo-3O for importer@patchew.org; Thu, 06 Jul 2017 22:28:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTIuD-00013B-GU for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:22:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTIuA-0007qC-Ce for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:22:05 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:33045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTIuA-0007pq-8D for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:22:02 -0400 Received: by mail-qk0-x244.google.com with SMTP id p21so2754640qke.0 for ; Thu, 06 Jul 2017 19:22:02 -0700 (PDT) Received: from bigtime.twiddle.net.com (rrcs-66-91-136-156.west.biz.rr.com. [66.91.136.156]) by smtp.gmail.com with ESMTPSA id i85sm1407176qke.66.2017.07.06.19.21.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jul 2017 19:22:01 -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; bh=5A0sQrj7ARgjxmzMPYKPo82mYmR9VxpK/7KKrxoW8Cg=; b=nvbtD8Hq/67fMYmtdSW1+DN5x/J+h7bdqp/AAMZsBsOwjDbv+If0FbnfQ9zwFtFRun ky8OyvGu6nC7ylAsUcIzNsH2yrAE67gfaFQzc3fcBfkO2eZ7KRlRg04x2zz3wu9GAbmZ 7BeJMtJ31xSFTG1re7gUv8YzNHLHfMd+xu4W9dkKQm205BcNAFigMLZIPKSivozQQyMv Q8D3ld8NpktxE5LmXzGP3E0hS3Cx+M01Is992oUScBSEoH2eP1RANv+L1fA6Jy/oDCHz f+THV44jv36/AUGl2gr51crrsZU/twpLFmxc3zcL3E2FZeSQjiVCsdkjqkmmsaQHOH1A 3t9A== 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; bh=5A0sQrj7ARgjxmzMPYKPo82mYmR9VxpK/7KKrxoW8Cg=; b=HqWxT7BWTMwexXfwkZaMwKHKWbBLZKxnB6TYOoQfW0iFqxk24C050PrC9LUPI3mO0N Upvjh2lnzdOZvykURMVIRp5dikpZjctFxqt7dW2v7SPrExro7syBWiDadWbIEgc5tofi JNde2wGtZ/ySSpoc/spJVz626p8KJItPsJIPdaC+WhxbLEJWTrpFjwbVgSFW51W2RR7G rwz6wk/jgc3RtkfeUMpeXh1ZKDziYCNCmzR1tkdp0EVrBLkcJacy7iItRbZef5iyiHTV DIXsZ1onibOuZXkTkeLK5ErzEPwG3E4m77t+0sUHT1VhgDx/PpRHjMvIoRzhOtZqLaGD GPcg== X-Gm-Message-State: AKS2vOwlRkNoa3XJWiKboAZzuyTQZp5u947CN+JmMRp3nH8+iVMuyPOf Ulj+oAg4jGZVG8fxvvg= X-Received: by 10.55.55.6 with SMTP id e6mr60639216qka.72.1499394121630; Thu, 06 Jul 2017 19:22:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 16:20:48 -1000 Message-Id: <20170707022111.21836-5-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170707022111.21836-1-rth@twiddle.net> References: <20170707022111.21836-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH v2 04/27] target/sh4: Keep env->flags clean X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bruno@clisp.org, laurent@vivier.eu, aurelien@aurel32.net, glaubitz@debian.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If we mask off any out-of-band bits before we assign to the variable, then we don't need to clean it up when reading. Signed-off-by: Richard Henderson Reviewed-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.h | 2 +- target/sh4/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 240ed36..6d179a7 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -391,7 +391,7 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *en= v, target_ulong *pc, { *pc =3D env->pc; *cs_base =3D 0; - *flags =3D (env->flags & TB_FLAG_ENVFLAGS_MASK) /* Bits 0-2 */ + *flags =3D env->flags /* Bits = 0-2 */ | (env->fpscr & (FPSCR_FR | FPSCR_SZ | FPSCR_PR)) /* Bits 19-= 21 */ | (env->sr & ((1u << SR_MD) | (1u << SR_RB))) /* Bits 29-= 30 */ | (env->sr & (1u << SR_FD)) /* Bit 15 */ diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 9da7e1e..8536f6d 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -39,7 +39,7 @@ static void superh_cpu_synchronize_from_tb(CPUState *cs, = TranslationBlock *tb) SuperHCPU *cpu =3D SUPERH_CPU(cs); =20 cpu->env.pc =3D tb->pc; - cpu->env.flags =3D tb->flags; + cpu->env.flags =3D tb->flags & TB_FLAG_ENVFLAGS_MASK; } =20 static bool superh_cpu_has_work(CPUState *cs) --=20 2.9.4