Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5EE0DC433F5 for ; Fri, 1 Apr 2022 21:46:19 +0000 (UTC) Received: from localhost ([::1]:60920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naP61-0006D2-U4 for qemu-devel@archiver.kernel.org; Fri, 01 Apr 2022 17:46:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naP4n-0005TH-4T for qemu-devel@nongnu.org; Fri, 01 Apr 2022 17:45:01 -0400 Received: from smtpout4.mo529.mail-out.ovh.net ([217.182.185.173]:44673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naP4l-0005rc-45 for qemu-devel@nongnu.org; Fri, 01 Apr 2022 17:45:00 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.1.97]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id E27B2F25CC33; Fri, 1 Apr 2022 23:44:55 +0200 (CEST) Received: from kaod.org (37.59.142.101) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 1 Apr 2022 23:44:55 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-101G0042cec9c72-e94e-4ce7-90a1-9d888448e099, BF19997ACFFB9775C4837E30A1DE169AA6CF9E32) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <9cba64f8-1e7d-bb7e-cd35-8a5cb03ea782@kaod.org> Date: Fri, 1 Apr 2022 23:44:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs Content-Language: en-US To: Richard Henderson , References: <20220401191643.330393-1-richard.henderson@linaro.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20220401191643.330393-1-richard.henderson@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.101] X-ClientProxiedBy: DAG1EX2.mxp5.local (172.16.2.2) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 1bc90ee8-7059-43b5-9bd7-420c95796bb6 X-Ovh-Tracer-Id: 8239054046451370976 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudeiiedgudeihecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeigedvffekgeeftedutddttdevudeihfegudffkeeitdekkeetkefhffelveelleenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopegurghnihgvlhhhsgegudefsehgmhgrihhlrdgtohhm Received-SPF: pass client-ip=217.182.185.173; envelope-from=clg@kaod.org; helo=smtpout4.mo529.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: danielhb413@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 4/1/22 21:16, Richard Henderson wrote: > Coverity warns that we shift a 32-bit value by N, and then > accumulate it into a 64-bit type (target_ulong on ppc64). > > The ccr is always 8 * 4-bit fields, and thus is always a > 32-bit quantity; narrow the type to avoid the warning. > > Fixes: Coverity CID 1487223 > Signed-off-by: Richard Henderson Reviewed-by: Cédric Le Goater Thanks, C. > --- > linux-user/ppc/signal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/linux-user/ppc/signal.c b/linux-user/ppc/signal.c > index ec0b9c0df3..ce5a4682cd 100644 > --- a/linux-user/ppc/signal.c > +++ b/linux-user/ppc/signal.c > @@ -229,7 +229,7 @@ static void save_user_regs(CPUPPCState *env, struct target_mcontext *frame) > { > target_ulong msr = env->msr; > int i; > - target_ulong ccr = 0; > + uint32_t ccr = 0; > > /* In general, the kernel attempts to be intelligent about what it > needs to save for Altivec/FP/SPE registers. We don't care that