Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nhPJm-00069y-FP for mharc-grub-devel@gnu.org; Thu, 21 Apr 2022 01:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhPJh-00066a-DQ for grub-devel@gnu.org; Thu, 21 Apr 2022 01:25:22 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:42997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhPJf-0005iy-PK for grub-devel@gnu.org; Thu, 21 Apr 2022 01:25:21 -0400 Received: by mail-pj1-x102f.google.com with SMTP id z6-20020a17090a398600b001cb9fca3210so4140679pjb.1 for ; Wed, 20 Apr 2022 22:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SsxWB1k6UtlGZG55+fmeoTUrrB+yWpNbCcr6HEoZUho=; b=WNDbF9b2RBYp92qRPfd6AwOE2YtaXsp7AdQlgV7sGYxp+LGb+luYpTGEJJvDy5Iiin ZochxsmcWK8vrXPTYuIk7bT+zbDgfDzaomkfJBiMzGmVxXVOZJnsh2HLn0293AaL75U8 1GExIdTz4+6AWGU1nBZ04U+vB3JbZryVZWbS4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SsxWB1k6UtlGZG55+fmeoTUrrB+yWpNbCcr6HEoZUho=; b=4uhgYSTZUHGvR7znebjzA67aQLDWBcM6/xV1/aSF0X5heprpVj/g39/22iRmCMDlHa CNmAcrvJQfsuFDgNMV5EAYqQER61aSXuaqSfRFEGTZW/mGEGGRZHrJnbDh/COsZaCsck KRS50qYRG49M8cT8C9W4CIRIqijNRf7Lz1fR1QcxAUaWiJjpxvsJ5pksCVC/2WFfnb22 Ln1z1Kn05m1StRsYphkfvxqXQUZujJItl6+Y2l0Zm+ycufFnKdhwM7oyj9bk09czyDuI 7DGa+KRwOAZZnWjZdTgdjA84SkDiAFnTm8ncxLxrdyaQmEpu+o31DpkjPS4k0ENeaszW S5Ig== X-Gm-Message-State: AOAM531ZOTFu8U1jPlmZ/T0gbdb6tfBX6280ZzPb24veEpAebDJuVFrj pj+izktc6gR2z5O1T8Ixywpu5NjaNGuBhA== X-Google-Smtp-Source: ABdhPJyPz+VgkinOEba3lahyqthtdvLmc2g38wYwkLe37jpwqStJ5vs3MwYhNy0KOe10owsZk8kaxA== X-Received: by 2002:a17:902:7c17:b0:158:f6ef:497e with SMTP id x23-20020a1709027c1700b00158f6ef497emr20095651pll.134.1650518718336; Wed, 20 Apr 2022 22:25:18 -0700 (PDT) Received: from localhost ([2001:4479:e000:e400:4260:be14:52a8:8c94]) by smtp.gmail.com with ESMTPSA id r13-20020a635d0d000000b003aa482388dbsm6442679pgb.9.2022.04.20.22.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 22:25:18 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org Cc: leif@nuviainc.com, stefanb@linux.ibm.com, ps@pks.im, dkiper@net-space.pl, Daniel Axtens Subject: [PATCH v3 12/15] ieee1275: drop len -= 1 quirk in heap_init Date: Thu, 21 Apr 2022 15:24:24 +1000 Message-Id: <20220421052427.1389987-13-dja@axtens.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220421052427.1389987-1-dja@axtens.net> References: <20220421052427.1389987-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=dja@axtens.net; helo=mail-pj1-x102f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 05:25:22 -0000 This was apparently 'required by some firmware': commit dc9468500919 ("2007-02-12 Hollis Blanchard "). It's not clear what firmware that was, and what platform from 14 years ago which exhibited the bug then is still both in use and buggy now. It doesn't cause issues on qemu (mac99 or pseries) or under PFW for Power8. I don't have access to old Mac hardware, but if anyone feels especially strongly we can put it under some feature flag. I really want to disable it under pseries because it will mess with region merging. Signed-off-by: Daniel Axtens --- grub-core/kern/ieee1275/init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c index cf4bcf2cfbf5..60a49301ba8f 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -166,7 +166,6 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, addr = 0x180000; } } - len -= 1; /* Required for some firmware. */ /* Never exceed HEAP_MAX_SIZE */ if (*total + len > HEAP_MAX_SIZE) -- 2.32.0