From nobody Mon May 20 01:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610899679; cv=none; d=zohomail.com; s=zohoarc; b=V96e9ugRPGbQglMcgVcIxP8s65HcWLYBD9o6mNBTjDNfaT6hzMQjORet+b2yqwZdqQfC/2kfJh5KlEgHaH2S4vn4Ug0oOxntwEawwLFIZ4qYFRUSy46HPAUJAh80t54ofhoUZa8RKsKnxB08j9tBRhWel3MxOkePztCQ39PFzhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610899679; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=9gp4GCWnW/Dfp9of3a78KlM9Oh27jAj5piJO94evM/I=; b=htlSUqe08NMe7J2fs+EfMlX4viXlMqsRCzD2uFqtWM+01IVm4vEqNExgQOGXKlxFfDQdWhLHkSE1vPpTTDnS/fvNYa2PsNyVaAkh7tQDZ0trmzPJPr5GV1SwXs8up6ESWlC6BVj6QrsTX3wv4t28FfPqN21ZcR1PSuT2epsZr+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1610899679820356.67217901700667; Sun, 17 Jan 2021 08:07:59 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id y17so14127674wrr.10 for ; Sun, 17 Jan 2021 08:07:59 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (13.red-83-57-169.dynamicip.rima-tde.net. [83.57.169.13]) by smtp.gmail.com with ESMTPSA id k9sm21279096wma.17.2021.01.17.08.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 08:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9gp4GCWnW/Dfp9of3a78KlM9Oh27jAj5piJO94evM/I=; b=b3bjzc2FCs1oskzHN1HyI0/sTskEGcVRuM3SdF6oGHu7+strSs/wcdhp07nf6+9gdI hyomHgdHmOK/4j/UYXA7giN+j7Jo9pY1eh7YPEXTaKzkYh/+De2ZcWkL42alLjBUjyar c2TzdQlUDs+5lJuZGxBDFpvxSi2JVeVXT2uGueaSJnjEW+TyW1CJZrGQxalGVIrAlCHo Hi6exACVOPtagBPq72IIpOYLJ7RVLM2hEnfQdpyBNKub/qgMYSXCcXH2Dlcjai/uC6T4 WGmGTMKWppxOtqWznxH3hBpoXGQW/U76fr5MGd6kKv61NtaEwMQ4DmEjnzDo7GYeSK3q YmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=9gp4GCWnW/Dfp9of3a78KlM9Oh27jAj5piJO94evM/I=; b=CbknQoalKmun4Hhl2TTFmF8cLbpxUt3mzb9+jw8yRq7S/PN2aSnu0GdDnOqOmzLFom oIIwqt+QKxqFEIk/LuYvYlftgfguKsZF1PUbsuPd8nhtiN9USbvIyH8PMSofxD58hI+V K1e3zVUdevUE1jUbU77nVBXby7TE48JFcHgioSot0durxOowl6Onc0e/CAJIMuJrRtD6 CtbI0Twxu/nvvX32DhYLHJwGQjZ8VcMli6sqF+sfyy7WNOOYXgb7sftN/KCvpJjkWKvP iSi0WljVjUJ4BWHaZRkFeYs2GUQiJoisNVxRhOGCGSc9gCEdM+rMY1KCYDJv+8V2T44F oPtA== X-Gm-Message-State: AOAM531hu7+MYEDF8ZVnWqPZQJrvV15+DpbDq/pAj9okNBdzyGGnV8NK 25YARdO1cCdKRItk96YdCLE= X-Google-Smtp-Source: ABdhPJyZuGYJ14NvxVC7fXI6OBwmD49i0f9eN4UP3JSH4wQ/YDy+UseLDT2iG7snV5goyaqSO+77LQ== X-Received: by 2002:a5d:650f:: with SMTP id x15mr22258159wru.332.1610899678070; Sun, 17 Jan 2021 08:07:58 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell , Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] softmmu/physmem: Hint notifier is not NULL in as_translate_for_iotlb() Date: Sun, 17 Jan 2021 17:07:54 +0100 Message-Id: <20210117160754.4086411-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) When using GCC 10.2 configured with --extra-cflags=3D-Os, we get: softmmu/physmem.c: In function =E2=80=98address_space_translate_for_iotlb= =E2=80=99: softmmu/physmem.c:643:26: error: =E2=80=98notifier=E2=80=99 may be used u= ninitialized in this function [-Werror=3Dmaybe-uninitialized] 643 | notifier->active =3D true; | ^ softmmu/physmem.c:608:23: note: =E2=80=98notifier=E2=80=99 was declared h= ere 608 | TCGIOMMUNotifier *notifier; | ^~~~~~~~ Insert assertions as hint to the compiler that 'notifier' can not be NULL there. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Yet another hole in our CI. --- softmmu/physmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 6301f4f0a5c..65602ed548e 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -605,7 +605,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu, * when the IOMMU tells us the mappings we've cached have changed. */ MemoryRegion *mr =3D MEMORY_REGION(iommu_mr); - TCGIOMMUNotifier *notifier; + TCGIOMMUNotifier *notifier =3D NULL; int i; =20 for (i =3D 0; i < cpu->iommu_notifiers->len; i++) { @@ -638,6 +638,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu, memory_region_register_iommu_notifier(notifier->mr, ¬ifier->n, &error_fatal); } + assert(notifier !=3D NULL); =20 if (!notifier->active) { notifier->active =3D true; --=20 2.26.2