From nobody Sat Dec 21 14:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1683897320; cv=none; d=zohomail.com; s=zohoarc; b=E5zaeC1Zi+DPuZBs+5AcUHO1lRlg4jRwSlJlPA1iDPKobC/D+TreYHaj2diJP51VVLiXyHaIJNSTP4F7h/woOyT0JTwtgwom0mZXSadJwCblP08aqPLWAxDTsa71nVeY8Wk53hzPPcLbbgcOKXa/VaV5pavVXm92E3lgUs09YDk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683897320; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Subject:To; bh=/cXssEL7uPW3TzW14HTNlSYB9tMRLE2v21VqOyjcV7o=; b=R2BYchgucsWPYNQz88ngdPXVQ/CGR8kL512218zdDXTe0Xa+f2RIzo/P1aEb4LWysw+5Xxf2OAwJ7vsm2Ld7LLnxBjlg90mm7uMTfooEWpPowFwczgc2WLIjpHqx6sqgxRu1hTQUgM67GUQlKt8Imetl6GOGy48rOZYrA5oD35M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1683897320393614.328933494294; Fri, 12 May 2023 06:15:20 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 5BB9722546; Fri, 12 May 2023 13:15:15 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 2A143202F6 for ; Fri, 12 May 2023 13:15:02 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Fri, 12 May 2023 06:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1683897316; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:list-id:list-owner:list-unsubscribe:list-subscribe:list-post; bh=/cXssEL7uPW3TzW14HTNlSYB9tMRLE2v21VqOyjcV7o=; b=P7BZkT8d7FfFjdIVIiQCBRKpF3/NspN6iWqqFzIQpUdl54HMz8ih2wYn2E+T2yVPOK321N gpg9cd2IF/Q2looQgzMeBzgH8pjm/U9C+wVJRkzz822CMwHV6GWSgmTp/1f6b2uXbBOMb2 PflmBE8UXQgE42NOAO19ZqJBKjWOsGE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683897300; x=1686489300; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OdLue3E3OhZu3fDZU6N/uhv144HMfZtpJsFHQ679Il0=; b=CPf7RBQ8JmSYIIIOWwxTmFdAr4Uf0c715Itm4N3E+6b/qawBKV2vG8NLHmHShtaQxL vG1zMqHMJEH8Q28k8RwuYI2wOKQUMohm9EMF9tTBBo2tC0B6iWoQQd4BZHhlh+Jl8jh1 To9sRxHeKqEKlevp9+2Bw8ua4XLNEDUbeMlBZ8u5kSqa1M4ydGqAiehwuerVfocF4Bqx epVfAe+EX4HA6zxV1LSqv1Vz6WZ9P2ThY4NW2rnrm+a8kCwrWu5VgxyfLcbqEJpxVHvC WYGmpJ4gXgak7Mk+XBpiXV1ALS6iCsLxHFGsgUF88yNNgaFuo6SSIVNsv5uMvWgbqYy8 jvMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683897300; x=1686489300; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OdLue3E3OhZu3fDZU6N/uhv144HMfZtpJsFHQ679Il0=; b=BBOzOlpA7BnyzEJOtZtSezZwYRCz6FjZW+5ZyjwXzvKkq4ej6o2+bSNu0ldGLCDqMA Im+FtD+oEFQZ+ltPsNpkw81/zJdxJhZ1Zl8Eqne1Y/D1/yPR8cXcfDHLuJESNajk5iV3 p9DRkmvijmI2HLEwtF3ivSixxt7vWZGwfPUJacbzBXSJbjfGU80wwY1e/wA7XvKg57Mc Qgb3gJppL4cN7j4eKzq7GfdBT8hBLT4RQ6nX4WkwlbTrA8JwM+hG1JsxNmplqJ47Oosr PQRu/7xZxo8E5aLpR2OUc99av88m64rwFurUJH/Vli/pFJdM/2THlpEDURsISFBel0+D 9W6g== X-Gm-Message-State: AC+VfDz/jtQgNCA15kVpZeJIKS1qgTwLyD9u71TkutRUcRdEVaGEQ0j5 8bxNavbvhW1wnUv4XsGZhwjTa5U6Lc7bMYqY0/txODwRTHuWjSipDTcDEg== X-Google-Smtp-Source: ACHHUZ579e0SaaExtU4AmZs3QCswKl40iIuwADxqJTa5fZJOatlLNs7VoH2ACDQyV33Vk7cQXWM0Sh/6GX2D/bp5tZU= X-Received: by 2002:a05:622a:1984:b0:3ef:4319:c6c5 with SMTP id u4-20020a05622a198400b003ef4319c6c5mr194502qtc.19.1683897300450; Fri, 12 May 2023 06:15:00 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 12 May 2023 14:14:47 +0100 Message-ID: To: seabios@seabios.org Message-ID-Hash: 5KYY7CEZO3JCOD6GZ4QUVXQ7I3JLWPJ3 X-Message-ID-Hash: 5KYY7CEZO3JCOD6GZ4QUVXQ7I3JLWPJ3 X-MailFrom: xose@google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH] Fix high memory zone initialization in CSM mode List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Jos=C3=A9_Mart=C3=ADnez_via_SeaBIOS?= Reply-To: =?UTF-8?B?Sm9zw6kgTWFydMOtbmV6?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: pass (identity @seabios.org) X-ZM-MESSAGEID: 1683897321941100001 malloc_high() cannot allocate any memory in CSM mode due to an empty ZoneHigh. SeaBIOS cannot find any disk to boot from because device initialization fails. The bug was introduced in 1.16.1 (commit dc88f9b) when the meaning of BUILD_MAX_HIGHTABLE changed but CSM code was not updated. This patch reverts to the previous behavior by using BUILD_MIN_HIGHTABLE in CSM methods. Signed-off-by: Jos=C3=A9 Mart=C3=ADnez --- src/fw/csm.c | 4 ++-- src/malloc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fw/csm.c b/src/fw/csm.c index bc14a92..579debd 100644 --- a/src/fw/csm.c +++ b/src/fw/csm.c @@ -150,9 +150,9 @@ handle_csm_0002(struct bregs *regs) for (i=3D0; i < csm_compat_table.E820Length / sizeof(struct e820entry)= ; i++) e820_add(p[i].start, p[i].size, p[i].type); - if (csm_init_table->HiPmmMemorySizeInBytes > BUILD_MAX_HIGHTABLE) { + if (csm_init_table->HiPmmMemorySizeInBytes > BUILD_MIN_HIGHTABLE) { u32 hi_pmm_end =3D csm_init_table->HiPmmMemory + csm_init_table->HiPmmMemorySizeInBytes; - e820_add(hi_pmm_end - BUILD_MAX_HIGHTABLE, BUILD_MAX_HIGHTABLE, E820_RESERVED); + e820_add(hi_pmm_end - BUILD_MIN_HIGHTABLE, BUILD_MIN_HIGHTABLE, E820_RESERVED); } // For PCIBIOS 1ab10e diff --git a/src/malloc.c b/src/malloc.c index da84098..30b2c92 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -460,10 +460,10 @@ malloc_csm_preinit(u32 low_pmm, u32 low_pmm_size, u32 hi_pmm, u32 hi_pmm_size) { ASSERT32FLAT(); - if (hi_pmm_size > BUILD_MAX_HIGHTABLE) { + if (hi_pmm_size > BUILD_MIN_HIGHTABLE) { u32 hi_pmm_end =3D hi_pmm + hi_pmm_size; - alloc_add(&ZoneTmpHigh, hi_pmm, hi_pmm_end - BUILD_MAX_HIGHTABLE); - alloc_add(&ZoneHigh, hi_pmm_end - BUILD_MAX_HIGHTABLE, hi_pmm_end); + alloc_add(&ZoneTmpHigh, hi_pmm, hi_pmm_end - BUILD_MIN_HIGHTABLE); + alloc_add(&ZoneHigh, hi_pmm_end - BUILD_MIN_HIGHTABLE, hi_pmm_end); } else { alloc_add(&ZoneTmpHigh, hi_pmm, hi_pmm + hi_pmm_size); } -- 2.40.1.606.ga4b1b128d6-goog _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org