From nobody Sun Sep 28 16:30:40 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1756569086; cv=none; d=zohomail.com; s=zohoarc; b=TNlq9yvGFiavM3cidUVXSrph1GZQuvulYul/2Zxu0n4rZw49rZF1cNlry7MuV2fAFnegVY9aT3tlh506B1C25q5RaKVtp44cjMiOVw2BjJpm192TT6Lia7S5rW3EnFqm6CtdMAw8tHq8fpJxQjW23EL7EABTMh0Q7I53zfTXdgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756569086; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cfsc9amcqQ41jjeMgTPw5ExWTEFHK6iHXDnIIT3wi2Y=; b=GT2nsH86VFFp9JLaKa/YU/rohHWTOcnbykkuDfPD+AqZ2Bx9J+B4Uv2y10HcyJ4+jCsIfAZ09vrkXYHteuXp555tdsISXGjV7Fitg/ZkY/D/7N7+PaokgmF3Pph0l/eeitmV1JYa5B1GLpA004/RUA+sXgr+FItd/lveL8xlg9s= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1756569086000405.8130210242815; Sat, 30 Aug 2025 08:51:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1usNH5-0008S1-W7; Sat, 30 Aug 2025 11:13:52 -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 1uryhq-0000te-1g for qemu-devel@nongnu.org; Fri, 29 Aug 2025 08:59:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uryhn-000833-GV for qemu-devel@nongnu.org; Fri, 29 Aug 2025 08:59:49 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-363-Ef3cfSASPjCGhJfrmUbviw-1; Fri, 29 Aug 2025 08:59:44 -0400 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-45a1b05d8d0so14850825e9.1 for ; Fri, 29 Aug 2025 05:59:44 -0700 (PDT) Received: from [192.168.10.48] ([151.95.56.250]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6ee66bddsm118704745e9.0.2025.08.29.05.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 05:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756472386; 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: in-reply-to:in-reply-to:references:references; bh=cfsc9amcqQ41jjeMgTPw5ExWTEFHK6iHXDnIIT3wi2Y=; b=JZEYXSL4bO6thcqnYeAZ9GZXZfaYDC4Wyc+NDs1zheFmwAUCDct5k4M50W2T8LBowiMBmC pCTTG22GGuXYF0XCHsQcXTxddWui5qsS1qQbKi+j/laVkK6+braD43+bmyyMphFEJngdnW Mc/CAe74QawK6JhEjT4lRWzXOSKVLR0= X-MC-Unique: Ef3cfSASPjCGhJfrmUbviw-1 X-Mimecast-MFC-AGG-ID: Ef3cfSASPjCGhJfrmUbviw_1756472384 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756472383; x=1757077183; 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=cfsc9amcqQ41jjeMgTPw5ExWTEFHK6iHXDnIIT3wi2Y=; b=nWNvkLM7OxmLR8rdrwZnZQz7j+Y/dNFjyfZdiyNvmQx5Cpor4XY6BagU5gpUhnivsk JE8cp+BOzO8cnMKn5EmTawhPiXGXIUAHc5xVAaYwaiO/N5YTszMIM2rDy3Ctkulm0NG+ 4c1kECy2BZelVY+EViOof6hu6NLTCjc1LTnXnMHtiBMz0E1zJ47Otud9pPEM28G+lrf/ 4P90nGLM4nVBgx9sseX6qBFtAvV7fuqLavM8ZPU+hOCaESEGPKJ/Yb92Q0Ygy0pjuN7k uIYnCXbVwmQI1Qh2s6WcSsFSsvC54G1A1owwN0o0uGMgJ6BSSFZRAuk3PvfpYez4MqRR whEw== X-Gm-Message-State: AOJu0YzF+kFziiP3yemYx0helxzEa/kEbJtT0LOJCPyRjdVmff5H4zPf 6OWEYOR87scSsckvhvlyAXO6eHB9mxZJHxRak2HqA3PQS/XtLimERBeKTON6UxUM7XnT+zE8qgW H1CAtM4qFbsib1e5KGXBGFFySfWC9LQjuUzL8tNZPYwMg5DJIy3BHbq7YY6rVW7D0yF2hTEYXkW EjxUaahPzDGCr3PLew8JxTCfYrO1JRey4XkGTZIfCb X-Gm-Gg: ASbGncsH410MuYe0P6fD1xmv4QHZogeAR+LFww5QtGxODKWkxlvJNY8wY7IBmSiP/5Z iuzHpnkqKsAaRbgS8l9zCT6b6DpFTvqNZ6SQ4DyDU87FP41OFX7Sv/dVEPuo5n70rSz9eTyNg2A PMkNnL5+K44Y5Rc6aceqscJqvoB5xsDa8GyZBGCQAPkMJLbs8rkFxLXAezkmHo4Nhlro7RVrCFB dMTp1hm7lZSxjIRNVQJ7gg9ZJMt1/8ohULS+Xxwb40TURjvk0aVJfUCbzenWnBeZF232txDrFpn Wg1jOxgHS5vjB0gqXvikK4vQLbZ9NjdbylK39hhUExwqOU4tjEvGgJ4KEMXeZLwidXEQMzuJcXw Tk4Gvt2usWngH7S9ZZ/JOznrmFtNxlDCqSGCapWZ50jQ= X-Received: by 2002:a05:600c:4747:b0:45b:627a:60cf with SMTP id 5b1f17b1804b1-45b627a62cbmr175327855e9.24.1756472382818; Fri, 29 Aug 2025 05:59:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFykXfgNICbjEkfJnBPpkOxPSDr+eYSMsQ5lhRO6hW02Rnm+jpRgIW7gYoCOPp+nlFXtotyHQ== X-Received: by 2002:a05:600c:4747:b0:45b:627a:60cf with SMTP id 5b1f17b1804b1-45b627a62cbmr175327455e9.24.1756472382244; Fri, 29 Aug 2025 05:59:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 02/28] hw/i386/pc_piix.c: restrict isapc machine to 3.5G memory Date: Fri, 29 Aug 2025 14:59:09 +0200 Message-ID: <20250829125935.1526984-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250829125935.1526984-1-pbonzini@redhat.com> References: <20250829125935.1526984-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1756569087170116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Since the isapc machine is now limited to using 32-bit CPUs, add a hard res= triction so that the machine cannot be started with more than 3.5G memory. This matc= hes the default value for max_ram_below_4g if not specified and provides consistent behaviour betweem TCG and KVM accelerators. Signed-off-by: Mark Cave-Ayland Link: https://lore.kernel.org/r/20250828111057.468712-3-mark.caveayland@nut= anix.com Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 8f5fb3cf90b..9a3b5d88f08 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -461,6 +461,12 @@ static void pc_init_isa(MachineState *machine) warn_report("-cpu host is invalid for isapc machine, using pentium= 3"); } =20 + if (machine->ram_size > 3.5 * GiB) { + error_report("Too much memory for this machine: %" PRId64 " MiB, " + "maximum 3584 MiB", machine->ram_size / MiB); + exit(1); + } + pc_init1(machine, NULL); } #endif --=20 2.51.0