Skip to contentSkip to conversation

omapfb: don't annotate dss_conv_list as __initdata

PATCH In review Arnd Bergmann 2 participants 3 messages May 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omapfb: don't annotate dss_conv_list as __initdata

With the kcsan changes, __read_once_size() is not inlined, but clang can decide to emit a version that hardcodes the address, which in turn triggers a warning for dss_conv_list being __initdata but __read_once_size() not being __init:

WARNING: modpost: vmlinux.o(.text+0x6e4d7a): Section mismatch in reference from the function __read_once_size() to the variable .init.data:dss_conv_list
The function __read_once_size() references
the variable __initdata dss_conv_list.
This is often because __read_once_size lacks a __initdata annotation or the annotation of dss_conv_list is wrong.

This is clearly a false positive warning, but it's hard to tell who is to blame for it. Work around it by removing the __initdata annotation, wasting the space of two pointers in return for getting rid of the warning.

Fixes dfd402a4c4ba ("kcsan: Add Kernel Concurrency Sanitizer infrastructure")
---
 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +1 -1
index 0ae0cab252d3..29fdff9c95f6 100644
@@ -19,7 +19,7 @@
 #include <linux/slab.h>
 #include <linux/list.h>
 
-static struct list_head dss_conv_list __initdata;
+static struct list_head dss_conv_list;
 
 static const char prefix[] __initconst = "omapdss,";
 
Signature · 1 line
2.26.0
#1 lore raw
Quoted 14 lines · Arnd Bergmann

With the kcsan changes, __read_once_size() is not inlined, but clang can decide to emit a version that hardcodes the address, which in turn triggers a warning for dss_conv_list being __initdata but __read_once_size() not being __init:

WARNING: modpost: vmlinux.o(.text+0x6e4d7a): Section mismatch in reference from the function __read_once_size() to the variable .init.data:dss_conv_list
The function __read_once_size() references
the variable __initdata dss_conv_list.
This is often because __read_once_size lacks a __initdata annotation or the annotation of dss_conv_list is wrong.

Quoted 7 lines

This is clearly a false positive warning, but it's hard to tell who is to blame for it. Work around it by removing the __initdata annotation, wasting the space of two pointers in return for getting rid of the warning.

Fixes dfd402a4c4ba ("kcsan: Add Kernel Concurrency Sanitizer infrastructure")

[+Cc Will]

I think Will is working on a series that completely overhauls READ_ONCE/WRITE_ONCE, also getting rid of __read_once_size() in the process, which would make this patch redundant. If we can live with this warning until the new READ_ONCE/WRITE_ONCE gets merged, we can probably keep things as-is for now.

Thanks,
-- Marco

Quoted 20 lines
---
 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +1 -2
index 0ae0cab252d3..29fdff9c95f6 100644
@@ -19,7 +19,7 @@
 #include <linux/slab.h>
 #include <linux/list.h>
 
-static struct list_head dss_conv_list __initdata;
+static struct list_head dss_conv_list;
 
 static const char prefix[] __initconst = "omapdss,";
 
--

2.26.0

#2 lore raw
Quoted 22 lines · Marco Elver' via Clang Built Linux
Quoted 13 lines · Arnd Bergmann

With the kcsan changes, __read_once_size() is not inlined, but clang can decide to emit a version that hardcodes the address, which in turn triggers a warning for dss_conv_list being __initdata but __read_once_size() not being __init:

WARNING: modpost: vmlinux.o(.text+0x6e4d7a): Section mismatch in reference from the function __read_once_size() to the variable .init.data:dss_conv_list
The function __read_once_size() references
the variable __initdata dss_conv_list.
This is often because __read_once_size lacks a __initdata annotation or the annotation of dss_conv_list is wrong.

Quoted 7 lines

This is clearly a false positive warning, but it's hard to tell who is to blame for it. Work around it by removing the __initdata annotation, wasting the space of two pointers in return for getting rid of the warning.

Fixes dfd402a4c4ba ("kcsan: Add Kernel Concurrency Sanitizer infrastructure")
Quoted 7 lines

[+Cc Will]

I think Will is working on a series that completely overhauls READ_ONCE/WRITE_ONCE, also getting rid of __read_once_size() in the process, which would make this patch redundant. If we can live with this warning until the new READ_ONCE/WRITE_ONCE gets merged, we can probably keep things as-is for now.

Ok, let's drop this one for now.

Arnd