Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1maCFy-0007Vn-R0 for mharc-grub-devel@gnu.org; Tue, 12 Oct 2021 03:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maCFs-0007MO-Io for grub-devel@gnu.org; Tue, 12 Oct 2021 03:31:20 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:37692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maCFm-0006qq-Qr for grub-devel@gnu.org; Tue, 12 Oct 2021 03:31:19 -0400 Received: by mail-pj1-x1030.google.com with SMTP id lk8-20020a17090b33c800b001a0a284fcc2so1252656pjb.2 for ; Tue, 12 Oct 2021 00:31:14 -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=/+M9wDP8fVoaay/BGNLLJ0QUEfX82hgUmBuhKjhp3Mw=; b=LuCIY5LmYmr/BiA9/aMmURFWZU8upzmWDi3TkA9O9GOG/90Sb1W6txTqfog6kRPC06 TpP+kmdmpq/elfaB8z2VpIL+MZJApkVBoinnp01izvk/DfcdUyivQKSXlivumEgmBE5u NVYI+pp3qT58thrH6dOKTawwQsOOJxA4z2KK8= 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=/+M9wDP8fVoaay/BGNLLJ0QUEfX82hgUmBuhKjhp3Mw=; b=Guw4tau6oYnnBlSTTmpw7zLVM6FnP+tvjPHlZ6SQ95sZEkos+H+7QZ6QQRIoNMz0C4 jE+cVPKYmudigo8Czm9gSx87kl8/og/vmilxc1rjrj8J0zzrGEvTstfsa1q6ErGwG5hJ sSdUrIxTTbFxRcObY0hIl6cY7TVlvEUZPcw28CSeoy8tXNSECKpIH5+XxwbBM0elwmvn OKnyAuIoCTdf2KLg+Fx/JX9Emr6V2ixSX+QzxUdQNGM3ZI+w+y29hn7xYXr+YUbiwNQD sAtAiqih1oqb5PriyGpP5Ala4Qy2dAfH1tlw3XfUbx8AYDzWHyi2UgLfz2jNI5vluKgr G8Tg== X-Gm-Message-State: AOAM530/5oo0X9BuPJxqXXnKZF57RasRXiiqz13AXIf27rBLnoQ0jBso vP6lCT0w0k9kcFsJdLFf7SLZdYfUCYK/5g== X-Google-Smtp-Source: ABdhPJyoYJJEo2ZLoFL0G/4FDuV1ft4inPBzq1DrbuhfqqmDBW9eCc67B0BZdc/2I78/edRwdKwM9w== X-Received: by 2002:a17:90a:9291:: with SMTP id n17mr4188326pjo.243.1634023873459; Tue, 12 Oct 2021 00:31:13 -0700 (PDT) Received: from localhost ([2001:4479:e300:600:41fe:d15:934f:4029]) by smtp.gmail.com with ESMTPSA id d24sm9816336pfn.62.2021.10.12.00.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 00:31:13 -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 15/19] ieee1275: drop len -= 1 quirk in heap_init Date: Tue, 12 Oct 2021 18:30:04 +1100 Message-Id: <20211012073008.4059133-16-dja@axtens.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012073008.4059133-1-dja@axtens.net> References: <20211012073008.4059133-1-dja@axtens.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=dja@axtens.net; helo=mail-pj1-x1030.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2021 07:31:21 -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 46b1aee732d3..bf2cd200893d 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.30.2