From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7732C433FE for ; Fri, 17 Sep 2021 14:12:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2D9B1610A6 for ; Fri, 17 Sep 2021 14:12:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2D9B1610A6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mREbZ-0008QT-AK for qemu-devel@archiver.kernel.org; Fri, 17 Sep 2021 10:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mREZi-0006oK-Q9 for qemu-devel@nongnu.org; Fri, 17 Sep 2021 10:10:46 -0400 Received: from 2.mo552.mail-out.ovh.net ([178.33.105.233]:45211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mREZd-00028o-0u for qemu-devel@nongnu.org; Fri, 17 Sep 2021 10:10:45 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.143.118]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 43A2C225C9; Fri, 17 Sep 2021 14:10:35 +0000 (UTC) Received: from kaod.org (37.59.142.98) 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.2308.14; Fri, 17 Sep 2021 16:10:34 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-98R002e37934bb-a3a9-4de9-a15f-1974bc0b985f, 2811AC2F724D5CB001CF4B7629903955A49C8FE9) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: Date: Fri, 17 Sep 2021 16:10:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v3] target/ppc: Fix 64-bit decrementer Content-Language: en-US To: Luis Fernando Fujita Pires , David Gibson , Greg Kurz References: <20210916143710.236489-1-clg@kaod.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.98] X-ClientProxiedBy: DAG7EX2.mxp5.local (172.16.2.62) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 5259308f-c06e-46ab-9e92-bce40f62a091 X-Ovh-Tracer-Id: 11662915662756154217 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgieelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfhisehtkeertddtfeejnecuhfhrohhmpeevrogurhhitggpnfgvpgfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepieegvdffkeegfeetuddttddtveduiefhgeduffekiedtkeekteekhfffleevleelnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrdelkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtohepghhrohhugheskhgrohgurdhorhhg Received-SPF: pass client-ip=178.33.105.233; envelope-from=clg@kaod.org; helo=2.mo552.mail-out.ovh.net X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.488, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: "qemu-ppc@nongnu.org" , Peter Maydell , Richard Henderson , "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/17/21 16:00, Luis Fernando Fujita Pires wrote: > From: Cédric Le Goater >>>> + target_long signed_value; >>>> + target_long signed_decr; >>> >>> Since these values will be the results of sextract64, it's probably better to >> define them as int64_t. >> >> but then it breaks the code doing the logging on PPC32 targets :/ > > You mean here? You need to define PPC_DEBUG_TB and compile the ppc-softmmu : ../hw/ppc/ppc.c: In function ‘__cpu_ppc_store_decr’: ../hw/ppc/ppc.c:883:12: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘int64_t’ {aka ‘long int’} [-Werror=format=] 883 | LOG_TB("%s: " TARGET_FMT_lx " => " TARGET_FMT_lx "\n", __func__, | ^~~~~~ 884 | decr, signed_value); | ~~~~~~~~~~~~ | | | int64_t {aka long int} ../hw/ppc/ppc.c:51:32: note: in definition of macro ‘LOG_TB’ 51 | # define LOG_TB(...) qemu_log(__VA_ARGS__) | ^~~~~~~~~~~ cc1: all warnings being treated as errors >>>> LOG_TB("%s: " TARGET_FMT_lx " => " TARGET_FMT_lx "\n", __func__, >>>> - decr, value); >>>> + decr, signed_value); >>> >>> While this reproduces the behavior we previously had, I think it would be more >> consistent if we logged what we had before the sign-extension ('value' instead >> of 'signed_value'). And 'decr' is okay, which is also not sign-extended. > > It won't break if you log 'value' instead of 'signed_value', right? Yes but it's extra change ... Thanks, C.