Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3260339pxj; Tue, 1 Jun 2021 00:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxGu3MQK4+4tJYkrd/B7LU54sKfA2HnQDU2Io+HMWo+ZJTsdtrnstFVdMXxyyiza6rioKN X-Received: by 2002:a92:d4c8:: with SMTP id o8mr21519509ilm.116.1622534105909; Tue, 01 Jun 2021 00:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622534105; cv=none; d=google.com; s=arc-20160816; b=H/7JV7v9q9jJOiUoyuNaxtaoJAEskWNWVio7GMGQIlFvE3JsVOFyjfT3ybqLN719Dh yZIKu5abRjPTrRZe3Tu1UxRDICmJlgBFaVcjjGasR07wnUXNGE9LZSfVhe1I2yBrvKGZ u9X+waa8NNs3eZzK/O2kLhiFbRV+dcdtDKi+VqqrkYl8MhUWvAv28/JKJ3k9OnD0Sizw 51i7fdU0AnpnD5hoDl7Va5yGognTKqbZUAdpuXz0xN5GtjkjNTHoSi16ojpbw1iEn0Xo PIWuC76n3sdfCrMvKl0sA19eamq2qMv7hzJDWW5egUL9uzGwAgU1Dpnfqfb7n4X2sG65 hq1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UxjBXVOcNpsOSsZ2NCWYlbObOi/2xlZ/U+4sGfkwUgQ=; b=MQsNJ8+j0A9hKsLXCa1ZawKg6VBIBINB/7vHYtOE6Stp2bRB1FeTlSR79CihYOgled VxaMmurzy9Y7eahGsOqT11ioovKzIwtnXN/nwcIfQ4B9ZLq5Gkbgjh5CO2F5C9b5K19c im/6k8Yl8Fpt39FjsKOmksR3EIpbc+zsCw1K4mOpqHfDy4RgHYttdWpYPHRdTEpfupNj 1xyTJOhF9Xt4gIxTIqzSSwFbFxrspBvy+Y54SCQtdxrzqVwxMjLLeaMCcrJFW5qiTKY7 5zQBvYAOTA9kKx8pi9nYjbJMD+RzhMLMf2HzLCp9FOC+u4F9orzzT2xLVKtY9HXHzYtn HHVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vJX11Qfl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si19393789jac.31.2021.06.01.00.54.52; Tue, 01 Jun 2021 00:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vJX11Qfl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233204AbhFAHzr (ORCPT + 99 others); Tue, 1 Jun 2021 03:55:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:34476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbhFAHzq (ORCPT ); Tue, 1 Jun 2021 03:55:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E64BA6136E; Tue, 1 Jun 2021 07:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622534045; bh=+XAvuzMHMQcxwCnCNesqCmyb6X8V5ARJjsdHoon7pEE=; h=From:To:Cc:Subject:Date:From; b=vJX11QflGfehoVWetTIWOPft3Zql/d8Esr52RiXgnDt0LX43QF/OsR5I82cUSTyFr hHd8Ku5eS7qpq+nBWjBNkbpRHmqWK8B4a6pfW0cxdNWNRQtdKvnXT1M+Yfk1Ly4uXC 4X+1t/UdvkbuXhBkBNjaWMctWMW1QZ6SxAgM0I8k40p6yGftCxnD6UD2dCYGj71uHJ /apes1WW4DGlpisAA4jHON6e/zx4+RiUFImA+3CzS3zy4If+EdAEkRdjpueLJrcNP0 WhjYFC7TkmcF9WMeAljymC4rUZIvueGhD/CwHd6aMJ9gZD04v67b91yeVKOST+sWMA CGcb7cxAoOv+A== From: Mike Rapoport To: x86@kernel.org Cc: "H. Peter Anvin" , Andy Lutomirski , Andy Shevchenko , Ard Biesheuvel , Baoquan He , Borislav Petkov , Darren Hart , Dave Young , Hugh Dickins , Ingo Molnar , Jonathan Corbet , Lianbo Jiang , Mike Rapoport , Mike Rapoport , Randy Dunlap , Thomas Gleixner , linux-doc@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH 0/3] x86/setup: always resrve the first 1M of RAM Date: Tue, 1 Jun 2021 10:53:51 +0300 Message-Id: <20210601075354.5149-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport Hi, Commit a799c2bd29d1 ("x86/setup: Consolidate early memory reservations") changed the way early memory reservations are made and caused a regression for users that set CONFIG_X86_RESERVE_LOW to 640K in their kernel configuration [1] because there was no room for the real mode trampoline. My initial suggestion was to reduce the limit of CONFIG_X86_RESERVE_LOW from 640K to 512K [2], but in the end it seems simpler to always reserve the first 1M of RAM after the real mode trampoline is allocated. The first patch in the series contains the rework of early memory reservations so that first 64K will be reserved very early before memblock allocations are possible and the remaining memory under 1M would be reserved after the real mode trampoline is allocated. This patch also update freeing of EFI boot services so that memory under 1M will remain reserved which is also required for crash kernel [3]. The second and the third patches are cleanups that remove pieces that are not longer required after the first patch is applied. Randy, Hugh, I'd appreciate if you give this a whirl on your old Sandy Bridge laptops as it changes again the way trim_snb_memory() works. [1] https://bugzilla.kernel.org/show_bug.cgi?id=213177 [2] https://lore.kernel.org/lkml/20210526081100.12239-1-rppt@kernel.org [3] https://lore.kernel.org/lkml/20210531090023.16471-1-lijiang@redhat.com/#r Mike Rapoport (3): x86/setup: always reserve the first 1M of RAM x86/setup: remove CONFIG_X86_RESERVE_LOW and reservelow options x86/crash: remove crash_reserve_low_1M() .../admin-guide/kernel-parameters.txt | 5 -- arch/x86/Kconfig | 29 --------- arch/x86/include/asm/crash.h | 6 -- arch/x86/kernel/crash.c | 13 ---- arch/x86/kernel/setup.c | 59 +++++++------------ arch/x86/platform/efi/quirks.c | 12 ++++ arch/x86/realmode/init.c | 14 +++-- 7 files changed, 41 insertions(+), 97 deletions(-) base-commit: c4681547bcce777daf576925a966ffa824edd09d -- 2.28.0