linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Robert Richter <robert.richter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Cc: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Robert Richter <rric-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Catalin Marinas <catalin.marinas-5wv7dgnIgG8@public.gmane.org>,
	David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	Hanjun Guo <hanjun.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] arm64: mm: Fix memmap to be initialized for the entire section
Date: Sun, 20 Nov 2016 17:07:44 +0000	[thread overview]
Message-ID: <CAKv+Gu-2uGJGovqQL-gbB54u=fQ9L9YUbDdRo6u3oWqF6znn6Q@mail.gmail.com> (raw)
In-Reply-To: <20161117151805.GJ2151-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>

On 17 November 2016 at 15:18, Robert Richter <robert.richter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org> wrote:
> Thanks for your answer.
>
> On 17.11.16 14:25:29, Will Deacon wrote:
>> On Wed, Nov 09, 2016 at 08:51:32PM +0100, Robert Richter wrote:
>> > Thus, I don't see where my patch breaks code. Even acpi_os_ioremap()
>> > keeps the same behaviour as before since it still uses memblock_is_
>> > memory(). Could you more describe your concerns why do you think this
>> > patch breaks the kernel and moves the problem somewhere else? I
>> > believe it fixes the problem at all.
>>
>> acpi_os_ioremap always ends up in __ioremap_caller, regardless of
>> memblock_is_memory(). __ioremap_caller then fails if pfn_valid is true.
>
> But that's the reason my patch changed the code to use memblock_is_
> map_memory() instead. I was looking into the users of pfn_valid() esp.
> in arm64 code and changed it where required.
>
> This week I looked into the kernel again for code that might break by
> a pfn_valid() change. I found try_ram_remap() in memremap.c that has
> changed behaviour now, but this is explicit for MEMREMAP_WB, so it
> should be fine.
>
> Maybe it might be better to use page_is_ram() in addition to
> pfn_valid() where necessary. This should work now after commit:
>
>  e7cd190385d1 arm64: mark reserved memblock regions explicitly in iomem
>
> I still think pfn_valid() is not the correct use to determine the mem
> attributes for mappings, there are further checks required.
>
> The risk of breaking something with my patch is small and limited only
> to the mapping of efi reserved regions (which is the state of 4.4). If
> something breaks anyway it can easily be fixed by adding more checks
> to pfn_valid() as suggested above.
>

As I noted before, it looks to me like setting CONFIG_HOLES_IN_ZONE is
the correct way to address this. However, doing that does uncover a
bug in move_freepages() where the VM_BUG_ON_PAGE() dereferences struct
page fields before the pfn_valid_within() check, so it seems those
need to be switched around.

Robert, you mentioned that CONFIG_HOLES_IN_ZONE seems inappropriate
for sparsemem. Care to elaborate why?

  parent reply	other threads:[~2016-11-20 17:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  9:52 [PATCH] arm64: mm: Fix memmap to be initialized for the entire section Robert Richter
2016-10-10 15:33 ` David Daney
     [not found] ` <1475747527-32387-1-git-send-email-rrichter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2016-10-06 10:00   ` Ard Biesheuvel
     [not found]     ` <CAKv+Gu-oYzSn_eeqaX3QVFeQjBGkaX-Wh7+oPcQFcXv7J6GOFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-06 16:11       ` Robert Richter
     [not found]         ` <20161006161114.GH22012-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-10-17 18:58           ` Robert Richter
     [not found]             ` <20161017185801.GT25086-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-10-27 16:01               ` Will Deacon
     [not found]                 ` <20161027160136.GD24290-5wv7dgnIgG8@public.gmane.org>
2016-10-28  9:19                   ` Robert Richter
2016-11-07 21:05                     ` Will Deacon
2016-11-09 19:51                       ` Robert Richter
     [not found]                         ` <20161109195132.GZ22012-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-17 14:25                           ` Will Deacon
2016-11-17 15:18                             ` Robert Richter
     [not found]                               ` <20161117151805.GJ2151-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-20 17:07                                 ` Ard Biesheuvel [this message]
2016-11-23 21:15                                   ` Robert Richter
     [not found]                                     ` <20161123211538.GH10776-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-23 21:25                                       ` Ard Biesheuvel
2016-11-24 13:42                                         ` Robert Richter
     [not found]                                           ` <20161124134238.GI10776-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-24 13:44                                             ` Ard Biesheuvel
2016-11-24 13:51                                               ` Robert Richter
     [not found]                                                 ` <20161124135151.GJ10776-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-24 13:58                                                   ` Ard Biesheuvel
2016-11-24 14:11                                                     ` Robert Richter
2016-11-24 14:23                                                       ` Ard Biesheuvel
2016-11-24 15:09                                                         ` Robert Richter
     [not found]                                                           ` <20161124150918.GF2213-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-24 19:26                                                             ` Robert Richter
2016-11-24 19:42                                                               ` Ard Biesheuvel
     [not found]                                                                 ` <CAKv+Gu_C_17RtAiw2U0OOzVik3G7KkwUTo5eiGK-HDo-maQ-bA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-25 11:29                                                                   ` Robert Richter
     [not found]                                                                     ` <20161125112914.GI2213-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2016-11-25 12:28                                                                       ` Ard Biesheuvel
2016-11-25 17:01                                                                         ` Ard Biesheuvel
2016-10-18 10:18           ` Mark Rutland
2016-10-18 15:02             ` Robert Richter
2016-11-01 16:55   ` Robert Richter

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='CAKv+Gu-2uGJGovqQL-gbB54u=fQ9L9YUbDdRo6u3oWqF6znn6Q@mail.gmail.com' \
    --to=ard.biesheuvel-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=hanjun.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robert.richter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=rric-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    /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).