From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CBEFC433E0 for ; Fri, 12 Mar 2021 13:53:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E834064F80 for ; Fri, 12 Mar 2021 13:53:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E834064F80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKiEk-0004lt-1A for qemu-devel@archiver.kernel.org; Fri, 12 Mar 2021 08:53:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKiCu-0002mK-1s for qemu-devel@nongnu.org; Fri, 12 Mar 2021 08:52:01 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKiCg-0001vF-E3 for qemu-devel@nongnu.org; Fri, 12 Mar 2021 08:51:59 -0500 Received: by mail-wr1-x42f.google.com with SMTP id e9so1816391wrw.10 for ; Fri, 12 Mar 2021 05:51:46 -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=Cxy5kE0XNvFPwMzhDlEv7f+ogAIeq+g64WrdWOpTyMw=; b=kmeOwK5XJwsjmpt6GSxLjfPzUQMgWKK5yqhrkx7EmEIejPtlWahMHqBmckx3rlqVfs tXkDWTh22SYQTlyw0fP+FG6EZF71g6XzE5zpooIjCWW1PgYlz/Apy2t4YBhASfnSk3Za tthdQGoGy6M8eGDejVeTUuxsjRKcan2fmJ6RpZz4r6PNhZ6AhuwopshS5JKWF3zUMWbc yy0pHSsKEj9PXhB3r6upoJD43/dOa/Ppw8/luVoreYDv1B3J+gqn5Ur5SGJ42iAsufrs iRFMP+5IaVfMioDnIhncBim+Dmgi21SiKRspD2O1eQHZlZed2i/SUuy2NO/xGns3/7Fy 5+Ew== 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=Cxy5kE0XNvFPwMzhDlEv7f+ogAIeq+g64WrdWOpTyMw=; b=FZDRUuSbs1+4lix735BrBAWr4f7hQhDSgO3VtqwQ4I9UipXSUOC/CaOH367a13QLe3 hIsYumaDTPT30VWVacTfqGtO6lLupOxAJq7y1Q9JgjAxTTVXn9MrpHmZav8lUlJP5sJ0 dznQuxPQUzWgxSEbAsqulen3Dbnr89TJ8p05Ld9F4d13UbKwGy6RWEuryMm1jClRQ+Gc 8NfIQkgTHVGyGMOYIVKB1t06ZCmXR5maYhk4OwYSFR5DzYH+rxE0lYiqQr/+JTJmioAc RVcJfna4Caepy7IASVAwoXjM/+K6Dbe6tY79HxYpP6xq8pYzCD3/JnT9j6EOC6XZgb8U /vbw== X-Gm-Message-State: AOAM532oF3lGoB6cNXAhKCygSE26rpu3rXoLr8YsqFga5Th2/Z+Y+alP a5Gqg4cJFiY+2QE+0nlf+Xveee9fVKpfNy1g X-Google-Smtp-Source: ABdhPJxnWTOh3hfcKEUjWe0cPMa58wMsjAO3MOTrHWzcNmcbJS818WAdJfeEhjZUWt17yqo4CZvEQg== X-Received: by 2002:a5d:684d:: with SMTP id o13mr14586413wrw.235.1615557105085; Fri, 12 Mar 2021 05:51:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id m6sm7964994wrv.73.2021.03.12.05.51.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 05:51:44 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/39] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate Date: Fri, 12 Mar 2021 13:51:04 +0000 Message-Id: <20210312135140.1099-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312135140.1099-1-peter.maydell@linaro.org> References: <20210312135140.1099-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger With -Werror=maybe-uninitialized configuration we get ../hw/i386/intel_iommu.c: In function ‘vtd_context_device_invalidate’: ../hw/i386/intel_iommu.c:1888:10: error: ‘mask’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1888 | mask = ~mask; | ~~~~~^~~~~~~ Add a g_assert_not_reached() to avoid the error. Signed-off-by: Eric Auger Reviewed-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210309102742.30442-2-eric.auger@redhat.com Signed-off-by: Peter Maydell --- hw/i386/intel_iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index b4f5094259e..3206f379f8b 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -1884,6 +1884,8 @@ static void vtd_context_device_invalidate(IntelIOMMUState *s, case 3: mask = 7; /* Mask bit 2:0 in the SID field */ break; + default: + g_assert_not_reached(); } mask = ~mask; -- 2.20.1