From patchwork Fri Jul 5 08:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 810351 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1507516wru; Fri, 5 Jul 2024 01:41:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXWAzrX5X8e4NlvlBS4qGcwwdAMHz9i1odvZgEE60RlR1cOJamuQ8DUxPgxvdx2D4zfp5Z0/8y4n9eWzGq9ZAnY X-Google-Smtp-Source: AGHT+IFYUa52U3S9Z4CQcH0Kzpd8mZDZ+RY3JB/Pcs0IWY796lkLhDU5h/pyncJ4tWOEjltCAFW6 X-Received: by 2002:a05:620a:408b:b0:79c:bfb:eaac with SMTP id af79cd13be357-79eef28bb6amr591921385a.7.1720168893600; Fri, 05 Jul 2024 01:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720168893; cv=none; d=google.com; s=arc-20160816; b=ciYjNn5IknKL7Qsffwd96ZfoIddqfMbO5Em2utL4QOBGgx30QB/JUSQew2M8033KZk vUo2fiqDt+wwvEL2dXs0hUxXLblohwMGapv8iwu0yG+W8BzyIqwjRUtNawFmyXu069Q4 V++EqnEPAz6t0GjIi6BJiZlvyzFeGlAhg5n0xfqKSUlYcxnitwWzcfkT8eI/NBHZ2k+C 78cbzm7XPYb3sW4g2ctJpSAY33n70yD0xmO5Yo6dmpLGdgyw3Ht9D27jQDDjd3rtjuTK m8x/ChpHzdqe5Pa/pnMyuUGnDGCZ85Rj+n5MuhqEstlDfd0tZETcl4ebb1Rhmo+YZVYd ZNBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; fh=fOmDb3LWEc8YYk2jJaPNBibuO+xI4aDvcJfVffKo+VU=; b=TxjnOOWvLCb8K+PN8rST31Ef5rgpfxC4uaO21yOq08Ovf+kkbMEj9zKHnE58XNO08H eyo+OJXFoMbbr5aeSM+ct4FFkVTfS67ewJJHbmHR7uJBcdXDJBOLOljnUGHhVV/z99oH rfFNliI0UIq7zxTly0TLdHribtfePGMXb1y+kyki5S8WzQbLme3hbKJ6blg1yQMQHsY8 C6xX1RTD2/Mtu2skqbv14urAzqsajnipn2dwZava66E16d82m2XWHSHqcelnNTJ/zr1F bo+ESVTcd3cAt76DCF3CUh3sHF6DIAn1z+8vuliPojzTPWs92z1UH6X2A9f2+uYMVkTh S0dQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G1CCYvkl; 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=pass (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 af79cd13be357-79d69309122si1580535185a.459.2024.07.05.01.41.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2024 01:41:33 -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=pass header.i=@linaro.org header.s=google header.b=G1CCYvkl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPeV8-0008WR-2V; Fri, 05 Jul 2024 04:41:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPeV2-0008UV-LR for qemu-devel@nongnu.org; Fri, 05 Jul 2024 04:41:00 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPeUv-0003BH-UX for qemu-devel@nongnu.org; Fri, 05 Jul 2024 04:41:00 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-58f9874aeb4so577454a12.0 for ; Fri, 05 Jul 2024 01:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720168852; x=1720773652; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; b=G1CCYvkluMc7MQspvClMYeqWFpbSeBpFY8c+csuObflsApuFr4ulIdMLt8ZbqlaSJ4 lyTYIgBBwu10G2DnMSMVyjhN85Us3bkgU8we2Heb4z+iW3in9WGwecpc3Z5mTi4mt3Oz A6tR0c32r/G1hU2as75ceCAVVhPwurkq73QJbvJcWBn6XYLcPw7gaB19/P+sDW3YSGBi rOdyZdiGV8y4BqzjqeBoCaolrQJvaogSB5JX7B+5/s1w6+/+Uk2LTOnzJx2pj+QDV05K xUW5Z+GUORuU5fgo7qVMT82L4T5qeNzK1Yc0gjn8/nDJ63BPuCeqGy2bWvQg+9sO6Cpy Ua5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720168852; x=1720773652; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mE9NVMNgeMpdIBYLHPdIh0Aogurvyr2VaxgmAxGfLmI=; b=EwjRX9TT8apUvDAJOFEHhmYVlOuI3jJ3+Gq4S2r0nxoSi5nJml1ObNcfoTckjOKL29 sWZ1v14FEwJa2a/iWkcyklsh/P507PyvQHHrD4k9trE/QFzL7MJFP1/0XbbtNpqHuE8i pVgikAF+O8bUg4y/jTBzrneHmOaLWU3Y39XOyyBW8VNJONGVfVSHtKexnxPhdgWdeA13 krkbVTPHTrjqpHBwaEU/jHi5O9WnCy6XIOf1AVAqyTlogGdXPIGNed6MGC1KUnCs3+AN 1zbUR2kzWcQ7Qa74JwX3SZnF3tdnIqB4EYTNOupaSPWSltIxq/UbR9cjCvO8etfQjT7s Movw== X-Gm-Message-State: AOJu0YxMRVjD57OX5tqekZVSeMNDPHZUheiZ0F2oqWmO0eGMJvp6yEII nwd89EFqLl988DbgIkOi+PW9Bjb8aH3V67+pqLEYpBtZ5EGAEk2f/uKe/eqawwA= X-Received: by 2002:a17:906:13db:b0:a77:cca9:b21c with SMTP id a640c23a62f3a-a77cca9b865mr68617566b.34.1720168852016; Fri, 05 Jul 2024 01:40:52 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab08cab4sm676033266b.144.2024.07.05.01.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 01:40:49 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 12DF15F931; Fri, 5 Jul 2024 09:40:48 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Beraldo Leal , David Hildenbrand , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Alexandre Iooss , Thomas Huth , Mahmoud Mandour , Peter Maydell , qemu-arm@nongnu.org, Aleksandar Rikalo , Mads Ynddal , Yanan Wang , Eduardo Habkost , Peter Xu , Richard Henderson , Marcel Apfelbaum , Paul Burton , Stefan Hajnoczi , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier Subject: [PATCH v2 04/40] hw/core: ensure kernel_end never gets used undefined Date: Fri, 5 Jul 2024 09:40:11 +0100 Message-Id: <20240705084047.857176-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240705084047.857176-1-alex.bennee@linaro.org> References: <20240705084047.857176-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Really the problem here is the return values of fit_load_[kernel|fdt]() are a little all over the place. However we don't want to somehow get through not having set kernel_end and having it just be random unused data. The compiler complained on an --enable-gcov build: In file included from ../../hw/core/loader-fit.c:20: /home/alex/lsrc/qemu.git/include/qemu/osdep.h: In function ‘load_fit’: /home/alex/lsrc/qemu.git/include/qemu/osdep.h:486:45: error: ‘kernel_end’ may be used uninitialized [-Werror=maybe-uninitialized] 486 | #define ROUND_UP(n, d) ROUND_DOWN((n) + (d) - 1, (d)) | ^ ../../hw/core/loader-fit.c:270:12: note: ‘kernel_end’ was declared here 270 | hwaddr kernel_end; | ^~~~~~~~~~ Signed-off-by: Alex Bennée Reviewed-by: Manos Pitsidianakis --- hw/core/loader-fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 9f20007dbb..7ccc9d5fbc 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -267,7 +267,7 @@ int load_fit(const struct fit_loader *ldr, const char *filename, void *opaque) const char *def_cfg_name; char path[FIT_LOADER_MAX_PATH]; int itb_size, configs, cfg_off, off; - hwaddr kernel_end; + hwaddr kernel_end = 0; int ret; itb = load_device_tree(filename, &itb_size);