From nobody Fri May 10 21:33:01 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1694534217; cv=none; d=zohomail.com; s=zohoarc; b=BBx6Lyeal5UQPV7TqwkeXqSh9hFbQ3Y9TT32We/A+sQFnMgSNKOCCZuPWNkrqe1cLkZV2ZW9bsAxIeitlICRXmYGawsOHE5l+OsshEK1jugJW1INtTqI3tzfiTwD7OIt0kSv+Wbj05u9/NZf/rYkn/XoeMejR97A3Am1wIRii4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694534217; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=vLiTQI2ctp7aBuz8sVg5RitrZJwufaJgbCFj8rPDCNA=; b=WEV8HYoV4FOsK9xg1ey+HElnztdAj7NuZlR0w9zOZD7d/akZmyN4gG1b0EuMUBJIuKnCA4Ah+icVgtC4tWYRHoKp1gGTV96y19q4+JWtUiry6mfvy65eZkbBXu3Uu1OL4QYlcBq8w18qWX35I27sSjWrpWNz+zdrzZda5kMjdok= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169453421730570.16814293969969; Tue, 12 Sep 2023 08:56:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qg5kE-00067z-BK; Tue, 12 Sep 2023 11:56:07 -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 1qg5kB-00067e-9x for qemu-devel@nongnu.org; Tue, 12 Sep 2023 11:56:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qg5k8-0007xI-Uq for qemu-devel@nongnu.org; Tue, 12 Sep 2023 11:56:03 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-LSEM45LkMWuh4VggqH1s5w-1; Tue, 12 Sep 2023 11:55:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E2168019DC; Tue, 12 Sep 2023 15:55:56 +0000 (UTC) Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.193.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5C2C10F1BE7; Tue, 12 Sep 2023 15:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694534160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vLiTQI2ctp7aBuz8sVg5RitrZJwufaJgbCFj8rPDCNA=; b=QVAFs+U4rpC40XVHOcbb51MyANqP9kuUHHlZVQ1ZCqhA9vnOFv7jZkkzm9mprTk/GZieUP S7k1eFMaWZowaH72zXjrVgSz04VPUbIw/zrY/sIV69U/AicKSmx6eK3hSM+8xJQzO25wXa 13jpHZg6KnCf0o7XWeEh5YGrBVUJoKM= X-MC-Unique: LSEM45LkMWuh4VggqH1s5w-1 From: Laszlo Ersek To: qemu-devel@nongnu.org, lersek@redhat.com Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org Subject: [PATCH v2] hw/i386/pc: fix code comment on cumulative flash size Date: Tue, 12 Sep 2023 17:55:53 +0200 Message-Id: <20230912155553.82514-1-lersek@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=170.10.133.124; envelope-from=lersek@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1694534219335100001 Content-Type: text/plain; charset="utf-8" - The comment is incorrectly indented / formatted. - The comment states a 8MB limit, even though the code enforces a 16MB limit. Both of these warts come from commit 0657c657eb37 ("hw/i386/pc: add max combined fw size as machine configuration option", 2020-12-09); clean them up. Arguably, it's also better to be consistent with the binary units (such as "MiB") that QEMU uses nowadays. Cc: "Michael S. Tsirkin" (supporter:PC) Cc: Marcel Apfelbaum (supporter:PC) Cc: Paolo Bonzini (maintainer:X86 TCG CPUs) Cc: Richard Henderson (maintainer:X86 TCG CP= Us) Cc: Eduardo Habkost (maintainer:X86 TCG CPUs) Cc: qemu-trivial@nongnu.org Fixes: 0657c657eb37 Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- Notes: v2: =20 - use the binary units MiB, KiB, GiB comprehensively in the comment hw/i386/pc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 54838c0c411d..0b642e8af590 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1746,12 +1746,12 @@ static void pc_machine_set_max_fw_size(Object *obj,= Visitor *v, } =20 /* - * We don't have a theoretically justifiable exact lower bound on the b= ase - * address of any flash mapping. In practice, the IO-APIC MMIO range is - * [0xFEE00000..0xFEE01000] -- see IO_APIC_DEFAULT_ADDRESS --, leaving = free - * only 18MB-4KB below 4G. For now, restrict the cumulative mapping to = 8MB in - * size. - */ + * We don't have a theoretically justifiable exact lower bound on the = base + * address of any flash mapping. In practice, the IO-APIC MMIO range is + * [0xFEE00000..0xFEE01000] -- see IO_APIC_DEFAULT_ADDRESS --, leaving= free + * only 18MiB-4KiB below 4GiB. For now, restrict the cumulative mappin= g to + * 16MiB in size. + */ if (value > 16 * MiB) { error_setg(errp, "User specified max allowed firmware size %" PRIu64 " i= s "