From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621018; cv=none; d=zohomail.com; s=zohoarc; b=aV+XrSjGTcQ3t4tbkduvPmsafueF7VxboCnTiOzt5xN1zFbkf5yndx+jeEYuoPZUeCWr/DeOZlydYZPlDLhO3rorhKQ4xjS3vy+I0r+i4NPwjjPHYbcEjOOOLP1kFLEO80wZQXMtsd6aNQg3dgfkHsX208Bj5ITv9Za//yQo9tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621018; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EJXyyAUUfoS63NoOHsrWihhaSKcfYx5yWaS+ZUcS+aw=; b=MJk1lnFDF2czZjzNkmmNX/T875UHTf7Kd4o2Y/EynWcqG9jCkVEPqGK6xQ9N19jYEWpHywvZAuRBK6rrGFSZNMh7KdJoPoT8WopV5gsv3HbS0Dks1NrrRtV46ALiMGdPVm5lvB0d1S6zqrHMQONM601mLOwV1ZYNaFWhS90xShU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621018166459.09831513480503; Tue, 17 Nov 2020 05:50:18 -0800 (PST) Received: from localhost ([::1]:40946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1NA-00055d-R2 for importer@patchew.org; Tue, 17 Nov 2020 08:50:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Le-0003OE-45 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:42 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:38847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lc-0001uX-3G for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:41 -0500 Received: by mail-wm1-x331.google.com with SMTP id 1so1780895wme.3 for ; Tue, 17 Nov 2020 05:48:39 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EJXyyAUUfoS63NoOHsrWihhaSKcfYx5yWaS+ZUcS+aw=; b=nfTrI6ZOeteitIDSieKJlHw+vCvR0AD5j7BOsxafYuIpP1lXHC4BJpkTjMrMwuwzCg s1BdUwmF1LVxzdv/glheQSSdBItLzolkSVpRMbCr5wFhwHiGaIkECrBGRrLn6FAAp2Wj qwqRd2t3y6IuanTY8R/5R5R78y0YNFlmoKKx6q6ErG7qwidn/9oYejgIO2177v8BQCEU bRwlZ7Am08CMoNhUjo6PTcOaII5LZ4W9vhfBY0k2ruPja3nTS1ZQlFRN5lmRzDSHMOm8 E3XdkeazQhn2eYyIWsRbmXRGcptOSj5zzS7qBI+OCepr2894DTKsNKLI7C0zbqEMNsbI qrfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EJXyyAUUfoS63NoOHsrWihhaSKcfYx5yWaS+ZUcS+aw=; b=hDT6sm2T5oVfyW3cW5OHSHSH74CInvNQ6EmWAnk8g2K7i8M4nMFsuHlD7WeisMA1i8 Ojffpu1RSE30hXSFLu1QI9X8BPk2KVwF59qN76+Y12CKQNqcq5yzm+ycBMiO5LPfwPWB wu8RPSBav0E475g180Wd0gTg9oXmFVBF1fQWktpd07aqPBXMeW2ADWxyCKIcOEA1tobJ sbJZ2pVt0DM6EXFz7Jb2NzQ6rFmR8mleN9qc2eCYJPf2Xg9mikapAiY4zHv7uHraSVyM d/pkEjkKMhv6rRLk3G9lFu0fgUHdK7xwYWdoG+l1FSLFvrEQNpVEswIoSjigGT/E3pbl LSBg== X-Gm-Message-State: AOAM531fWlww8TUuyrYLZkl8eJAj0QB/TqJw/wq8KjrxYDWR6+QxwNjl CNLdfZfneyw+EUmLjlxlp6OPQEhMFtsPWA== X-Google-Smtp-Source: ABdhPJyg2B8gyELYAVvLQsn7IqaPRyMmN0iLXhq6bDUk15dEr6OIdEm7Qp52NfFAHQ/ne+f0r4aT3Q== X-Received: by 2002:a1c:208f:: with SMTP id g137mr4440725wmg.116.1605620917876; Tue, 17 Nov 2020 05:48:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/9] hw/arm/virt: ARM_VIRT must select ARM_GIC Date: Tue, 17 Nov 2020 13:48:26 +0000 Message-Id: <20201117134834.31731-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Andrew Jones The removal of the selection of A15MPCORE from ARM_VIRT also removed what A15MPCORE selects, ARM_GIC. We still need ARM_GIC. Fixes: bec3c97e0cf9 ("hw/arm/virt: Remove dependency on Cortex-A15 MPCore p= eripherals") Reported-by: Miroslav Rezanina Signed-off-by: Andrew Jones Reviewed-by: Miroslav Rezanina Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20201111143440.112763-1-drjones@redhat.com Signed-off-by: Peter Maydell --- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 7d022eeefdb..e69a9009cf0 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -6,6 +6,7 @@ config ARM_VIRT imply VFIO_PLATFORM imply VFIO_XGMAC imply TPM_TIS_SYSBUS + select ARM_GIC select ACPI select ARM_SMMUV3 select GPIO_KEY --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621154; cv=none; d=zohomail.com; s=zohoarc; b=LK7T0bon6ZioZthistopKUiGwerPfWDu0DlS6NCtLwdInExycyVhkzfdIkJeGZsRyucOqWBSUW58Eyqu0b1qua9cjT1FyeToXLD7iRTNi1wMVgsJw8OdzmevzroOHGBzFuEbhsCWIzQRQpkfUJG6FEBFe2nU65c+c2YBWOvJj6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621154; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=C58kbuRhu6Y3HnOM5/hgbQ3AFR4hHsag4KuDHeck0VU=; b=g1aP/4HQqTKbuWp2vGzC+4qzjYMglz71Ts3Ujjta+DA+xBNNEeH2ScVaQBd7jV/1cEGilG4isAn+KiABF57g1+CgtZZxZHu9RitT26j460w3xth3chfW/pxnokTQrdf3SVHRslfUadDFMHNWUNspR9fOQ5ir5cqyl6v3jWBBbn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621154077623.9734743802904; Tue, 17 Nov 2020 05:52:34 -0800 (PST) Received: from localhost ([::1]:48954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1PN-0008VN-2m for importer@patchew.org; Tue, 17 Nov 2020 08:52:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Le-0003OT-CJ for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:42 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:35164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lc-0001ua-FK for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:42 -0500 Received: by mail-wm1-x335.google.com with SMTP id w24so3296687wmi.0 for ; Tue, 17 Nov 2020 05:48:40 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=C58kbuRhu6Y3HnOM5/hgbQ3AFR4hHsag4KuDHeck0VU=; b=TQ4VMIqsg9qjwTlVr4Eb4J8oWPELFn2+3pFdpSwMIOonqO8N3DWIgBFRW03AHjmqt0 1/TV5W3LoEh+QN5SbCsh+oiFWnBcdLgMjSZhbBZYjdul8WGr2ovpwJ0HoBmJQ1IUsKdo BKqebfCwdq+d/vXDOMdTyyTkx8K5V81F3oyLzAGDjEpt8krU4EetJIKlfZ9sAsz+hulI shpvMRQeX4Z6NTBOG8GtxFIweHf4/CbYyK82txoh8hlJhFj2HyDiR5t2BPl3cUFYsnA/ VXheILj0NaXAJz8Zij/ypfzQXjKvabW2ytkJ98y3b8sAPrhG4Yv73bQKlZ3Wq2fHreX/ wouA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C58kbuRhu6Y3HnOM5/hgbQ3AFR4hHsag4KuDHeck0VU=; b=kgrLEOpyr21+kJmXsAWvpMGbsfFHuzrgCdmfX6x2wwwAVusqDu4c3yUL/X1QZzuGZ2 IRr7oKANSBNwZRspaICeVe2fPLyzkPMEXtlaZ7YHldfjGLZTX1xw+Dnn/8kwVdVSbusd Wrv3GDNAZw2F67tgDbsUHEaIJoiBLnvatKn7EhlZ2XQv8FKnuu15Y1+m643J484euvoR 35xmlQ1OLVf8Q9YmVRzfSB6nVz4GkN5cGWEcNIJi9zeGlXGY2WKeX6azjNqhu3QnRMFU 0WIL3SNRgfzu6yzweRK1nOe/C2TciCnEuff/XyVUr79qDcsYElglwFfzP/I75Ct2Tdg6 U8Iw== X-Gm-Message-State: AOAM531Ld08R/YDqpxoWCN99i5J/COVghuM70Avr0NzMouya7OZKEf4y +KElrQVAZ10NhSqklNect34MSlfMOuS6Qg== X-Google-Smtp-Source: ABdhPJz2zq4/dExuxL5ngq1f9KuovwOBR0K4COosZEYEUPlfUo83Yw9B3tu4m+g8kOw3uoBy0Iqiyg== X-Received: by 2002:a7b:cf31:: with SMTP id m17mr4436340wmg.62.1605620918892; Tue, 17 Nov 2020 05:48:38 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 2/9] exynos: Fix bad printf format specifiers Date: Tue, 17 Nov 2020 13:48:27 +0000 Message-Id: <20201117134834.31731-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Alex Chen We should use printf format specifier "%u" instead of "%d" for argument of type "unsigned int". Reported-by: Euler Robot Signed-off-by: Alex Chen Message-id: 20201111073651.72804-1-alex.chen@huawei.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/exynos4210_mct.c | 4 ++-- hw/timer/exynos4210_pwm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c index 08ee3ca76c0..439053acd2a 100644 --- a/hw/timer/exynos4210_mct.c +++ b/hw/timer/exynos4210_mct.c @@ -537,7 +537,7 @@ static void exynos4210_gcomp_raise_irq(void *opaque, ui= nt32_t id) /* If CSTAT is pending and IRQ is enabled */ if ((s->reg.int_cstat & G_INT_CSTAT_COMP(id)) && (s->reg.int_enb & G_INT_ENABLE(id))) { - DPRINTF("gcmp timer[%d] IRQ\n", id); + DPRINTF("gcmp timer[%u] IRQ\n", id); qemu_irq_raise(s->irq[id]); } } @@ -1003,7 +1003,7 @@ static void exynos4210_mct_update_freq(Exynos4210MCTS= tate *s) MCT_CFG_GET_DIVIDER(s->reg_mct_cfg)); =20 if (freq !=3D s->freq) { - DPRINTF("freq=3D%dHz\n", s->freq); + DPRINTF("freq=3D%uHz\n", s->freq); =20 /* global timer */ tx_ptimer_set_freq(s->g_timer.ptimer_frc, s->freq); diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c index 4fa3d873969..de181428b47 100644 --- a/hw/timer/exynos4210_pwm.c +++ b/hw/timer/exynos4210_pwm.c @@ -169,7 +169,7 @@ static void exynos4210_pwm_update_freq(Exynos4210PWMSta= te *s, uint32_t id) =20 if (freq !=3D s->timer[id].freq) { ptimer_set_freq(s->timer[id].ptimer, s->timer[id].freq); - DPRINTF("freq=3D%dHz\n", s->timer[id].freq); + DPRINTF("freq=3D%uHz\n", s->timer[id].freq); } } =20 @@ -183,14 +183,14 @@ static void exynos4210_pwm_tick(void *opaque) uint32_t id =3D s->id; bool cmp; =20 - DPRINTF("timer %d tick\n", id); + DPRINTF("timer %u tick\n", id); =20 /* set irq status */ p->reg_tint_cstat |=3D TINT_CSTAT_STATUS(id); =20 /* raise IRQ */ if (p->reg_tint_cstat & TINT_CSTAT_ENABLE(id)) { - DPRINTF("timer %d IRQ\n", id); + DPRINTF("timer %u IRQ\n", id); qemu_irq_raise(p->timer[id].irq); } =20 @@ -202,7 +202,7 @@ static void exynos4210_pwm_tick(void *opaque) } =20 if (cmp) { - DPRINTF("auto reload timer %d count to %x\n", id, + DPRINTF("auto reload timer %u count to %x\n", id, p->timer[id].reg_tcntb); ptimer_set_count(p->timer[id].ptimer, p->timer[id].reg_tcntb); ptimer_run(p->timer[id].ptimer, 1); --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621168; cv=none; d=zohomail.com; s=zohoarc; b=DBWSxF3tyxyUzYRhnGYVcNDEyjLKeKDmyKA5M1YC4AZsgSc945pxSfCSAZfCpyv1SNCP2poGoMRJGFRnbPzr3RjwVBOPLurrXovy71y39fS6VgfYqdChctxZVYB4VWreBSgLltGtA22C9e1hZPk9xN0cXJUcPdPNEZwNmqu1nks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621168; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SvXzb1LM/VlcgFEm6/Dvj5K8p8EtRfYYdKzhQEsVrn8=; b=g0gwKZoaSOvmKMqaAY1Ht7jCQY80Ogjnyof5y+c9xf/DJ64RSdcosOenA+dG55JLjYlDSODQjmlmbaW/0ZVehODyOcIGdcmXpqPugn/W74I0WBFmK7B8nfsw+I0BM08HtSok9AO+D+LVmfV7bjv7v+ioUDS8ZWCG5t1xwXLodoI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621168593855.188095262478; Tue, 17 Nov 2020 05:52:48 -0800 (PST) Received: from localhost ([::1]:49250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1Pb-0000BA-II for importer@patchew.org; Tue, 17 Nov 2020 08:52:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Lk-0003Tz-6m for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:49 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:34515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Ld-0001vE-IG for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:47 -0500 Received: by mail-wm1-x330.google.com with SMTP id 23so2078769wmg.1 for ; Tue, 17 Nov 2020 05:48:41 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=SvXzb1LM/VlcgFEm6/Dvj5K8p8EtRfYYdKzhQEsVrn8=; b=axWP7W8y7F+sltOPhmLb90zUO2rQ7Q4k7lmz+Z9Qn+a5dtVV1VlpP8Iij00K7C98jH Ro4p+UrzTacUwoj3PlLnthCQdcBS9z56kQHqrMf7i0TyGhn0xkVCeQ2p+58J0gikc1vD 76ZwFC4bgsiCSTT3Aq0z3rOoq7gLfe/jpLudk1bcESwOnCCog1XN3s88X8XctIcxDoA4 mm8/cMdMVfFqcZXHzCkcwFE1MHxIRyWcMoXaliyMZru+nwJUAjwSl7fzsKfuXw7S2S8a v8VQwlUGYfzncofSQza0qxXXo1Me6jL+flAJ3Yq3veTirHJ7jsFUqDeD1Cg5bVB7a3Pb Hgpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SvXzb1LM/VlcgFEm6/Dvj5K8p8EtRfYYdKzhQEsVrn8=; b=Y7mYVWa5CV5cT0b1jDdGhUPKfIJZGx9hKU9f0pP8FLLn3gbFnaIB/avw/7nWppA7EB iwY8bl3dbpyfPWx4sZ9cx4wtXagVrrW9UHzYnNFUgeN6qoPHZFKxtjptqxRJ+BXNiNqc DxxPSmZbLv+BFdE5BrenUomA5BB/GKHcyzpiPTIQWMafJF3G5SxHQvr6cZTn4seDSfZ3 ooYfHT8tkejzIPm8GU4yMpTnkGxkFu/Qmw3GU0TgUDKWjg87evZ4MAF/mxhGrWaeD4Ap wnKQ5X7eUIDCYafvxmFCX4ZuS1XzhDWEgNFk+ylRNF6peEAdV2aQZ2ZJ72u08vjBwh31 3iFw== X-Gm-Message-State: AOAM530/9xEo61/hh5EjUdRZdSMcmkHi5zY3zOV4oFxO6bNLWPzLPOV2 hxV4+AiGmW7+zIDTqK/ec8lDw7JtI+8NAA== X-Google-Smtp-Source: ABdhPJzMJBSLUwOrWz9s/weumjlgY8U2v8iE7UYZGmqxBwXgN3tYrUKlGh7xBAFGLf0ZqVOzdKgNAg== X-Received: by 2002:a1c:660b:: with SMTP id a11mr4288532wmc.159.1605620919918; Tue, 17 Nov 2020 05:48:39 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/9] hw/input/ps2.c: Remove remnants of printf debug Date: Tue, 17 Nov 2020 13:48:28 +0000 Message-Id: <20201117134834.31731-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) In commit 5edab03d4040 we added tracepoints to the ps2 keyboard and mouse emulation. However we didn't remove all the debug-by-printf support. In fact there is only one printf() remaining, and it is redundant with the trace_ps2_write_mouse() event next to it. Remove the printf() and the now-unused DEBUG* macros. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella Message-id: 20201101133258.4240-1-peter.maydell@linaro.org --- hw/input/ps2.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/input/ps2.c b/hw/input/ps2.c index f8746d2f52c..72cdb80ae1c 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -33,12 +33,6 @@ =20 #include "trace.h" =20 -/* debug PC keyboard */ -//#define DEBUG_KBD - -/* debug PC keyboard : only mouse */ -//#define DEBUG_MOUSE - /* Keyboard Commands */ #define KBD_CMD_SET_LEDS 0xED /* Set keyboard leds */ #define KBD_CMD_ECHO 0xEE @@ -790,9 +784,6 @@ void ps2_write_mouse(void *opaque, int val) PS2MouseState *s =3D (PS2MouseState *)opaque; =20 trace_ps2_write_mouse(opaque, val); -#ifdef DEBUG_MOUSE - printf("kbd: write mouse 0x%02x\n", val); -#endif switch(s->common.write_cmd) { default: case -1: --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621020; cv=none; d=zohomail.com; s=zohoarc; b=fYpd8oyxgP0mleL0tM+7Q4ejBz5pwT57n/K1aQJMKBLYmHCZWq+iYXuOe0o3xklKnvp0NexMlITeYtWAiKHDhxawEQRYiLLZNtKQieOFtW/gJdITh5ta0DbfQHb874pvNnvPxeSIhP3a9QP+heUSAYbIEnLnIWWvJoqzds68O+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621020; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qbgmkx0Ds80yl68jLC3K3LY6B17L2yWeDQHhhL2KqDw=; b=CNUjqed0iC40/43jBmAgDLgEgFLd3GaQEPf/LtimsLibsrqlTt5bX1fCE/Vew0SQR9ReDh3ioy6lSSB1IwmT9EnzG0O4Hy1WGIA5aLT0Uuf7OOWqTMGq+UIKl8zqjig/SSdcdChlnEl4xcEP8xBaLfD3haOTesvNNUzOGvRUh3M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621020484328.46657090365693; Tue, 17 Nov 2020 05:50:20 -0800 (PST) Received: from localhost ([::1]:41148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1ND-0005Aa-Bb for importer@patchew.org; Tue, 17 Nov 2020 08:50:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Lg-0003QF-Q7 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:44 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:53024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Le-0001vd-IK for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:44 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 10so3326986wml.2 for ; Tue, 17 Nov 2020 05:48:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=qbgmkx0Ds80yl68jLC3K3LY6B17L2yWeDQHhhL2KqDw=; b=MmWcWEHcvtQyDG1TbUVoijLny4rpz8kjpI/xxkx1EKQUsI2gPQ2Qml7kvcmOMN9ASc MuG1dQHmYCcJ0LD0f9zEc/0WdmA0Nxljww56tGoiDIXhmctje9IedgGugqQPhyEtWg+/ xeCqsKW3eBKSiE+BjkkaiACmc9MKtFN1EDa4Svo8LlEywKZMkS5NDrIR3TdBY+cIAnQW KqkAluzffan82OzQaggXfjOFG9ioCZKV78dSBfAQ3ElLN9HPsXlmKgphm4aiEIMl3QNJ wrVE5P0N0Yj3pHl1yLnhqYXNASdF6jfNfpif5TVarLPFFQ6bBWKK6DwQDt8m1wkIToWY v1gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qbgmkx0Ds80yl68jLC3K3LY6B17L2yWeDQHhhL2KqDw=; b=VpK0SYZMG4EUZI6oboMr0GrliWodR2hFgKjDtOMfKzLqHztIhBE7zNaguqoSyGfna2 1YZWX5QMGLGn6weCsIgaU8JEVVH8vWqeS2UhW4bKrpWJhKEui6i+jwNnXzZONrmzVPLU 8bukdcwW3pbLj/aYgpQvjiRGihwttoPoJHTiGxIM1OC/qmMgIf4w29RfEqNg0BbZzOv7 47z0Wn6MzdZttNZ0p9F9r1xgRQeouCBP5v6EdUXqQqTCgz58T5Y+w25hNpbcMNUzXi8E frjkRYaaNoG+tNxgpGl/2Om6N3IriazGykt/QUJqoYrPMM3dWDI4Md6XCLZcCeSvLuj8 dicA== X-Gm-Message-State: AOAM532BrUiRjJQsMS+BouMmzgDKZa89KOuLJGy0Jgil33/DKuGcDmjL R5JdyMfy54AydvKiJa7Vsnupqmdc/GPBYQ== X-Google-Smtp-Source: ABdhPJx+qjWiWZqAhRWa+ibZDFE5DUWnVkfacAFJFoT0CDHAJSBMEQeMX3etQhK6HxtEoZnVpvFxig== X-Received: by 2002:a7b:ce0c:: with SMTP id m12mr4309136wmc.114.1605620920953; Tue, 17 Nov 2020 05:48:40 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 4/9] target/openrisc: Remove dead code attempting to check "is timer disabled" Date: Tue, 17 Nov 2020 13:48:29 +0000 Message-Id: <20201117134834.31731-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" In the mtspr helper we attempt to check for "is the timer disabled" with "if (env->ttmr & TIMER_NONE)". This is wrong because TIMER_NONE is zero and the condition is always false (Coverity complains about the dead code.) The correct check would be to test whether the TTMR_M field in the register is equal to TIMER_NONE instead. However, the cpu_openrisc_timer_update() function checks whether the timer is enabled (it looks at cpu->env.is_counting, which is set to 0 via cpu_openrisc_count_stop() when the TTMR_M field is set to TIMER_NONE), so there's no need to check for "timer disabled" in the target/openrisc code. Instead, simply remove the dead code. Fixes: Coverity CID 1005812 Signed-off-by: Peter Maydell Acked-by: Stafford Horne Message-id: 20201103114654.18540-1-peter.maydell@linaro.org --- target/openrisc/sys_helper.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index d9fe6c59489..41390d046f6 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -176,9 +176,6 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong = spr, target_ulong rb) =20 case TO_SPR(10, 1): /* TTCR */ cpu_openrisc_count_set(cpu, rb); - if (env->ttmr & TIMER_NONE) { - return; - } cpu_openrisc_timer_update(cpu); break; #endif --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621163; cv=none; d=zohomail.com; s=zohoarc; b=St51hGHXa2r+fLKUxjFWaPPN+XALbqMjVDHNmwDf6+C8uMRLl7Y55pTLdZltnvMX8oXNvyjmi1W/Acu8Rf9LwIRQiuE21EfZv3iL1uVuZGeIbe8+RQQM/vo7HwNybHco0/6NE8juwtQOQc35cPEbzxtjWYTVNJcr1b60Mk06mbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621163; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AEXyRy8nYSnTezucH5fbwrMAJ7HNi1klPTxtQNRoejY=; b=a/0j5yZ2fJyagEP5RpAslZRJdcoq9pXjOE0DrMfq3+jom0EfdBrRg44vWNKmYm0/1AcCoJ8PRxP1WCYKKVF90xNqdB009figMRpFMDj2+W33Bc0xqdj4mlmlr6xPS7eFc2hDrBsY2MB7y2WWrw6H90WSMW4MFepmUuVJtvgoYgM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621163590229.64057021636745; Tue, 17 Nov 2020 05:52:43 -0800 (PST) Received: from localhost ([::1]:49092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1PW-00006z-Cd for importer@patchew.org; Tue, 17 Nov 2020 08:52:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Li-0003Rb-G7 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:46 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lf-0001vq-Tx for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:46 -0500 Received: by mail-wm1-x342.google.com with SMTP id w24so3296863wmi.0 for ; Tue, 17 Nov 2020 05:48:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=AEXyRy8nYSnTezucH5fbwrMAJ7HNi1klPTxtQNRoejY=; b=fQ8/7tOuRfjLC0RMTyH7yFjlM7XyH35B21o5Ei/GopCG6Ix/a4sn8KBrzdbikmjhzk zr2jZ7ZLIBewRqel+QXoZS+/MIEVgP/hqUY1GSZxT09fMikTbr8wzDyQsuiKUVugk8t/ mX9aBQ2FDd+V4gpf/eA7OZ1qT7wZLrCU2XfOY48ESZ5Luq5xKEwrqYeL0YSxAnxXWa/G jzyBNyZB9G5Vx0wyJtYmDALLRgbe60I76Hwv0jXMN27JF3c/JfWoy0ugdoRF8xfSYqSS NMjmZVZGhrhCxr6zlqS236LtG4oIYk3CjUAcAVn15spJoaS+gpnOW2lCykgrjF9RmUXZ xxAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AEXyRy8nYSnTezucH5fbwrMAJ7HNi1klPTxtQNRoejY=; b=eXjO+j8t5yJ5lYu0KbfUXnVQayvtioeFG01zwsZ3/XBRH1NHSJkhaRFRhGxvlseznP 42h4euWkBZKyS0j9pEliowjD49u0trI5r4qIlhdXP6Dsos9uW/BBN4NcP/ny9rqwiuec alAHH8N6Wd+WkvHCAsOo5LcDCKj4RzuR5VL0D00NkP1IPy6caimYLvMFovo+Bivh4ClF Sw9k4fS/qxTOxSW5aNb6i3avCSGwhwZTnrl3Z5lizTYNmqSDUKlPxKPY5nBC9CVynzhz Ewsjq6zXQ3fkIkXkjigH9CLTd9qS/vhtv2HdOFZjQhEaAvzkZHksXdQzbXRaswy6aH4e jkIA== X-Gm-Message-State: AOAM532YZbUjkPumUiNuEIp/NEqsYqKEtXeICqMo3KAgk0bzlZfV05zR 5t5qdgz9tblteEWaT4ordwKYNNSHUrObPA== X-Google-Smtp-Source: ABdhPJwcGnMSNb0t01y+g9twnInwEu+Bgmfu3MvAS1VmcKSvIZG+eox0yeA5sn5bMTl2xInBjEEeqA== X-Received: by 2002:a7b:c1ce:: with SMTP id a14mr4333560wmj.169.1605620921967; Tue, 17 Nov 2020 05:48:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 5/9] register: Remove unnecessary NULL check Date: Tue, 17 Nov 2020 13:48:30 +0000 Message-Id: <20201117134834.31731-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x342.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Alistair Francis This patch fixes CID 1432800 by removing an unnecessary check. Signed-off-by: Alistair Francis Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/core/register.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/core/register.c b/hw/core/register.c index 31038bd7ccf..3600ef5bde7 100644 --- a/hw/core/register.c +++ b/hw/core/register.c @@ -258,10 +258,6 @@ static RegisterInfoArray *register_init_block(DeviceSt= ate *owner, int index =3D rae[i].addr / data_size; RegisterInfo *r =3D &ri[index]; =20 - if (data + data_size * index =3D=3D 0 || !&rae[i]) { - continue; - } - /* Init the register, this will zero it. */ object_initialize((void *)r, sizeof(*r), TYPE_REGISTER); =20 --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621371; cv=none; d=zohomail.com; s=zohoarc; b=K/SLG+yGZzEe8QsFyOfideMo0Wor2AVH3bVe34ANz9w5jEfxbYS0FrhuxemEC9IbLtD4k1lWG3Kg7xD48tg1VN40mNlTOjV5w4fuzlJy/Dt47TQ/GKY/5JZIBZcJWg3vXg2fr/cbh1r3Wk0QSd/7RakryiTBZCAm6zzp1RSzDA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621371; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DaQ2Ssteyoh9bTakUkfVf51UsrSaiaOBWtYl8OKifX8=; b=S1uRy6zhyz+XxxgzQ/+ddgaYgqp5JscW4HQa5L72eIgmG+ug3cPUOI5TIvCU4GybqeOvFo5on/CBYK78hWkuZUabPhv1fuEbYGn6v0dS4B6EdUjO4octepBhKigKZjwQR35lsyKOY35pIjTpW42mdiSB/mhXOACXQS1dJ6ku2uE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621371029528.225434230817; Tue, 17 Nov 2020 05:56:11 -0800 (PST) Received: from localhost ([::1]:60602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1Sr-0004wk-TM for importer@patchew.org; Tue, 17 Nov 2020 08:56:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Ln-0003VT-VB for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:52 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:47058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lg-0001wT-Ro for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:51 -0500 Received: by mail-wr1-x42c.google.com with SMTP id d12so23200954wrr.13 for ; Tue, 17 Nov 2020 05:48:44 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=DaQ2Ssteyoh9bTakUkfVf51UsrSaiaOBWtYl8OKifX8=; b=UCb4V4/toPgMB0Z1BJLoZQ5s8ziWnl90DLN+ZZsXsjrTF93RmEDsHZW9yHUmdi6jpo OG/M79L30et6LhDImPZM0KDHS/Kqb/yyR7PW5F/9WW1l7U47FfXv99A55HyTEmYRVGMv QS1b4NZTnb9i8jNpiPHLdspeSdEqgLIkjeLkpxEvpR5WCh0qmmRUd53vVOMgSxaT4FQR dciNiAicqFZYhL8nwNvSh01MwvHx74QZfQRe3hrDP480hGQvJcS1z86hGwBeZpODt2NY HFlCmsraY5bKu4xzQQA5s/G8ZbmehLsoij8OA9pCfH8Dej9qvLZzzrbKIh5P2gaTX5fw 1qMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DaQ2Ssteyoh9bTakUkfVf51UsrSaiaOBWtYl8OKifX8=; b=kIxWjfkgsAX5ogIjd7MEM3WsGa5HjtekItWxex1dgPlL/AJDj3dgr16tgIT6sZvN+I rin7CuPLheN6PcI/FYMEn9x4q8YQMk86gRKlGjFAnMxL0zwWUmQ7eY/gmx6O6TicItwz /bK5QjGyumi+bl6J3kwLQBLVKE7QjAbbKrVj1X/39b0YgUVtWfl3IJ5Tzk0pevJxMhNb T3Xj61vd4t3FOxN7nr0VIGrUlKZqK30NDL+SnaeZy7P1HpHdBIzQKknh8kMZNPd0YCrZ vkHvt4g3bbwWy3OEm901+8FPOgb5C9NMXKIZjLwyf/QGfLOOx7T+vFW3CFY0bANMa/OL ss/w== X-Gm-Message-State: AOAM53058xLdQd6jVU4z0bG9XUm3I58O9W7/wCHd85igtpApx3CYzIKC C/FW/qnTkAQ+ImkrHXhqGj4GE7MZnRSb6A== X-Google-Smtp-Source: ABdhPJyHUDee1IHcxQPrzIAIinio+hHI6roEfhHjXHzOUQW5levf3u7u2IpgX1JaLmmvJ+8cWKWMzw== X-Received: by 2002:adf:93e1:: with SMTP id 88mr24301822wrp.37.1605620923033; Tue, 17 Nov 2020 05:48:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 6/9] util/cutils: Fix Coverity array overrun in freq_to_str() Date: Tue, 17 Nov 2020 13:48:31 +0000 Message-Id: <20201117134834.31731-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) From: Philippe Mathieu-Daud=C3=A9 Fix Coverity CID 1435957: Memory - illegal accesses (OVERRUN): >>> Overrunning array "suffixes" of 7 8-byte elements at element index 7 (byte offset 63) using index "idx" (which evaluates to 7). Note, the biggest input value freq_to_str() can accept is UINT64_MAX, which is ~18.446 EHz, less than 1000 EHz. Reported-by: Eduardo Habkost Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Reviewed-by: Eduardo Habkost Reviewed-by: Luc Michel Message-id: 20201101215755.2021421-1-f4bug@amsat.org Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Peter Maydell --- util/cutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index 9498e28e1a2..0b5073b3301 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -891,10 +891,11 @@ char *freq_to_str(uint64_t freq_hz) double freq =3D freq_hz; size_t idx =3D 0; =20 - while (freq >=3D 1000.0 && idx < ARRAY_SIZE(suffixes)) { + while (freq >=3D 1000.0) { freq /=3D 1000.0; idx++; } + assert(idx < ARRAY_SIZE(suffixes)); =20 return g_strdup_printf("%0.3g %sHz", freq, suffixes[idx]); } --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621282; cv=none; d=zohomail.com; s=zohoarc; b=cOsQ4u8Wgv+HfD1dW72YeSv7FOypPtMZdEl4PUP5Yr3miJI4fHm/ttkVjtLKAivg50JNwR+D1IDaklZz/7MV3gQ7S343bcO0f69b17QA3TO87Q+8dwe9P/qiAH6SNL/c14Aep81QRLGKbsGlYLp/nKKa7ZYfn186YAkI79AUrjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621282; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WIwwMdEY5387t3nDgbRHskTkVvKEvXfLu8ZPGnOtUxY=; b=GIzA98Xtt/CML9+qNH0mUPlh8k7gsvPSBoHx0GV5VsOBikYsShA8e15AqsJdPsb1H88h68eAtBtwPv0sOgclQPK2vmGJck8oWOuXI45qUXGvB6yPLzR3mShEr8NlhXctVUrXXzhAoh3CBvukEom6nWTmCf04sv3iGpi0O8fpNyE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621282812503.24532194989956; Tue, 17 Nov 2020 05:54:42 -0800 (PST) Received: from localhost ([::1]:55262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1RR-0002gb-M1 for importer@patchew.org; Tue, 17 Nov 2020 08:54:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Ln-0003Uu-FX for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:51 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Li-0001ws-0I for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:50 -0500 Received: by mail-wr1-x429.google.com with SMTP id m6so6056585wrg.7 for ; Tue, 17 Nov 2020 05:48:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WIwwMdEY5387t3nDgbRHskTkVvKEvXfLu8ZPGnOtUxY=; b=xfY0UgcjKcButQjNTurQwHAJdg6jpbZvH05Sf49iKNGgZsX+sh6SROA6Zv9sjDTT5U NIjPmsJ6GjNdjo5BwiNniq+ZWfIY2PnhBzTqZplIAIu98Rui+87QNEsIHsPEjDh/idod 48E9K7HGsWd3p3UCULlhkwEYCfxKo2Qzqjr5nYCjotcslEFmDbaKVo/RRAf38NJY+5CD ydKruyL0y/BW6NLVes2m/ake425Gf6Ror6A+qv0abuvY3NGQtcKPwx456fHxnOqFDXlE GXR7xCNUJYiJbmqT9B6dpG6vuO+Rpgda6CgDQpNokLLZbjs8crsObK2nn669RxB5CeQj QjeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WIwwMdEY5387t3nDgbRHskTkVvKEvXfLu8ZPGnOtUxY=; b=oqADNlbHJPCD+OvlOq4NSIdYkJGNfhBMr5Mz9SMtlYlzAc+/60OgTPxKMonv9FtB5R g82wXBfTiZaD7AHCA1P7Bc1fT3v25vd6Su7nWze6lWTRwnneRAvwqG9W2B11OzRhIkKP e3cTYL7fT5khDwi60NdemNPz1Y8ouxncwZQ2A/QvSnhCv5G9mGHGaHTqKcSaNMIiWJX8 S649MV37jEgzW2OQTYNa4EzwUDYqnIPzHt/hi5cmr2ARYYYfc+hIqnqn5lDkFcQU4RjS iMrSpLcJ+Uh87S8II0Q94znotfSi6GJc/m8QzQCNh8vZBfLPGPaLMY6JI3FfT6tzNHJ2 1SwQ== X-Gm-Message-State: AOAM531XtYJjuT7CxhjWl2Pd8xFRIfKaj9IFfXc/B6q6r2MLz3ZHwq5k IfBrN/FXwZrV/lzTkUQ2ZtNmg+50mxEYSw== X-Google-Smtp-Source: ABdhPJzmrX4/ebdGkeqQHzFYbmqTXAHTtTn8vsGODGlpqztXCuo53bPzFRx/uXS4RUR6R+8IaWlvmA== X-Received: by 2002:adf:e789:: with SMTP id n9mr24905264wrm.211.1605620924265; Tue, 17 Nov 2020 05:48:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 7/9] configure: Make "does libgio work" test pull in some actual functions Date: Tue, 17 Nov 2020 13:48:32 +0000 Message-Id: <20201117134834.31731-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" In commit 76346b6264a9b01979 we tried to add a configure check that the libgio pkg-config data was correct, which builds an executable linked against it. Unfortunately this doesn't catch the problem (missing static library dependency info), because a "do nothing" test source file doesn't have any symbol references that cause the linker to pull in .o files from libgio.a, and so we don't see the "missing symbols from libmount" error that a full QEMU link triggers. (The ineffective test went unnoticed because of a typo that effectively disabled libgio unconditionally, but after commit 3569a5dfc11f2 fixed that, a static link of the system emulator on Ubuntu stopped working again.) Improve the gio test by having the test source fragment reference a g_dbus function (which is what is indirectly causing us to end up wanting functions from libmount). Signed-off-by: Peter Maydell Reviewed-by: Paolo Bonzini Message-id: 20201116104617.18333-1-peter.maydell@linaro.org --- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 4cef321d9dc..2717cf1db0a 100755 --- a/configure +++ b/configure @@ -3512,8 +3512,15 @@ if $pkg_config --atleast-version=3D$glib_req_ver gio= -2.0; then # Check that the libraries actually work -- Ubuntu 18.04 ships # with pkg-config --static --libs data for gio-2.0 that is missing # -lblkid and will give a link error. - write_c_skeleton - if compile_prog "" "$gio_libs" ; then + cat > $TMPC < +int main(void) +{ + g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0); + return 0; +} +EOF + if compile_prog "$gio_cflags" "$gio_libs" ; then gio=3Dyes else gio=3Dno --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621072; cv=none; d=zohomail.com; s=zohoarc; b=H0+T3jECz8JEmiSyFML/3/UJtC/D7OcdxqFtLdkzr0MLOitxaf2pTHfr1iia6c9zrj7S7yVDyto9oI82EUVsFBZaBM6hhtXFlRCsreHdoQZeuJLJjuTThVbUL9ijaHvVklqNeh8lrzAph9SJznyu3aSaZjRr1iNchdtc2918A+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621072; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WT37bYNqvqYKmtijsnBsmig/2KKXqudPCkO86LomDGE=; b=DNu5ZTeXAsOotkr6TnoEVZM8MvoFFh/eTyKgijh4MCe60fpgLaLdEwoUKQEAKDY5KwV0rRhi856LfeH1z54tufhmUkJR8wIk9C8Jm1yYFx9UL9iSUz/XGSiBNQ+UMzN6JYhTNAXexR8wmbbGthrYaVfnu9Z+SQZbyTAUTs62goQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621072529345.1252603358723; Tue, 17 Nov 2020 05:51:12 -0800 (PST) Received: from localhost ([::1]:43832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1O3-0006JQ-9e for importer@patchew.org; Tue, 17 Nov 2020 08:51:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Ln-0003Uv-HC for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:51 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:33535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lj-0001wy-Ss for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:51 -0500 Received: by mail-wm1-x344.google.com with SMTP id p19so2081855wmg.0 for ; Tue, 17 Nov 2020 05:48:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WT37bYNqvqYKmtijsnBsmig/2KKXqudPCkO86LomDGE=; b=xTNDwW8GPt/T0TpbFjugpQND1hL9etagsZsNHM4+6WaCOdxtHshpiHAAsjfN+zY24Y LTmGECH80+P3iOsFVfyOKvA8gc/ed83z2ZKAzVdXkRKLM5f/OD42YAOzfj2wLDfgP5An XQO+MtmnkI9uemews5VsEVDPjs+Bnt2fQ6yB5WQ7PGO3MbalThetrv5HF2B4ONBIyOrZ abUdooCeXRs5r1QG1/Iqc1hNLBRuC28polYlLlEtQ3z/vjHpFyVnYhYeYYfiNHinyvmh zJcOk+uhQO/ItNrthAIEUU8nX9bGgznashIgYnXxg6h5jEdLnEBEXLbQRatyqCKiMn0S LYhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WT37bYNqvqYKmtijsnBsmig/2KKXqudPCkO86LomDGE=; b=DX9DudTJoIKpNW5BVul3ezbdEhbe6QAkQ3Kxeb4UnekEwWFEMpMPLSs1yfshZrAOqv 7O0yEJYuS8nET9NHr5nAH00EfgkBWKjiSuQVxghaOKINUzbq41ejUcDDnpwPchhQzOeQ vik8i5ifFYw4tN+VQ6u3wM2nyYzw/IvpSOK5b4CUY3TP7VFrNjgBnYigqUqTaN0hBSly xcuSnNlH6V4pObi7CxsiuymScfJKS+ITTx0pVJrZzAZyY3RUFCdfUvJURvtOPq0yQs5Y PWqzq9MNfpGUHbiqCXB20DkCOV7TJqZLYki/qx3hDRKwZ5zhIxKB4S8BIDkJHXch4u3X PB3w== X-Gm-Message-State: AOAM533ZMqD15lj3NZc4RXgqDIv4O/yO7s/xjrRCyjBDDjEl8ltJ3HDI PnWmZjTObUIwzolf2DIklrCqsekcf8jnyg== X-Google-Smtp-Source: ABdhPJzdSRLOszoAMMPfjfMaqjRkTOC2V/m4nGUtkhEZJUxRQ2Yw8Yrm4MfZX426jHb34kr5rs7duA== X-Received: by 2002:a1c:1946:: with SMTP id 67mr4453257wmz.15.1605620925281; Tue, 17 Nov 2020 05:48:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 8/9] hw/misc/tmp105: reset the T_low and T_High registers Date: Tue, 17 Nov 2020 13:48:33 +0000 Message-Id: <20201117134834.31731-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) The TMP105 datasheet (https://www.ti.com/lit/gpn/tmp105) says that the power-up reset values for the T_low and T_high registers are 80 degrees C and 75 degrees C, which are 0x500 and 0x4B0 hex according to table 5. These values are then shifted right by four bits to give the register reset values, since both registers store the 12 bits of temperature data in bits [15..4] of a 16 bit register. We were resetting these registers to zero, which is problematic for Linux guests which enable the alert interrupt and then immediately take an unexpected overtemperature alert because the current temperature is above freezing... Signed-off-by: Peter Maydell Reviewed-by: C=C3=A9dric Le Goater Message-id: 20201110150023.25533-2-peter.maydell@linaro.org --- hw/misc/tmp105.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index b47120492ab..0a4aad4854e 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -225,6 +225,9 @@ static void tmp105_reset(I2CSlave *i2c) s->faults =3D tmp105_faultq[(s->config >> 3) & 3]; s->alarm =3D 0; =20 + s->limit[0] =3D 0x4b00; /* T_LOW, 75 degrees C */ + s->limit[1] =3D 0x5000; /* T_HIGH, 80 degrees C */ + tmp105_interrupt_update(s); } =20 --=20 2.20.1 From nobody Sun May 5 10:17:03 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1605621286; cv=none; d=zohomail.com; s=zohoarc; b=XXzlY2QqoLoFeS9BYofMdwlMMbKEISawV5UP952GFwuHdYbBTRK4UQGBBFLN9n8sRqAUDp+LukwwIy/iMNRFej+HuxHYIUBVFWWAjHKrctPQrFbyGI482ek31ak5F6F3JTLnleENF0+aBaC5+uWkt+IbrWXlGeYtjjliG4B0/O8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605621286; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uXQy7avPIsikFN1P0ZhElOm2aUCedu45kt9MesJvAvc=; b=aNxMHXK2xKB4x5IRbzBnZ229TvqIygKqiTLnz4T/9FRUT8aeLiFC6lpTDPbQCHF9SiRjg87kzAOm8UgTguU17y5S0I+cVhwWLg866Uk3VL6N0HTV9QTAbRrjLieiAnHlsVRB2gjfgq4AeS3B5TlvYiYo92gz8XNiWpfFTfKQ31k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605621286372484.20021879682633; Tue, 17 Nov 2020 05:54:46 -0800 (PST) Received: from localhost ([::1]:55562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf1RV-0002oY-9Z for importer@patchew.org; Tue, 17 Nov 2020 08:54:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf1Lo-0003Vc-Gp for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:53 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf1Lk-0001x6-2C for qemu-devel@nongnu.org; Tue, 17 Nov 2020 08:48:52 -0500 Received: by mail-wr1-x42d.google.com with SMTP id j7so23232970wrp.3 for ; Tue, 17 Nov 2020 05:48:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id d8sm3578630wmb.11.2020.11.17.05.48.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 05:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uXQy7avPIsikFN1P0ZhElOm2aUCedu45kt9MesJvAvc=; b=BsThTijXoeGxSRILpk5l+6M8OD50bZ4rt42D0A5tf5D8Iv3qCiV0wFS1NC1aYMukzB oA1nzESRCb/qUPjt08X/4hrnbC8UnRs490b2+EwCMyjK7Q99B81Mhtlbm/Oxw32gPS6K dPWBOJMCUHZkS2EKaK3neNbDaHGmWSjeypLw/psZBaVgX5HTHF/XUHpC6oTZEcmawTB3 xdUtRzHDiDiM8ZnR3O6hrYMPht+nu4iSEb/g2zxrdO9BR8w+4tfVr7+NDRvCOkn9WXJU vAFtbuPFNDcEPQsCkEwlcJ6jtwQg3GaGFstZMBDIupD/tLevdn+UEM5WGbKTTLpywv3D PIaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uXQy7avPIsikFN1P0ZhElOm2aUCedu45kt9MesJvAvc=; b=D0+RqjDgitNhL6etx/ALoP/BAQmySPnc2KCxZs3utjhRNEj3lpgcKj2y68kuUs2Id/ 48fsIPlav4p30bo5nciYC2MO9QJ2YJLWvQOvkA4fRGtpsM/IVlG77RsSmJo8FHLA9kve vzH4vOBCJOjttUEVCcS5/JE9yq2OdOIScKF+LdKQYB3jVvL+f/mVu1w+XPEV3YOablAN BC1AjubsSTR6eGevrihnhWsgyZLfQ6xFiuLv653eT/1gdNY7oz7u7sfCmNCpP3RJtkdG DUz1qpdZbpu7mVZuIKgczG3VxyYx8VGnKTXkt/XP+yoiUP+aiHK0YGHoFR/LLaz8K/7s DAew== X-Gm-Message-State: AOAM531j6OutjPS9FCkmGmZMOrBojLO1sU1u9pxnaai/yPhq2lDSZgDy 7YOVIgn0RBY8ErjwKpqPuGSmu7Z+74ZLlw== X-Google-Smtp-Source: ABdhPJwuOJ/8q4fqX/fOh56Wa9Dhm7wVl+khtzmqgy9H1ATsHfi1kbJstS2RkZgoJe48vK34PNm3BA== X-Received: by 2002:a5d:634c:: with SMTP id b12mr24716308wrw.130.1605620926386; Tue, 17 Nov 2020 05:48:46 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 9/9] tmp105: Correct handling of temperature limit checks Date: Tue, 17 Nov 2020 13:48:34 +0000 Message-Id: <20201117134834.31731-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201117134834.31731-1-peter.maydell@linaro.org> References: <20201117134834.31731-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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=ham 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) The TMP105 datasheet says that in Interrupt Mode (when TM=3D=3D1) the device signals an alert when the temperature equals or exceeds the T_high value and then remains high until a device register is read or the device responds to the SMBUS Alert Response address, or the device is put into Shutdown Mode. Thereafter the Alert pin will only be re-signalled when temperature falls below T_low; alert can then be cleared in the same set of ways, and the device returns to its initial "alert when temperature goes above T_high" mode. (If this textual description is confusing, see figure 3 in the TI datasheet at https://www.ti.com/lit/gpn/tmp105 .) We were misimplementing this as a simple "always alert if temperature is above T_high or below T_low" condition, which gives a spurious alert on startup if using the "T_high =3D 80 degrees C, T_low =3D 75 degrees C" reset limit values. Implement the correct (hysteresis) behaviour by tracking whether we are currently looking for the temperature to rise over T_high or for it to fall below T_low. Our implementation of the comparator mode (TM=3D=3D0) wasn't wrong, but rephrase it to match the way that interrupt mode is now handled for clarity. Signed-off-by: Peter Maydell Reviewed-by: C=C3=A9dric Le Goater Message-id: 20201110150023.25533-3-peter.maydell@linaro.org --- hw/misc/tmp105.h | 7 +++++ hw/misc/tmp105.c | 70 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/hw/misc/tmp105.h b/hw/misc/tmp105.h index e5198fce80a..7c97071ad75 100644 --- a/hw/misc/tmp105.h +++ b/hw/misc/tmp105.h @@ -43,6 +43,13 @@ struct TMP105State { int16_t limit[2]; int faults; uint8_t alarm; + /* + * The TMP105 initially looks for a temperature rising above T_high; + * once this is detected, the condition it looks for next is the + * temperature falling below T_low. This flag is false when initially + * looking for T_high, true when looking for T_low. + */ + bool detect_falling; }; =20 #endif diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index 0a4aad4854e..d299d9b21b7 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -41,16 +41,40 @@ static void tmp105_alarm_update(TMP105State *s) return; } =20 - if ((s->config >> 1) & 1) { /* TM */ - if (s->temperature >=3D s->limit[1]) - s->alarm =3D 1; - else if (s->temperature < s->limit[0]) - s->alarm =3D 1; + if (s->config >> 1 & 1) { + /* + * TM =3D=3D 1 : Interrupt mode. We signal Alert when the + * temperature rises above T_high, and expect the guest to clear + * it (eg by reading a device register). + */ + if (s->detect_falling) { + if (s->temperature < s->limit[0]) { + s->alarm =3D 1; + s->detect_falling =3D false; + } + } else { + if (s->temperature >=3D s->limit[1]) { + s->alarm =3D 1; + s->detect_falling =3D true; + } + } } else { - if (s->temperature >=3D s->limit[1]) - s->alarm =3D 1; - else if (s->temperature < s->limit[0]) - s->alarm =3D 0; + /* + * TM =3D=3D 0 : Comparator mode. We signal Alert when the tempera= ture + * rises above T_high, and stop signalling it when the temperature + * falls below T_low. + */ + if (s->detect_falling) { + if (s->temperature < s->limit[0]) { + s->alarm =3D 0; + s->detect_falling =3D false; + } + } else { + if (s->temperature >=3D s->limit[1]) { + s->alarm =3D 1; + s->detect_falling =3D true; + } + } } =20 tmp105_interrupt_update(s); @@ -197,6 +221,29 @@ static int tmp105_post_load(void *opaque, int version_= id) return 0; } =20 +static bool detect_falling_needed(void *opaque) +{ + TMP105State *s =3D opaque; + + /* + * We only need to migrate the detect_falling bool if it's set; + * for migration from older machines we assume that it is false + * (ie temperature is not out of range). + */ + return s->detect_falling; +} + +static const VMStateDescription vmstate_tmp105_detect_falling =3D { + .name =3D "TMP105/detect-falling", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D detect_falling_needed, + .fields =3D (VMStateField[]) { + VMSTATE_BOOL(detect_falling, TMP105State), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_tmp105 =3D { .name =3D "TMP105", .version_id =3D 0, @@ -212,6 +259,10 @@ static const VMStateDescription vmstate_tmp105 =3D { VMSTATE_UINT8(alarm, TMP105State), VMSTATE_I2C_SLAVE(i2c, TMP105State), VMSTATE_END_OF_LIST() + }, + .subsections =3D (const VMStateDescription*[]) { + &vmstate_tmp105_detect_falling, + NULL } }; =20 @@ -224,6 +275,7 @@ static void tmp105_reset(I2CSlave *i2c) s->config =3D 0; s->faults =3D tmp105_faultq[(s->config >> 3) & 3]; s->alarm =3D 0; + s->detect_falling =3D false; =20 s->limit[0] =3D 0x4b00; /* T_LOW, 75 degrees C */ s->limit[1] =3D 0x5000; /* T_HIGH, 80 degrees C */ --=20 2.20.1