From patchwork Wed Jun 17 20:13:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190892 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp766462ilo; Wed, 17 Jun 2020 13:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKiHDOO6ugSpDbDb8M7hlFjj7JT/DctObIc6bErEziOnNFhLYwgTjSOh0C2ENks1q9yQtA X-Received: by 2002:a37:48cc:: with SMTP id v195mr417410qka.232.1592424809509; Wed, 17 Jun 2020 13:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592424809; cv=none; d=google.com; s=arc-20160816; b=W+lSVbXiA1iO7ozJc5y2mb0RyN7UgZ3HEgvBPVQjm6i42L31wxJn/LlVFI6Zq3JBq7 XYq3R2D/X5MOpHU3u+Xd+jN4Z0Wnk3ip1ObT28U1/QAqRfYRe7tL0JU9IiC4/TZs67vU bVqXKqF7o0eMTheXtQl9iiyGBBGYPaQq/X60rEZLktNOMQOnp1nkbRn8gVU8kAdqNvxy 2zIFvAXij3j+4E3H7kwbzPWBG6pDPcQ6xSFWMFXcCJ5BZVimGAzoHyzBbM2xyaUzClFR 06X03Bm9U1grsUS8AhjKh5ujIE7LfU6gfnTcmJjf0w/4/39Myid6KW120ZR+WPjgBXpq TQfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=p5hi1MkuSub3noZRf3bAcEWN2K9bQNMhFTxTeY7Mp2k=; b=ARyE3f41mm9+cCSY8PA3xHWRi7h6XRk2+vatrwRHagdoo1ebk2gCN+lwWHoFXxygBC ivwlPwemzfjir4uyDX0Imsv/RooV8asIt3+9hyL6qunt/YT2WdTn7ZdnwnlQQfSiVBKm IC0k1F+1rskmfN/f53rCsMY7DVxALsW7wzJ3OsZ4erG3vR3b5cxkW+OUT4M+NnnJkxje Ba7fyeg9vHsUtKiig7jpZhz4ccl9KLpTWOx7Hs3kVhtife4Kx/rsObZkFFPjUyN7hjEh kwmjInkBAtQcrNKnmlG2EbDdph+6iaHckC7HLGoW1m8tpeiVjZDfFcrzMhmwV+OXG8EZ 1PLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nh3qFhU1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x13si364756qvu.152.2020.06.17.13.13.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nh3qFhU1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleR6-0005ic-U8 for patch@linaro.org; Wed, 17 Jun 2020 16:13:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleQv-0005gN-Sw for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:17 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:38726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQt-0000Gh-RM for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:17 -0400 Received: by mail-pj1-x1044.google.com with SMTP id d6so1595865pjs.3 for ; Wed, 17 Jun 2020 13:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p5hi1MkuSub3noZRf3bAcEWN2K9bQNMhFTxTeY7Mp2k=; b=nh3qFhU1W5Z+ANI6yzZJ515l6lYebwVwSPg5s+sGIsejz37TYYpnpVLKZytYhNVaFd HUR95MrdBBqrXH5GkONqS4xIiLGQ/2/1+RkCGWvuWPWBZ5DCfvN7QnYQ97rUaxIS+XNd yxPQRqk7PrFfTkXegQyBfRl76w1kM2vnDIOs16UPvOPGXOiXQU2YG9McfjZZMKumvsnJ UuiseNt0NaqM/antrFOTIaJa8Z4bxpXXiLv4eCzv7TzPUg+Pn1t/62iWPyUixZszl/XC 59jggqzK6CWzU/LYiPkHciPJGLVsgHGG0H4/YWRGNAj/LMgGmrm+wY3CnlOon4hb9nPy v/pQ== 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=p5hi1MkuSub3noZRf3bAcEWN2K9bQNMhFTxTeY7Mp2k=; b=WJqxuaKurIo5XYSl2+rNK8ku0L3ojEDFDBvP+ednOO/m9vzCMPV1aMtCvZIdG33xOx Wbm75U4IbIrDgKWHGUpya2NUIrLKYW/PKA3BEoZnFqqDsLl871okfmHpg37psMYv10bE vjyU5UM9lVXkBFVbJ0lSMaokRQ1yzJngWDpJtEUh9ZDRjbMwwHL5oyxpl3/THlmKJPxp 0IFzORkM+WKW9xjIi005MH7E1QJXlyVQZX5RxtB7Xj2EpSoLMitBtWaBrTNDKQMql5vy jW2Lk+Nad6gZ3N/eDxlVOAI215OP325e596M1k2EBqG/kNx4LgS41BlgP6WKSDlpaSqM v52A== X-Gm-Message-State: AOAM532MXT00bnCeGhFbbB6oc9e5oqwQmyuyxjAT7Ec6B2eZReGJ9yXK eHewKCJAxKO/gLx42/4Xl3KisJwOp4w= X-Received: by 2002:a17:902:eb14:: with SMTP id l20mr708188plb.189.1592424793873; Wed, 17 Jun 2020 13:13:13 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 1/6] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Date: Wed, 17 Jun 2020 13:13:04 -0700 Message-Id: <20200617201309.1640952-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, Thomas Huth , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building with clang version 10.0.0-4ubuntu1, we get: CC lm32-softmmu/fpu/softfloat.o fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by rewriting the fishy bitwise AND of two bools as an int. Suggested-by: Eric Blake Buglink: https://bugs.launchpad.net/bugs/1881004 Reviewed-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200528155420.9802-1-philmd@redhat.com> Signed-off-by: Richard Henderson --- fpu/softfloat.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 6c8f2d597a..5e9746c287 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3362,7 +3362,9 @@ static int32_t roundAndPackInt32(bool zSign, uint64_t absZ, } roundBits = absZ & 0x7F; absZ = ( absZ + roundIncrement )>>7; - absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x40) && roundNearestEven) { + absZ &= ~1; + } z = absZ; if ( zSign ) z = - z; if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) { @@ -3420,7 +3422,9 @@ static int64_t roundAndPackInt64(bool zSign, uint64_t absZ0, uint64_t absZ1, if ( increment ) { ++absZ0; if ( absZ0 == 0 ) goto overflow; - absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven ); + if (!(absZ1 << 1) && roundNearestEven) { + absZ0 &= ~1; + } } z = absZ0; if ( zSign ) z = - z; @@ -3480,7 +3484,9 @@ static int64_t roundAndPackUint64(bool zSign, uint64_t absZ0, float_raise(float_flag_invalid, status); return UINT64_MAX; } - absZ0 &= ~(((uint64_t)(absZ1<<1) == 0) & roundNearestEven); + if (!(absZ1 << 1) && roundNearestEven) { + absZ0 &= ~1; + } } if (zSign && absZ0) { @@ -3603,7 +3609,9 @@ static float32 roundAndPackFloat32(bool zSign, int zExp, uint32_t zSig, status->float_exception_flags |= float_flag_inexact; } zSig = ( zSig + roundIncrement )>>7; - zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x40) && roundNearestEven) { + zSig &= ~1; + } if ( zSig == 0 ) zExp = 0; return packFloat32( zSign, zExp, zSig ); @@ -3757,7 +3765,9 @@ static float64 roundAndPackFloat64(bool zSign, int zExp, uint64_t zSig, status->float_exception_flags |= float_flag_inexact; } zSig = ( zSig + roundIncrement )>>10; - zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven ); + if (!(roundBits ^ 0x200) && roundNearestEven) { + zSig &= ~1; + } if ( zSig == 0 ) zExp = 0; return packFloat64( zSign, zExp, zSig ); @@ -3983,8 +3993,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign, } if ( increment ) { ++zSig0; - zSig0 &= - ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven ); + if (!(zSig1 << 1) && roundNearestEven) { + zSig0 &= ~1; + } if ( (int64_t) zSig0 < 0 ) zExp = 1; } return packFloatx80( zSign, zExp, zSig0 ); @@ -4000,7 +4011,9 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign, zSig0 = UINT64_C(0x8000000000000000); } else { - zSig0 &= ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven ); + if (!(zSig1 << 1) && roundNearestEven) { + zSig0 &= ~1; + } } } else { @@ -4270,7 +4283,9 @@ static float128 roundAndPackFloat128(bool zSign, int32_t zExp, } if ( increment ) { add128( zSig0, zSig1, 0, 1, &zSig0, &zSig1 ); - zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven ); + if ((zSig2 + zSig2 == 0) && roundNearestEven) { + zSig1 &= ~1; + } } else { if ( ( zSig0 | zSig1 ) == 0 ) zExp = 0; From patchwork Wed Jun 17 20:13:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190894 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp767350ilo; Wed, 17 Jun 2020 13:14:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTKr7HUDmy9h9YbTnt40sGiOzXIWla9szHCKUyrsKTjU9rtnuD9szgRKyjNOy1+HpXXt7n X-Received: by 2002:ac8:42cf:: with SMTP id g15mr956489qtm.133.1592424887394; Wed, 17 Jun 2020 13:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592424887; cv=none; d=google.com; s=arc-20160816; b=bvpjrF1nunkO689jfc/iuY2gYoYDvXVvWI0zn7m97X4rwZXUX5Z3755KiqgBP2VQge wfsDKXNjssujDjczkUtXkLApi4Uh0C+/CEnACDT2W4fDOHJ4jwDBSixB2CTJtwcaa9XA ywzqGPu8hFNvv8Cn0TPHnOf9v30DFZc9BNx5ybFa/jomljHis8zAKUeeAHBc+I1HP8/l X7ogYtYndvgfHOe6z4JSoe4OF4K4l3cG55rEAsvtIZDmKuHZX7pKkDsULzBn3PSFq3NN 4dEHt7waBKtBpb+gExUIvXZu5/y40DeXgiTQElRnAeW98PNnBOrvf+BrUsfbtFdMBAhr 5DUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pT/roiiQXi808rl/3E2k4RxicPI5Pg+au5vRpBZNebo=; b=dnhCcfXmNF0Dt6KPuNmXO5UN1hAHoGZWlE3Eyd1gOni6XoDTQ3U15n3TObbRP9i8ez Y5MSDBSApUBPfbq0DZwPJK6a6mZL32hY4KQXtzILHuR6hFWbkUdZYWGEh9AS5csUvsax 8p5nHv+yVUecOn2tGk58Yfa+2XS45mi0PpqEk83GKNiLuL8M6/HXA3zHU3wfvAssNobx orUGA3eQIHiudT6th4f0FsGkKaEIf6/3IkRVrECI7duISI8rpQCoGJuSoYacwYDDxSrb Qbdv8Twf+ix/EMUqoja1/DwzroRoFXL4HH/KwzOxQgFgcRVm1q3BPumgU4Oi7pDNg2DS C3hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hHneAw/b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h8si377764qvr.138.2020.06.17.13.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="hHneAw/b"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleSM-00086w-QU for patch@linaro.org; Wed, 17 Jun 2020 16:14:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleQx-0005hl-6r for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:19 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:43422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQv-0000I8-0D for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:18 -0400 Received: by mail-pg1-x543.google.com with SMTP id h10so1803881pgq.10 for ; Wed, 17 Jun 2020 13:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pT/roiiQXi808rl/3E2k4RxicPI5Pg+au5vRpBZNebo=; b=hHneAw/bbNDZ4duj1XldY/58SCN0Txwn3gNkO4jAgf07byTGH00SRA5+RS1mcKJQ25 l/xtplH8TbyfP0vvZuCANowlfBDYHCT0UJajqAdPpSg1N4E3U4R9dmp5rf83ag3LcQ7+ zH692X3uO0GoNU+tk++gMcZ/WystOX2cf19Rwfgaw+d8kM79ogZrDXxoSu7yRqplx8T3 tk1R3ndWHFGcsAjl2HdHr0IHPQ1fjKsU7JOMk0Mku+2y8h/wAZFmoyCGPMe8r4F9rjSX FekwiMMPLEOfEjFbps0YAmDnwSI3hTEke2qUkpZwwlPMEUFmM4nyUu6Ba7O8yRIjG+Fx FOyQ== 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=pT/roiiQXi808rl/3E2k4RxicPI5Pg+au5vRpBZNebo=; b=b0lBk+y1BabPT9LmNiB4m3rs+9J2Fu58HZCkJwkYyP11g38Hp9IgcQ9C41SHzQrcBh crPjKFxcoxC/znXzheDhiyQO9WZZq9RCosS6Bbitz4C2Su8Mf7F14CLCGr9ijSn013He of+EvG0jAqFBUKIILBwY1syGZMn/Eb25JwLE+rnieR8LTsV+uKyP4dq76QkFIlrokP9V 58QkjztOzJXk//AG7l8eMxHxgypy0TaVJzvE9WaPRTQdb7B1PUu8W12G5PYBtIxhSGsI HybQqaqbCjAziFhTw0AFHi48zfZfdAbeVfKWyQ+G8rPrFVWw0jwG5QQnO8Brr1VqEazM e0nw== X-Gm-Message-State: AOAM532DuWGS3cUqDdkYleCr9q7OwyexnKwF3kwglmPncKCPpbPxjPYW UK2ikgjwXItkHgwHGOgRagjO6EQxxeI= X-Received: by 2002:a63:5f41:: with SMTP id t62mr474112pgb.252.1592424795277; Wed, 17 Jun 2020 13:13:15 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 2/6] migration: fix xbzrle encoding rate calculation Date: Wed, 17 Jun 2020 13:13:05 -0700 Message-Id: <20200617201309.1640952-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x543.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, Wei Wang , alex.bennee@linaro.org, "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Wei Wang It's reported an error of implicit conversion from "unsigned long" to "double" when compiling with Clang 10. Simply make the encoding rate 0 when the encoded_size is 0. Fixes: e460a4b1a4 Reviewed-by: Alex Bennée Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reported-by: Richard Henderson Signed-off-by: Wei Wang Signed-off-by: Richard Henderson --- migration/ram.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 diff --git a/migration/ram.c b/migration/ram.c index 41cc530d9d..069b6e30bc 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -913,10 +913,8 @@ static void migration_update_rates(RAMState *rs, int64_t end_time) unencoded_size = (xbzrle_counters.pages - rs->xbzrle_pages_prev) * TARGET_PAGE_SIZE; encoded_size = xbzrle_counters.bytes - rs->xbzrle_bytes_prev; - if (xbzrle_counters.pages == rs->xbzrle_pages_prev) { + if (xbzrle_counters.pages == rs->xbzrle_pages_prev || !encoded_size) { xbzrle_counters.encoding_rate = 0; - } else if (!encoded_size) { - xbzrle_counters.encoding_rate = UINT64_MAX; } else { xbzrle_counters.encoding_rate = unencoded_size / encoded_size; } From patchwork Wed Jun 17 20:13:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190895 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp767430ilo; Wed, 17 Jun 2020 13:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznqlFu5aIjpFcGSA18zIOp4l4OICtG3dkSiB9zOGTemSEqUfcxgewIxCuXQv5woOOY5r4E X-Received: by 2002:a37:b0b:: with SMTP id 11mr440770qkl.22.1592424892748; Wed, 17 Jun 2020 13:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592424892; cv=none; d=google.com; s=arc-20160816; b=F9FlsgBLiIEB5dUSdFkSNKSiV/Xcavx25uYXC3OoqTxAzQRExRec1fvnNzXL1umbdF ekHL+uG2/6MSs74RpamvId9je8KOSaAI9qZfcIaBDLCjdd6ZqLzrekiFUr6c6QTOW1to kSSPWNhHeyA1JuSJMlGapoNkP0Wk9b6cjNfqn0vU65l7ndbl5AY8sWxXLdsLDajtyF++ 2f/EPFy0mh9SThrfTmi8U7adHpWF24+8R57C/SZk9Qls/AH6Af9Nnxbz4PNNPrfly5hX YETGx2XEglnKkPxfJ33WWHK79BnP4uYqz8mWZlax42zoe2ktoo3cZ6zfZ6iGVjd796lp /37g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4r5DXyEg7egNkGt1Nf25Vhx3ygxyImevDYCxFLgjPzU=; b=ZHmPPdkKOaOYJRvd5kYXBcGXulleRhBLO0d9cd5Bv/xO0HVwmOJuXryXETms9M6z33 qw/PQa8CRI31sRthq7C+hXGLZGOlKPUinsoSOGoP9AsCvJQopXCnj7A59kuo5irr8qCD jLZauMJfyWp+b5JVielV+UzX5fKYDA5v6fHBbrEBVCo/lEMbFUcNmS0Nxd/k5JjVMJDW 5+29SzU2lrmUpA6cvg5petPYY07C3jnR3ZrxZ9yqp6yXWSW3qy67zPmQPT2kPFH/J30I o6wx70DpwvSIRPOUeVCtneGTsBbebwYhAXv3sd/EIxQ6PI3gkQ9TQIPqD6J+xWOHqfue mj1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nEHHWw3o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h123si399875qke.183.2020.06.17.13.14.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nEHHWw3o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleSS-0008Hz-7R for patch@linaro.org; Wed, 17 Jun 2020 16:14:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleQy-0005jT-9N for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:20 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:41742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQw-0000IJ-Cj for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:19 -0400 Received: by mail-pf1-x434.google.com with SMTP id 10so1670908pfx.8 for ; Wed, 17 Jun 2020 13:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4r5DXyEg7egNkGt1Nf25Vhx3ygxyImevDYCxFLgjPzU=; b=nEHHWw3oibbmDoeUs+w54bTWDfuirqvZX9ZTZbPvYL13/GJskcUo2gN3f1TtE1fCkd HAe9L6kJtrghT5PJiDYAxg9ImPeBrLPmAPtOLW/m1hwocJ39ovvXqLgugnMNYaVNpNxl +HUzdxxfPGjIPrtbNZNSWKH0wDD7Sqbv9DJmAOVRXBch827VTDol7o1QaAC7iGHOqfcw oifQK6nfO+YVOM2JEc5KBuJ3dGfVFRZgPUL7MALJoBN22evHlkyvpMONuEdIYHp7ZBFx fcC5wLezqK3Lz1Dt2vpvtmoXR/Uc2d+GISRiuOsYbVCT8wjGrD1xRApMGP/GDHw4GZz9 B+TA== 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=4r5DXyEg7egNkGt1Nf25Vhx3ygxyImevDYCxFLgjPzU=; b=MNkdxI52w2TdAfHIQ0QL/JZYoJEbQuM0IsTn4ddFIRurylgWaPP0d0g772n8/wG4bG n46HwtOgOqXlTK5kacn9FCzqAuWxLNWRMC+6yn0XnStCCFoBseQ47OcuZ6q7bbCH3rdx EDllaOibXTJPjLr9AdZHEquvSpr/v9wKNE8T7HqUrcn6qxa8DlLdujT55De7toM945kK S9nX/WfUqxQSanf9+WeGMZRRKrUTpmeZrOS3tDbnzVI94aM32J2y5A2bqFTKR4pUMhoP qJoHw9ARAg9qpzWCROBNDKYsQ1wMnspQFNR/0BwV5dB7p4NOkXRHB4jhYOXykTSlQQ4v PqYw== X-Gm-Message-State: AOAM533PBCrEz3kn7PhsaOMq7M0QRyZXYJLp8lFFn6LBLjPztwsDGQQ5 kSnIpZsf4LBwMqSI/6hHeViI7wW6E7I= X-Received: by 2002:a62:a510:: with SMTP id v16mr455570pfm.154.1592424796560; Wed, 17 Jun 2020 13:13:16 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 3/6] configure: Clean up warning flag lists Date: Wed, 17 Jun 2020 13:13:06 -0700 Message-Id: <20200617201309.1640952-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use a helper function to tidy the assembly of gcc_flags. Separate flags that disable warnings from those that enable, and sort the disable warnings to the end. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Suggested-by: Eric Blake Signed-off-by: Richard Henderson --- configure | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/configure b/configure index b01b5e3bed..a8bef95282 100755 --- a/configure +++ b/configure @@ -97,6 +97,11 @@ do_cxx() { do_compiler "$cxx" "$@" } +# Append $2 to the variable named $1, with space separation +add_to() { + eval $1=\${$1:+\"\$$1 \"}\$2 +} + update_cxxflags() { # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those # options which some versions of GCC's C++ compiler complain about @@ -2024,16 +2029,33 @@ if ! compile_prog "" "" ; then error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)" fi -gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" -gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" -gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" -gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags" -gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags" -gcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags" -# Note that we do not add -Werror to gcc_flags here, because that would -# enable it for all configure tests. If a configure test failed due -# to -Werror this would just silently disable some features, -# so it's too error prone. +# Accumulate -Wfoo and -Wno-bar separately. +# We will list all of the enable flags first, and the disable flags second. +# Note that we do not add -Werror, because that would enable it for all +# configure tests. If a configure test failed due to -Werror this would +# just silently disable some features, so it's too error prone. + +warn_flags= +add_to warn_flags -Wold-style-declaration +add_to warn_flags -Wold-style-definition +add_to warn_flags -Wtype-limits +add_to warn_flags -Wformat-security +add_to warn_flags -Wformat-y2k +add_to warn_flags -Winit-self +add_to warn_flags -Wignored-qualifiers +add_to warn_flags -Wempty-body +add_to warn_flags -Wnested-externs +add_to warn_flags -Wendif-labels +add_to warn_flags -Wexpansion-to-defined + +nowarn_flags= +add_to nowarn_flags -Wno-initializer-overrides +add_to nowarn_flags -Wno-missing-include-dirs +add_to nowarn_flags -Wno-shift-negative-value +add_to nowarn_flags -Wno-string-plus-int +add_to nowarn_flags -Wno-typedef-redefinition + +gcc_flags="$warn_flags $nowarn_flags" cc_has_warning_flag() { write_c_skeleton; From patchwork Wed Jun 17 20:13:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190896 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp768460ilo; Wed, 17 Jun 2020 13:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy4YAxCdGF3g0UcYvPPY/alz1MoOQWOO+2D8S04fW0gs+ZigAK7ZbDa5y3a7mhf5MIShp1 X-Received: by 2002:a25:cd8a:: with SMTP id d132mr943446ybf.443.1592424982763; Wed, 17 Jun 2020 13:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592424982; cv=none; d=google.com; s=arc-20160816; b=ZmFg7GFlKnbL/lPsjVhz5Ac4rIRbi+8atQqeyEAfUKep9fkE5swq46+pUjrlxgUthl ZHQdjyzzHNQ4R2WQMIEg0QffmkiUKJYwybOOKx+rRAJ4r366RyMde9LEsExhNC5KRJuR p3cVyTJcj8hyKvrIL5nmtIYI7BbJmRmlmlMaVv5eDJcAin22UIApVdgjBJh7qgJ8I2M/ bJQh+kO7k/Bmw9/uAOJmNO6Ov8UGQoKLNk5GZ/+gkfqvC2ChF+FRgeEebxowjYAd0clM R0gMbtHXmLMMQEVzWXc0wXZuWv4noHATM33hmbCf8CDsfGtm9vomuyGl+wsi9seGUXKX xwwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dEZjzTX6+ieOShJN0mJuNiYarK9Z1RqMn0K7hfGtGUM=; b=xt2kdk9IstlhxEhzPj3r2GIw4hN5JkR0N9R6EvwvH6lrV2ii2SWuZ/yBIWh+wPgFWs xtsS3caJeeUYmEKr6IUmf58umwEeiKStoJptVNbgDKBpqSnxcmXV5mb7LpLoks9hbhMs BJqwTUXEtmgrUamJ/t/73METiIp2aiXjBABCQNsF7r1RLPNvdqx6ipw9AGho1q84Tw9A MSDSRJYfHasfuHeLI6SQmidbMCBVzTaoEtJUYLM6oDFlhGLjslEGdt9ap2TbtHYdlN+f ByeHo9oqG24BOTNCWvQxwTnk5jY7x9zV4psYTdKILthXNhG6uloP7+E18Yvtwlad+wbC r3Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rQb1ysMk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b125si574383ybg.145.2020.06.17.13.16.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rQb1ysMk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleTu-00029W-Aw for patch@linaro.org; Wed, 17 Jun 2020 16:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleQz-0005lZ-Bo for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:21 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:40056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQx-0000IY-Jq for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:21 -0400 Received: by mail-pf1-x443.google.com with SMTP id s23so1673124pfh.7 for ; Wed, 17 Jun 2020 13:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dEZjzTX6+ieOShJN0mJuNiYarK9Z1RqMn0K7hfGtGUM=; b=rQb1ysMkQvxua3wjxBWBVlNxm8mA1y2GuGoNe7v2Ea/vjtPFkBP3twB/f2xL+aplvf WFzGp9+rvN2FCFlcTnDtxcOjL3Hp6IooSf2+rSqwk3WBblNLlIa3AUdZkWiqBi0XDxd/ ACqp4VQyGdX+u/BNzOqDkahJFzx+VTb6dlshKPax7D/J8TbyddhS8nfQ0SERgwFPL8Jl tgkjzRvLys0vI/Ia1NDB9MSpfVq4ALyJn9AiQ/+cvuVcdsiulRZ7Q47abzV6Wk9yJziw txkl7aZUEnTZyyY6i+H9LftplS0s6wj+XYVsJJlPHIB++VP5acVSL0BGirLSB0SaBACI K/hA== 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=dEZjzTX6+ieOShJN0mJuNiYarK9Z1RqMn0K7hfGtGUM=; b=TqAZ+xiSRGx8rKQa0U2HTLQH9HCfSt3m40J8oR3jSMtaf+rHSnt5cKD4oZHtdgK/by fn7iIeySRxsOICC8sW3vvGLdVniGDOtRiw4I36Xbp5JcuwewNzfhe9MADzTYLpaLaa34 VjTNMORj7EfHdtsyh9UmBy+onRIy6LhzsRuZ7uAoskoK3qN1UFllZewK1I7EmeBCriU0 +QbQFev2C93RRKQG/f9Rr6/U5D4x1q1XqHCe5eD+Mju98xQEq1JjNrqEL4kaC6olo1o9 sKGSyRV8GCoYmij4Ev6vDvovGL37NAWFBr6zMHpcuf9QxYyHQjvmuEOiLQSUMImfu2mZ UaZA== X-Gm-Message-State: AOAM532ay86p0DzgPnu/8cxrZ4ljveG3cZS4fZyopZtO8Xkx4a30VWmn vCgwndkr4A+6Rop6nbqSmLTAe2JK+dY= X-Received: by 2002:a62:7c09:: with SMTP id x9mr402043pfc.287.1592424797860; Wed, 17 Jun 2020 13:13:17 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 4/6] configure: Disable -Wtautological-type-limit-compare Date: Wed, 17 Jun 2020 13:13:07 -0700 Message-Id: <20200617201309.1640952-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x443.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, Thomas Huth , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Clang 10 enables this by default with -Wtype-limit. All of the instances flagged by this Werror so far have been cases in which we really do want the compiler to optimize away the test completely. Disabling the warning will avoid having to add ifdefs to work around this. Cc: Eric Blake Buglink: https://bugs.launchpad.net/qemu/+bug/1878628 Acked-by: Thomas Huth Reviewed-by: Eric Blake Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- configure | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 diff --git a/configure b/configure index a8bef95282..5e27229f58 100755 --- a/configure +++ b/configure @@ -2054,6 +2054,7 @@ add_to nowarn_flags -Wno-missing-include-dirs add_to nowarn_flags -Wno-shift-negative-value add_to nowarn_flags -Wno-string-plus-int add_to nowarn_flags -Wno-typedef-redefinition +add_to nowarn_flags -Wno-tautological-type-limit-compare gcc_flags="$warn_flags $nowarn_flags" From patchwork Wed Jun 17 20:13:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190893 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp766520ilo; Wed, 17 Jun 2020 13:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx/Nv++5hKSXEE1xG5eRHtEdLOxA5Iu/uC7PJTMd2e2bl9n+24XDyZRBaFz5EmAo/OvnwA X-Received: by 2002:a37:7cc7:: with SMTP id x190mr398885qkc.189.1592424814778; Wed, 17 Jun 2020 13:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592424814; cv=none; d=google.com; s=arc-20160816; b=q6hZpAR+6cFsAHBdfJ9v/h4/MnLTQwvP7LN81ityEG4AE2DWRmN11r8pY9pEKYTd8A JWolGK4HEJOrJhUP2KEUWCeeiesWyHl6hIDc9F50AGWkrvGw/aFAGnZxXIpDHwQ9o0uH e7t53SmUoYRlHwImpyWsKmG2YBc800zIQ4AOdbelEFaRqppPrt8Ca3wfHLdQWIbAf36D iNmobIANcQ3P8LtU5xc6+elSIWwSDI7tSyYcjJO7prceIoGgvMlOVUJG3VEVbWgGaE7y IA3mxm4V5CgKLa0XdHIv/rxfFd1duIMgSuyD5mxjtvGmkvJ+32jv4L67hl37JOsftLnb jROg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=KWMxYf4wO7x5jAN+/hqtYz9dCtHYS2Ay0EvaIwt8nhg=; b=zJx9zm7CDOyaH+OSCPRTV05R8UvoOphRVJeSdnKH6XFppeTUmT2CMiNY+t+4cHvHfC 9nA0WwNP/6WrMBUXu1BNPEe6G4MQ/SlEwQXib1hge84QBQqPX+bGiab+F7vhdMdALcwx 01jCkiycWTPR1772dmbK/NyS9ziFJ0xYhiXeoHDIG1vVcrvyam0aH5S6AZQqOg0Y9tV/ C5BklcCGqAYMW7HKC990YoLd9u9zCqQ+3RLVNkeL+baD35ODNKmUqJcfJ+ReO4T7nh8U u/vDsjPUdA2htob99yyBpWM0kjHgb2XvEMkGjEphN2mgzhvs0YlNTWxyOYR6gmbuuTcU pZOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K5lpsjvB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c6si646680qtm.324.2020.06.17.13.13.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K5lpsjvB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleRC-0005rp-7a for patch@linaro.org; Wed, 17 Jun 2020 16:13:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleR0-0005oC-N7 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:22 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:45922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQy-0000Il-R4 for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:22 -0400 Received: by mail-pg1-x542.google.com with SMTP id l63so1799795pge.12 for ; Wed, 17 Jun 2020 13:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KWMxYf4wO7x5jAN+/hqtYz9dCtHYS2Ay0EvaIwt8nhg=; b=K5lpsjvBl0D/4ebX+bdfX/ktGrI2K+BLRJWLwmDpcGmPQgX3zNuq4A/MF8qNzYIh2s e2IcBP2+pkHUtepLBDf/aKzFPW1z5D3qv/hpjCpLrFOziZ4kM7NFRlLapDHg0b9S4wMI Hu9KeMGWXu9VZURu7BJRZDQhjiUeQkTGKXQjfN3T7PTNPEx9RmW0n/Gs1vt+dsDZWZLj JK82MDkVWyo1Ux7GGz3jOYchrULUtwxT6sXZlTZe9+LS7u+kNpVlxr0yXn58Q56If3cD b4nigH/yo86WcSCzq5VF2PopQ+mVIFjm2+cFlMbP2sr3FsTNDdNjqhQ+e29yYjN7v7Jd x/Iw== 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=KWMxYf4wO7x5jAN+/hqtYz9dCtHYS2Ay0EvaIwt8nhg=; b=V/pOUkH44UcgFg//0lcuXtcFL1kymKOhYHqBmAdoMlU75zzcQDY2GB21K59SK4rP5B PBkgLQuHKj6+VkbslwlxMf0eipVJX3YlkVB7b6loB3sNaB8nP0l/OqOnHD64DK58kWXv whBpbMEWn/EhLcJw0CmuHT2FEvcrL84/+oXhVMwRhxjM5bFmOY6D++4DKHGrz5TuBJBb DseL5MZjSt0w18MaQVX9AcRwCDhPeldFNJowMyK/SjASvw/4QvObDx1srJf9BKL9pxYL rh+0sHLLHPfZU7BwYACYG6OAvyQYq5SsQBaz24aPh+h8N4u/Ksxpbzx50NnZbU5mlwal Aymg== X-Gm-Message-State: AOAM533XGCVFs3e2ETRs+Ou3MVYgibec8K6TkBiXNxq9OhbdxQ+690jr NDqCFb/bprJtbfP9huGGA0TGY1Fcuv4= X-Received: by 2002:aa7:8bd0:: with SMTP id s16mr466871pfd.80.1592424799099; Wed, 17 Jun 2020 13:13:19 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 5/6] configure: Add -Wno-psabi Date: Wed, 17 Jun 2020 13:13:08 -0700 Message-Id: <20200617201309.1640952-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" On aarch64, gcc 9.3 is generating qemu/exec.c: In function ‘address_space_translate_iommu’: qemu/exec.c:431:28: note: parameter passing for argument of type \ ‘MemTxAttrs’ {aka ‘struct MemTxAttrs’} changed in GCC 9.1 and many other repetitions. This structure, and the functions amongst which it is passed, are not part of a QEMU public API. Therefore we do not care how the compiler passes the argument, so long as the compiler is self-consistent. The only portion of QEMU which does have a public api, and so must have a stable abi, is "qemu/plugin.h". We test this by forcing -Wpsabi in tests/plugin/Makefile. Buglink: https://bugs.launchpad.net/qemu/+bug/1881552 Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- configure | 1 + tests/plugin/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/configure b/configure index 5e27229f58..ba88fd1824 100755 --- a/configure +++ b/configure @@ -2055,6 +2055,7 @@ add_to nowarn_flags -Wno-shift-negative-value add_to nowarn_flags -Wno-string-plus-int add_to nowarn_flags -Wno-typedef-redefinition add_to nowarn_flags -Wno-tautological-type-limit-compare +add_to nowarn_flags -Wno-psabi gcc_flags="$warn_flags $nowarn_flags" diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index b3250e2504..3a50451428 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -17,7 +17,7 @@ NAMES += lockstep SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) -QEMU_CFLAGS += -fPIC +QEMU_CFLAGS += -fPIC -Wpsabi QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu all: $(SONAMES) From patchwork Wed Jun 17 20:13:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190897 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp769341ilo; Wed, 17 Jun 2020 13:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywAKyESfCwZAsKYW5IcHApTSY8HRql2NV/2eJIa6myEWe8AmdHxOeX65AiAilrrCdNn5OG X-Received: by 2002:a25:cf0d:: with SMTP id f13mr1113875ybg.108.1592425069789; Wed, 17 Jun 2020 13:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592425069; cv=none; d=google.com; s=arc-20160816; b=a+eOnqV9aTUQjPvHUDo5ALq0Z6atB2QQo2euZz/EQxfzTAS1MkpijdMgYmLEKj2b4E O2XxKRpBJz8bHu72nt9GemQoYzXGZBpepZf4BCDNX5LdtAOBlQLlYdB+w4fbOCWxusXh gM6kRTC1BLiHg/ipFqQ6rWbtjYNj5kfhRfCPOEAZl3pQ2zw8/X+Jx49kdEhwcBcn8DM1 /zqPPnM5Kz1GgWk+i6fQLOlK34WkMDYDCcEYEDiKoOXB45xwiRxN32jA8DdFDQBHKBBJ z/B9nvYBuwnlTZ1LaX5r4kqyqn9270PiY1XfhJyTvMBZl3q26omQbue91eRONhwE0oAZ 1qhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=iB6WP5osX7GLomupFEwKpIq8rnoF86CLVB0urJpiacU=; b=nk6KKQfXgBSJ0LxJ2uTa0orJOqDFaMhShu++dn4yYzMXN8Do1LDiQDdDBjSqjM4a5t cGApfymR/HjWTWxykDnCnqXg+5ekIymBfZEDcd1QW8vt2vuaNHHv8Y3RtZtiFnIMiGBd /Vu0WGUeleBK2VuMnr2LvMHMqFsusyzhhn0PPEVDWJESOxJWbYWgZ4o6nPbBlpCLccm7 x/4QbP5m9b7DMawl5nJrGD0TWoKGQH6EgqbMJC0TPSxRMH4Uu2Ru5Pc+oNo3ukJ2zBAW MIOiM6Giz7PNkCsKSdaONk9bNIEquqMOlB1nOexcQRtT4GRdmLuxGeOJ/x6mMaWQTDhE 3j3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DAtHA5kT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l198si577479ybl.6.2020.06.17.13.17.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jun 2020 13:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DAtHA5kT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jleVJ-0003Il-Bl for patch@linaro.org; Wed, 17 Jun 2020 16:17:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jleR1-0005pI-Dg for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:23 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:39050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jleQz-0000Ix-Tb for qemu-devel@nongnu.org; Wed, 17 Jun 2020 16:13:23 -0400 Received: by mail-pl1-x631.google.com with SMTP id v24so1448175plo.6 for ; Wed, 17 Jun 2020 13:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iB6WP5osX7GLomupFEwKpIq8rnoF86CLVB0urJpiacU=; b=DAtHA5kTyMCz43/pWlYuyy3VDgHr2r98rnL9NHkyMCVlc9gtocDnahKJwjYt35J2UN VPR4PfA6+pSZ39viDfyzm9zuyG1T/jRBSCzY6HPNPgyWC8rMjLu/WSmL4QrMVqeAhvjQ GD6XUYlWXR3TRzPr1zsM+duh5/J4DKWvrXCxPkTNv8fVPScAqP9anyDj/L+QtvAHBs8i yyDJJTk27dkRLcIdwyHqeZVvAYQdkhRMRqoc2ZOMGKc5H8wmTOVWVqf3u6U7gXLvrNd7 8T73LBjEcGTHKtr3B4soPomTcNyiBJed84EO8N42Xu4R5ANkCon97P0c8ioPCxby4zi8 ILyg== 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=iB6WP5osX7GLomupFEwKpIq8rnoF86CLVB0urJpiacU=; b=RlZswqhPARB9mFp7V2oe1tGIEvk8a8BxAkLX5HS44090XR5/fnBlcj0J1AoT6SFo0B EmSflfYIepmjQOv1imY78vkN9leYYrXDSgUoxkdVdF5dxx0gwwyn6noswdnyrhsmlaM4 RqLn3S2ZjB4klXeihHYISoQrUvgUQnyc6U+YnPzjw1gPaX0T/1+LcN7t+WsleEtTHZiL nOq85BHYEflvfLx9gy6z4J4zEeSeKTd4Rmgbfn8L3ZFGRFN0mP/r3JKSkg5aFwWg2CgV xPR7MAWWD6JZzBNIM878pDc+qOaNodM2zizbgs9eES8fwaEKYRNpyKfVtMgZWxJXTgvk noLA== X-Gm-Message-State: AOAM532sH8RkAZnhJQOeSlm0d7NF/AYVo3LwZrISZxCfCvbavoODcYaE V0PedszMm/H/A5Kx7Xz7TIJEMCvahmY= X-Received: by 2002:a17:90a:fa8f:: with SMTP id cu15mr773414pjb.9.1592424800277; Wed, 17 Jun 2020 13:13:20 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id h9sm659259pfe.32.2020.06.17.13.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:13:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 6/6] qht: Fix threshold rate calculation Date: Wed, 17 Jun 2020 13:13:09 -0700 Message-Id: <20200617201309.1640952-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200617201309.1640952-1-richard.henderson@linaro.org> References: <20200617201309.1640952-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: philmd@redhat.com, "Emilio G . Cota" , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" tests/qht-bench.c:287:29: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] *threshold = rate * UINT64_MAX; ~ ^~~~~~~~~~ Fix this by splitting the 64-bit constant into two halves, each of which is individually perfectly representable, the sum of which produces the correct arithmetic result. Cc: Emilio G. Cota Reported-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- Question: Should we really be scaling by UINT64_MAX? The comparisons against info->r mean that 1.0 is exceedingly unlikely to hit. Or if that is supposed to be the point, why is is the test r >= threshold not r > threshold where, if threshold == UINT64_MAX, there is zero chance of the test being true for 1.0. --- tests/qht-bench.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tests/qht-bench.c b/tests/qht-bench.c index e3b512f26f..eb88a90137 100644 --- a/tests/qht-bench.c +++ b/tests/qht-bench.c @@ -284,7 +284,8 @@ static void do_threshold(double rate, uint64_t *threshold) if (rate == 1.0) { *threshold = UINT64_MAX; } else { - *threshold = rate * UINT64_MAX; + *threshold = (rate * 0xffff000000000000ull) + + (rate * 0x0000ffffffffffffull); } }