lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150515154540.GA12500@x>
Date:	Fri, 15 May 2015 08:45:42 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Align jump targets to 1 byte boundaries

On Mon, Sep 17, 2001 at 07:00:00AM +0000, Ingo Molnar wrote:
> * Denys Vlasenko <dvlasenk@...hat.com> wrote:
> > > What do you guys think about this? I think we should seriously 
> > > consider relaxing our alignment defaults.
> > 
> > Looks like nobody objected. I think it's ok to submit
> > this patch for real.
> 
> Yeah, so my plan is to apply the following three changes from that 
> discussion:
> 
> --- tip.orig/arch/x86/Makefile
> +++ tip/arch/x86/Makefile
>  <at>  <at>  -77,6 +77,15  <at>  <at>  else
>          KBUILD_AFLAGS += -m64
>          KBUILD_CFLAGS += -m64
> 
> +        # Pack jump targets tightly, don't align them to the default 16 bytes:
> +        KBUILD_CFLAGS += -falign-jumps=1
> +
> +        # Pack functions tightly as well:
> +        KBUILD_CFLAGS += -falign-functions=1
> +
> +        # Pack loops tightly as well:
> +        KBUILD_CFLAGS += -falign-loops=1
> +
>          # Don't autogenerate traditional x87 instructions
>          KBUILD_CFLAGS += $(call cc-option,-mno-80387)
>          KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387)

It looks like the patch you applied to the tip tree only included one of
these (-falign-junmps=1), not the other two.

Also, you've only applied these to 64-bit; could you please apply them
to both 32-bit and 64-bit, since many embedded systems aiming for small
code size use 32-bit?  (Unless 32-bit already defaults to these.)

Have you considered including -falign-labels=1 as well?  Does that make
a difference on top of the other three.

Finally, it looks like -Os already implies all four of those, as well
as a few others, so unfortunately the code size benefits don't actually
apply to the tiniest kernels, which already effectively incorporate this
change.  Oh well.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ