From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Steve Wahl <steve.wahl@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Juergen Gross <jgross@suse.com>,
Brijesh Singh <brijesh.singh@amd.com>,
Jordan Borgner <mail@jordan-borgner.de>,
Feng Tang <feng.tang@intel.com>,
linux-kernel@vger.kernel.org,
Zhenzhong Duan <zhenzhong.duan@oracle.com>,
Dave Hansen <dave.hansen@intel.com>, Baoquan He <bhe@redhat.com>,
russ.anderson@hpe.com, dimitri.sivanich@hpe.com,
mike.travis@hpe.com
Subject: Re: [PATCH v3 1/2] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area.
Date: Thu, 26 Sep 2019 13:23:01 +0300 [thread overview]
Message-ID: <20190926102301.u6fn4b7l7aevnlbq@box> (raw)
In-Reply-To: <9c011ee51b081534a7a15065b1681d200298b530.1569358539.git.steve.wahl@hpe.com>
On Tue, Sep 24, 2019 at 04:03:55PM -0500, Steve Wahl wrote:
> Our hardware (UV aka Superdome Flex) has address ranges marked
> reserved by the BIOS. Access to these ranges is caught as an error,
> causing the BIOS to halt the system.
>
> Initial page tables mapped a large range of physical addresses that
> were not checked against the list of BIOS reserved addresses, and
> sometimes included reserved addresses in part of the mapped range.
> Including the reserved range in the map allowed processor speculative
> accesses to the reserved range, triggering a BIOS halt.
>
> Used early in booting, the page table level2_kernel_pgt addresses 1
> GiB divided into 2 MiB pages, and it was set up to linearly map a full
> 1 GiB of physical addresses that included the physical address range
> of the kernel image, as chosen by KASLR. But this also included a
> large range of unused addresses on either side of the kernel image.
> And unlike the kernel image's physical address range, this extra
> mapped space was not checked against the BIOS tables of usable RAM
> addresses. So there were times when the addresses chosen by KASLR
> would result in processor accessible mappings of BIOS reserved
> physical addresses.
>
> The kernel code did not directly access any of this extra mapped
> space, but having it mapped allowed the processor to issue speculative
> accesses into reserved memory, causing system halts.
>
> This was encountered somewhat rarely on a normal system boot, and much
> more often when starting the crash kernel if "crashkernel=512M,high"
> was specified on the command line (this heavily restricts the physical
> address of the crash kernel, in our case usually within 1 GiB of
> reserved space).
>
> The solution is to invalidate the pages of this table outside the
> kernel image's space before the page table is activated. This patch
> has been validated to fix this problem on our hardware.
>
> Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
> Cc: stable@vger.kernel.org
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
--
Kirill A. Shutemov
next prev parent reply other threads:[~2019-09-26 10:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 21:03 [PATCH v3 0/2] x86/boot/64: Avoid mapping reserved ranges in early page tables Steve Wahl
2019-09-24 21:03 ` [PATCH v3 1/2] x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area Steve Wahl
2019-09-26 10:23 ` Kirill A. Shutemov [this message]
2019-10-11 16:02 ` Dave Hansen
2019-10-11 18:27 ` [tip: x86/urgent] " tip-bot2 for Steve Wahl
2019-10-11 18:27 ` tip-bot2 for Steve Wahl
2019-09-24 21:04 ` [PATCH v3 2/2] x86/boot/64: round memory hole size up to next PMD page Steve Wahl
2019-09-26 10:23 ` Kirill A. Shutemov
2019-10-11 18:27 ` [tip: x86/urgent] x86/boot/64: Round " tip-bot2 for Steve Wahl
2019-10-11 18:27 ` tip-bot2 for Steve Wahl
2019-10-10 19:27 ` [PATCH v3 0/2] x86/boot/64: Avoid mapping reserved ranges in early page tables Steve Wahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190926102301.u6fn4b7l7aevnlbq@box \
--to=kirill@shutemov.name \
--cc=bhe@redhat.com \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=dave.hansen@intel.com \
--cc=dimitri.sivanich@hpe.com \
--cc=feng.tang@intel.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@jordan-borgner.de \
--cc=mike.travis@hpe.com \
--cc=mingo@redhat.com \
--cc=russ.anderson@hpe.com \
--cc=steve.wahl@hpe.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=zhenzhong.duan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®