From: james.morse@arm.com (James Morse)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/3] arm64: vmlinux.ld: Add .mmuoff.{text, data} sections
Date: Mon, 22 Aug 2016 14:15:48 +0100 [thread overview]
Message-ID: <57BAFB04.2000906@arm.com> (raw)
In-Reply-To: <CAKv+Gu8X22ghgvez5tTfwrm8PDzsB6xatHDs6S5_BM4YWaKgmQ@mail.gmail.com>
Hi Ard,
On 18/08/16 12:55, Ard Biesheuvel wrote:
> Actually, it is not even necessary to align the end of .mmuoff.data,
> as long as the next section starts at at 2 KB aligned boundary (which
> is guaranteed for .bss since it covers page aligned data, although it
> would make sense to make that explicit) I.e., something like
>
> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index 659963d40bb4..70aa77060729 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -185,10 +185,18 @@ SECTIONS
> _data = .;
> _sdata = .;
> RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
> +
> + .mmuoff.read : ALIGN(SZ_2K) {
> + *(.mmuoff.read)
> + }
> + .mmuoff.write : ALIGN(SZ_2K) {
> + *(.mmuoff.write)
> + }
> +
> PECOFF_EDATA_PADDING
> _edata = .;
>
> - BSS_SECTION(0, 0, 0)
> + BSS_SECTION(SZ_2K, SZ_2K, 0)
>
> . = ALIGN(PAGE_SIZE);
> idmap_pg_dir = .;
>
> AFAICT, this should allow you to drop the alignments in the code. This
> is also more future proof, since you can simply emit variables into
> these sections anywhere, whereas the explicit .align directive aligns
> that particular variable, which could lead to more waste of space.
Thanks! This looks a lot better.
I think the 2K alignment is only needed for the mmuoff.write section as it
invalidates cache lines. I don't see a problem with the mmuoff.read section's
CWG overlapping with the BSS or other data as the cache maintenance is
clean+invalidate.
Thanks,
James
next prev parent reply other threads:[~2016-08-22 13:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 17:11 [PATCH v4 0/3] arm64: hibernate: Support DEBUG_PAGEALLOC James Morse
2016-08-15 17:12 ` [PATCH v4 1/3] arm64: Create sections.h James Morse
2016-08-15 17:12 ` [PATCH v4 2/3] arm64: vmlinux.ld: Add .mmuoff.{text,data} sections James Morse
2016-08-17 17:50 ` [PATCH v4 2/3] arm64: vmlinux.ld: Add .mmuoff.{text, data} sections Ard Biesheuvel
2016-08-18 11:39 ` James Morse
2016-08-18 11:55 ` Ard Biesheuvel
2016-08-22 13:15 ` James Morse [this message]
2016-08-15 17:12 ` [PATCH v4 3/3] arm64: hibernate: Support DEBUG_PAGEALLOC James Morse
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=57BAFB04.2000906@arm.com \
--to=james.morse@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.