From patchwork Tue Sep 12 15:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 13381898 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EDD51CA0EF4 for ; Tue, 12 Sep 2023 15:49:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qg5d6-0002qN-FZ; Tue, 12 Sep 2023 11:48:44 -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 1qg5d4-0002pz-R2 for qemu-devel@nongnu.org; Tue, 12 Sep 2023 11:48:42 -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 1qg5d1-0005Zz-Fx for qemu-devel@nongnu.org; Tue, 12 Sep 2023 11:48:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694533717; 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=3IGldxBfH68CFg9FGKJW4m9ne/VJK2zzCID5ax8z9+w=; b=dFQwDOiZL330mpMSKeRpFy0pdoNiGVAptKieadPdyxtXjh0LSgE8iYeXwRVcJs0b7Wyc7d jwvP5x9iv64yGomU1KsJ6ZfHLI3003BCPVnP1/R2sHxWGDe1JD2NJnQE/r04PDYX8ylUt+ lLqr2CH1jP0WPtWymHzkZYBiWDlvd60= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-AOge-AF8OB-sOD3SXR_Fiw-1; Tue, 12 Sep 2023 11:48:32 -0400 X-MC-Unique: AOge-AF8OB-sOD3SXR_Fiw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 A30893822565; Tue, 12 Sep 2023 15:48:28 +0000 (UTC) Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.193.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5777364671; Tue, 12 Sep 2023 15:48:27 +0000 (UTC) From: Laszlo Ersek To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , qemu-trivial@nongnu.org Subject: [PATCH] hw/i386/pc: fix code comment on cumulative flash size Date: Tue, 12 Sep 2023 17:48:25 +0200 Message-Id: <20230912154825.81568-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org - 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 "MiB" unit 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 CPUs) Cc: Eduardo Habkost (maintainer:X86 TCG CPUs) Cc: qemu-trivial@nongnu.org Fixes: 0657c657eb37 Signed-off-by: Laszlo Ersek --- 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..d06b8da49cae 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, } /* - * 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 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 18MB-4KB below 4G. For now, restrict the cumulative mapping to 16MiB + * in size. + */ if (value > 16 * MiB) { error_setg(errp, "User specified max allowed firmware size %" PRIu64 " is "