linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: mark kernel text segment as MEMBLOCK_NOMAP
Date: Mon, 15 Feb 2016 12:56:42 +0100	[thread overview]
Message-ID: <CAKv+Gu9OYMO=Sh-OO21YjCBPCfu0hJHZbfA78__RDpdXMhw1xw@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu-Y-k_LAbFZJjiPuHq6ssaFCb3WMG_fVGx3ODrvb+hEUQ@mail.gmail.com>

On 15 February 2016 at 12:53, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 15 February 2016 at 12:45, Catalin Marinas <catalin.marinas@arm.com> wrote:
>> On Mon, Feb 15, 2016 at 10:28:32AM +0100, Ard Biesheuvel wrote:
>>> Commit 752af28bd711 ("arm64: move kernel image to base of vmalloc area")
>>> moves the mapping of the kernel text and data segments out of the linear
>>> region, and takes care not to create a writable alias of the read-only
>>> kernel text segment by checking each memblock against overlap when the
>>> memblocks are mapped into the linear mapping.
>>>
>>> However, it is more correct, and much simpler, to mark the [_stext, _etext]
>>> interval as MEMBLOCK_NOMAP. This will also prevent the interval from being
>>> omitted from the linear region, but this fact will now also be reflected
>>> in the output of pfn_valid(), and so code that expects any pfn_valid()
>>> page to be mapped and accessible (which is a reasonable assumption) does
>>> not get surprised by the text segment being inaccessible via the linear
>>> mapping.
>>>
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> ---
>>>
>>> This should hopefully address the issue reported by James, but I suppose
>>> more work is required on the hibernate side to ensure the unmapped text
>>> region is preserved, since it is no longer covered by the linear mapping.
>>
>> Ard, I'm about to drop the kernel memory map patches from -next. There
>> are several issues like KASAN (which may as well be a KASAN bug but I
>> haven't got to the bottom of it yet), initrd (you have patches but
>> require additional acks).
>>
>> I'll keep your stuff on the for-next/kernmap branch and do further
>> debugging. If it stabilises in the next 1-2 weeks, I'll merge it into
>> for-next/core for 4.6, otherwise, it will have to wait. I would really
>> like these patches merged but it looks like they need wider testing.
>>
>
> Agreed.
>
>> I have another branch with your kaslr patches but I didn't dare to merge
>> them into for-next/core until we sort out the first sub-series.
>>
>
> Yes, I noticed. As I pointed out in its cover letter, I expected the
> first subseries to be the most problematic in terms of fallout in
> other areas, and I turned out to be right, unfortunately. The coverage
> so far has been quite useful tbh, especially since I apparently never
> tested initrd.
>
> If you are going to drop it for now anyway, I can do a v6sub1 with
> this issue and the initrd issue addressed, but also an issue with the
> KVM ksym ref patch with GCC 4.8.

Note that this is a transient issue that is gone after applying the
subsequent patch, but it would still be nice to get rid of it if we're
going to do another take anyway.

> Since these issues affect
> bisectability, I'd prefer to rebase entirely, and fold all the fixes
> rather than apply them on top.

  reply	other threads:[~2016-02-15 11:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  9:28 [PATCH] arm64: mark kernel text segment as MEMBLOCK_NOMAP Ard Biesheuvel
2016-02-15 11:45 ` Catalin Marinas
2016-02-15 11:53   ` Ard Biesheuvel
2016-02-15 11:56     ` Ard Biesheuvel [this message]
2016-02-15 12:08     ` Catalin Marinas
2016-02-15 17:17       ` Ard Biesheuvel
2016-02-15 17:35         ` Catalin Marinas
2016-02-16  8:49       ` Ard Biesheuvel
2016-02-16 10:57         ` Catalin Marinas
2016-02-16 10:50 ` James Morse
2016-02-16 10:57   ` Ard Biesheuvel
2016-02-16 11:13     ` James Morse
2016-02-16 12:11       ` Ard Biesheuvel

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+Gu9OYMO=Sh-OO21YjCBPCfu0hJHZbfA78__RDpdXMhw1xw@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).