All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC 0/2] followup change for READ_ONCE/WRITE_ONCE
@ 2015-03-25 13:15 Christian Borntraeger
  2015-03-25 13:15 ` [PATCH 1/2] s390/ebdic: disable gcov on ebcdic.o Christian Borntraeger
  2015-03-25 13:15 ` [PATCH 2/2] compiler.h: Fix word size check for READ/WRITE_ONCE Christian Borntraeger
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2015-03-25 13:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, torvalds, paulmck, linux-s390, Russell King,
	Christian Borntraeger

Turns out that my last rework for the word size check broke it:

I originally had the size > wordsize check in __read_once_size/
/__write_once_size as empty extern function in a newly created file
lib/access.c and marked it with a  __compiletime_warning.

Unfortunately this broke arm rpcdefconfig due to this line
CFLAGS_font.o := -Dstatic=
in
arch/arm/boot/compressed/Makefile.
This define made it impossible for the compiler to get rid of
the unused __write_once_size and __read_once_size and the linker
complained about the missing data_access_exceeds_word_size
as the compressed boot thing did not include lib/access.o.

So I wanted to be clever and changed data_access_exceeds_word_size
to a static inline function. Turns out that this actually disabled
the compiletime warning.

Next try, have it as a weak function. This actually does enable
the warning. It will create an empty data_access_exceeds_word_size
function in each object file, though and it will trigger a warning
for arm rpcdefconfig:
  CC      arch/arm/boot/compressed/font.o
include/linux/compiler.h: In function '__write_once_size':
include/linux/compiler.h:231: warning: call to 'data_access_exceeds_word_size' declared with attribute warning: data access exceeds word size and won't be atomic
include/linux/compiler.h: In function '__read_once_size':
include/linux/compiler.h:214: warning: call to 'data_access_exceeds_word_size' declared with attribute warning: data access exceeds word size and won't be atomic

In addition this also causes a compiler error on s390 allyesconfig
with GCOV enabled. (fixed in patch 1).

Christian Borntraeger (2):
  s390/ebdic: disable gcov on ebcdic.o
  compiler.h: Fix word size check for READ/WRITE_ONCE

 arch/s390/kernel/Makefile | 4 ++++
 include/linux/compiler.h  | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] s390/ebdic: disable gcov on ebcdic.o
  2015-03-25 13:15 [PATCH/RFC 0/2] followup change for READ_ONCE/WRITE_ONCE Christian Borntraeger
@ 2015-03-25 13:15 ` Christian Borntraeger
  2015-03-25 13:15 ` [PATCH 2/2] compiler.h: Fix word size check for READ/WRITE_ONCE Christian Borntraeger
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Borntraeger @ 2015-03-25 13:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, torvalds, paulmck, linux-s390, Russell King,
	Christian Borntraeger

ebcdic.o is also used for the compressed kernel image. The decompressor
has no gcov support, so better do not add any gcov related functions.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/kernel/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 31fab26..89352da 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -8,6 +8,10 @@ CFLAGS_REMOVE_early.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
 endif
 
+# ebcdic.o is also used in arch/s390/boot/compressed/ with does not
+# have gcov support
+GCOV_PROFILE_ebcdic.o = n
+
 #
 # Passing null pointers is ok for smp code, since we access the lowcore here.
 #
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] compiler.h: Fix word size check for READ/WRITE_ONCE
  2015-03-25 13:15 [PATCH/RFC 0/2] followup change for READ_ONCE/WRITE_ONCE Christian Borntraeger
  2015-03-25 13:15 ` [PATCH 1/2] s390/ebdic: disable gcov on ebcdic.o Christian Borntraeger
@ 2015-03-25 13:15 ` Christian Borntraeger
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Borntraeger @ 2015-03-25 13:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, torvalds, paulmck, linux-s390, Russell King,
	Christian Borntraeger

Turns out that my last rework for the word size check broke it:

I originally had the size > wordsize check in __read_once_size/
/__write_once_size as empty extern function in a newly created file
lib/access.c and marked it with a  __compiletime_warning.

Unfortunately this broke arm rpcdefconfig due to this line
CFLAGS_font.o := -Dstatic=
in
arch/arm/boot/compressed/Makefile.
This define made it impossible for the compiler to get rid of
the unused __write_once_size and __read_once_size and the linker
complained about the missing data_access_exceeds_word_size
as the compressed boot thing did not include lib/access.o.

So I wanted to be clever and changed data_access_exceeds_word_size
to a static inline function. Turns out that this actually disabled
the compiletime warning.

Next try, have it as a weak function. This actually does enable
the warning. It will create an empty data_access_exceeds_word_size
function in each object file, though and it will trigger a warning
for arm rpcdefconfig:
  CC      arch/arm/boot/compressed/font.o
include/linux/compiler.h: In function '__write_once_size':
include/linux/compiler.h:231: warning: call to 'data_access_exceeds_word_size' declared with attribute warning: data access exceeds word size and won't be atomic
include/linux/compiler.h: In function '__read_once_size':
include/linux/compiler.h:214: warning: call to 'data_access_exceeds_word_size' declared with attribute warning: data access exceeds word size and won't be atomic

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 include/linux/compiler.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 1b45e4a..37943c4 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -192,13 +192,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
 
 #include <uapi/linux/types.h>
 
-static __always_inline void data_access_exceeds_word_size(void)
 #ifdef __compiletime_warning
 __compiletime_warning("data access exceeds word size and won't be atomic")
 #endif
-;
-
-static __always_inline void data_access_exceeds_word_size(void)
+__weak notrace void data_access_exceeds_word_size(void)
 {
 }
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-25 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 13:15 [PATCH/RFC 0/2] followup change for READ_ONCE/WRITE_ONCE Christian Borntraeger
2015-03-25 13:15 ` [PATCH 1/2] s390/ebdic: disable gcov on ebcdic.o Christian Borntraeger
2015-03-25 13:15 ` [PATCH 2/2] compiler.h: Fix word size check for READ/WRITE_ONCE Christian Borntraeger

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.