From: Mike Rapoport <rppt@linux.ibm.com>
To: Steve Wahl <steve.wahl@hpe.com>
Cc: Baoquan He <bhe@redhat.com>, David Hildenbrand <david@redhat.com>,
mgorman@suse.de, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, akpm@linux-foundation.org, cai@lca.pw,
mhocko@kernel.org
Subject: Re: [PATCH] mm/compaction: Fix the incorrect hole in fast_isolate_freepages()
Date: Mon, 1 Jun 2020 14:42:46 +0300 [thread overview]
Message-ID: <20200601114246.GC8502@linux.ibm.com> (raw)
In-Reply-To: <20200528151510.GA6154@raspberrypi>
On Thu, May 28, 2020 at 10:15:10AM -0500, Steve Wahl wrote:
> On Thu, May 28, 2020 at 05:07:31PM +0800, Baoquan He wrote:
> > On 05/26/20 at 01:49pm, David Hildenbrand wrote:
> > > On 26.05.20 13:32, Mike Rapoport wrote:
> > > > Hello Baoquan,
> > > >
> > > > I do not object to your original fix with careful check for pfn validity.
> > > >
> > > > But I still think that the memory reserved by the firmware is still
> > > > memory and it should be added to memblock.memory. This way the memory
> > >
> > > If it's really memory that could be read/written, I think I agree.
> >
> > I would say some of them may not be allowed to be read/written, if I
> > understand it correctly. I roughly went through the x86 init code, there
> > are some places where mem region is marked as E820_TYPE_RESERVED so that
> > they are not touched after initialization. E.g:
> >
> > 1) pfn 0
> > In trim_bios_range(), we set the pfn 0 as E820_TYPE_RESERVED. You can
> > see the code comment, this is a BIOS owned area, but not kernel RAM.
> >
> > 2)GART reserved region
> > In early_gart_iommu_check(), GART IOMMU firmware will reserve a region
> > in an area, firmware designer won't map system RAM into that area.
> >
> > And also intel_graphics_stolen(), arch_rmrr_sanity_check(), these
> > regions are not system RAM backed area, reading from or writting into
> > these area may cause error.
> >
> > Futhermore, there's a KASLR bug found by HPE, its triggering and root
> > cause are written into below commit log. You can see that accessing to
> > firmware reserved region caused BIOS to halt system when cpu doing
> > speculative.
> >
> > commit 2aa85f246c181b1fa89f27e8e20c5636426be624
> > Author: Steve Wahl <steve.wahl@hpe.com>
> > Date: Tue Sep 24 16:03:55 2019 -0500
> >
> > x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area
> >
> > 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.
>
> Thank you for CC'ing me. Coming into the middle of the conversation,
> I am trying to understand the implications of what's being discussed
> here, but not being very successful at it.
>
> For the HPE UV hardware, the addresses listed in the reserved range
> must never be accessed, or (as we discovered) even be reachable by an
> active page table entry. Any active page table entry covering the
> region allows the processor to issue speculative accesses to the
> region, resulting in the BIOS halt mentioned.
>
> I'm not sure if the discussion above about adding the region to
> memblock.memory would result in an active mapping of the region or
> not. If it did, we'd have problems.
The discussion is whether regions marked as E820_RESERVED should be
considered as RAM or not.
For the hardware that cannot tolerate acceses to these areas like HPE
UV, it should not :)
I still think that keeping them only in memblock.reserved creates more
problems than it solves, but simply adding E820_RESERVED areas to
memblock.memory just won't work.
I'll try to come up with something better Really Soon (c).
> Thanks,
>
> Steve Wahl, HPE
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2020-06-01 11:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 1:44 [PATCH] mm/compaction: Fix the incorrect hole in fast_isolate_freepages() Baoquan He
2020-05-21 9:26 ` Mike Rapoport
2020-05-21 15:52 ` Baoquan He
2020-05-21 17:18 ` Mike Rapoport
2020-05-22 7:01 ` Baoquan He
2020-05-22 7:25 ` Baoquan He
2020-05-22 14:20 ` Mike Rapoport
2020-05-26 8:45 ` Baoquan He
2020-05-26 8:55 ` David Hildenbrand
2020-05-26 11:32 ` Mike Rapoport
2020-05-26 11:49 ` David Hildenbrand
2020-05-28 9:07 ` Baoquan He
2020-05-28 9:08 ` David Hildenbrand
2020-05-28 15:15 ` Steve Wahl
2020-06-01 11:42 ` Mike Rapoport [this message]
2020-06-01 13:31 ` Baoquan He
2020-05-21 9:36 ` Mel Gorman
2020-05-21 13:38 ` Mike Rapoport
2020-05-21 15:41 ` Baoquan He
2020-05-28 8:59 [PATCH] mm/compaction: Fix the incorrect hole in fast_isolate_freepages() ^[ Baoquan He
2020-05-28 9:08 ` Baoquan He
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=20200601114246.GC8502@linux.ibm.com \
--to=rppt@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=cai@lca.pw \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=steve.wahl@hpe.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;
as well as URLs for NNTP newsgroup(s).