linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kyle@redhat.com (Kyle McMartin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] aarch64: always map VDSO at worst case alignment
Date: Thu, 16 Jan 2014 12:53:18 -0500	[thread overview]
Message-ID: <20140116175318.GK18705@redacted.bos.redhat.com> (raw)
In-Reply-To: <20140116174344.GJ30257@mudshark.cambridge.arm.com>

On Thu, Jan 16, 2014 at 05:43:44PM +0000, Will Deacon wrote:
> > +		struct vm_unmapped_area_info info =
> > +			{
> > +				.flags = 0,
> > +				.length = vdso_mapping_len,
> > +				.low_limit = mm->mmap_base,
> > +				.high_limit = TASK_SIZE,
> > +				.align_mask = (1 << 16) - 1,
> > +			};
> > +		vdso_base = vm_unmapped_area(&info);
> > +	}
> 
> I don't like this fix. The kernel is perfectly alright mapping the vdso at
> the actual page size, as opposed to the maximum. Since the vdso isn't
> demand-paged, we can actually just tell the linker not to bother forcing 64k
> (worst case) alignment for PT_LOAD segments. Please can you try the patch
> below?
> 

Me either, tbh. ;-)

I was testing out using -Wl,-z,max-page-size for the
!CONFIG_ARM64_64K_PAGES case, and that seemed to work. A quick compile
check shows the segment alignment being 0x10 with -Wl,-n:

kmcmarti ~/linux $ eu-readelf -l
arch/arm64/kernel/vdso/vdso.so
Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz
MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000 0x000700
0x000700 R E 0x10

so I think that should work nicely!

I'll reboot a machine with this fix to test it as soon as possible.

Acked-by: Kyle McMartin <kyle@redhat.com>

> --- a/arch/arm64/kernel/vdso/Makefile
> +++ b/arch/arm64/kernel/vdso/Makefile
> @@ -48,7 +48,7 @@ $(obj-vdso): %.o: %.S
>  
>  # Actual build commands
>  quiet_cmd_vdsold = VDSOL $@
> -      cmd_vdsold = $(CC) $(c_flags) -Wl,-T $^ -o $@
> +      cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@
>  quiet_cmd_vdsoas = VDSOA $@
>        cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
>  

  reply	other threads:[~2014-01-16 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 21:41 [PATCH] aarch64: always map VDSO at worst case alignment Kyle McMartin
2014-01-16 17:43 ` Will Deacon
2014-01-16 17:53   ` Kyle McMartin [this message]
2014-01-16 19:28     ` Kyle McMartin
2014-01-16 19:32       ` Will Deacon

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=20140116175318.GK18705@redacted.bos.redhat.com \
    --to=kyle@redhat.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 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).