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]
Date:	Wed, 5 Jan 2011 15:02:26 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	mahatma@...by
Cc:	Dzianis Kahanovich <mahatma@...u.unibel.by>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fix miscompiling with GCC 4.5 -finline-functions

On Tue, 04 Jan 2011 17:17:11 +0200
Dzianis Kahanovich <mahatma@...u.unibel.by> wrote:

> Fixing broken automatic inlining for GCC 4.5+  (breaks build with
> -finline-functions or -O3 on x86_*).
> 

Please always quote the compiler output when addressing build errors
and warnings.

> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -569,7 +569,7 @@ static inline void ept_sync_individual_a
>  	}
>  }
> 
> -static unsigned long vmcs_readl(unsigned long field)
> +static noinline unsigned long vmcs_readl(unsigned long field)
>  {
>  	unsigned long value = 0;
> 
> --- a/drivers/media/radio/radio-aimslab.c
> +++ b/drivers/media/radio/radio-aimslab.c
> @@ -71,7 +71,7 @@ static struct rtrack rtrack_card;
> 
>  /* local things */
> 
> -static void sleep_delay(long n)
> +static noinline void sleep_delay(long n)
>  {
>  	/* Sleep nicely for 'n' uS */
>  	int d = n / msecs_to_jiffies(1000);

A golden rule is that when a programmer reads some code, he should be
able to understand why it's there.  There is no way on this little
earth that a programmer will be able to look at this code and say
"ah-hah, that must be a workaround for gcc-4.5 -finline-functions!".

We fix that problem this way:

--- a/arch/x86/kvm/vmx.c~fix-miscompiling-with-gcc-45-finline-functions-fix
+++ a/arch/x86/kvm/vmx.c
@@ -569,6 +569,7 @@ static inline void ept_sync_individual_a
 	}
 }
 
+/* noinline works around gcc-4.5+ build error with -finline-functions */
 static noinline unsigned long vmcs_readl(unsigned long field)
 {
 	unsigned long value = 0;
--- a/drivers/media/radio/radio-aimslab.c~fix-miscompiling-with-gcc-45-finline-functions-fix
+++ a/drivers/media/radio/radio-aimslab.c
@@ -71,6 +71,7 @@ static struct rtrack rtrack_card;
 
 /* local things */
 
+/* noinline works around gcc-4.5+ build error with -finline-functions */
 static noinline void sleep_delay(long n)
 {
 	/* Sleep nicely for 'n' uS */
_

--
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