RE: adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed)

2022-01-23 Thread Chan Kim
I found adding the same #pragma directives warp to #include makes the compiler error go away! #pragma GCC push_options #pragma GCC optimize ("O0") #include #pragma GCC pop_option Chan From: Chan Kim Sent: Sunday, January 23, 2022 8:23 PM To: kernelnewbies@kernelnewbies.org

adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed)

2022-01-23 Thread Chan Kim
Hello all, In linux 5.4.21, when tell the compiler to use no optimzation for function early_fixmap_init as below, (I need to compile with O0 to follow what's happening here using gdb.) #pragma GCC push_options #pragma GCC optimze ("O0") void __init early_fixmap_init(void) { ... } #pragma

how to fix section mismatch warning after inserting #pragma GCC optimize ?

2022-01-23 Thread Chan Kim
Hello all, In linux 5.4.21 source code, I put #pragma GCC push_options #pragma GCC optimize ("O0") and #pragma GCC pop_options around function static int __init gic_init_bases in file drivers/irqchip/irq-gic-v3.c. When I build it, I get this warning message (section

Re: ioctl number change / backwards compatibility doubt

2022-01-23 Thread Greg KH
On Sun, Jan 23, 2022 at 08:55:30PM +1300, Paulo Miguel Almeida wrote: > > > 1: Given the driver's history and ioctl number conflit, is the backwards > > > compatibility something to be kept or not to be taken into consideration > > > as ioctl numbering rules weren't followed? > > > > Try to find

Re: how to fix section mismatch warning after inserting #pragma GCC optimize ?

2022-01-23 Thread Greg KH
On Sun, Jan 23, 2022 at 07:48:01PM +0900, Chan Kim wrote: > Hello all, > > > > In linux 5.4.21 source code, I put > > #pragma GCC push_options > > #pragma GCC optimize ("O0") Do not do that. Bad things will happen, the kernel really does not like this at all. Why do you want to

RE: how to fix section mismatch warning after inserting #pragma GCC optimize ?

2022-01-23 Thread Chan Kim
I found adding __init to gic_smp_init() removed this warning message. Is it ok to move this function to .init.text ? (doesn't it cause it to be removed after initialization?) Chan From: Chan Kim Sent: Sunday, January 23, 2022 7:48 PM To: kernelnewbies@kernelnewbies.org Subject: how to fix

RE: adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed)

2022-01-23 Thread Chan Kim
Hi, As I sent already the error message shows the discrepancy starts from include/linux/cache.h, So I added the same #pragma thing around that #include and the compile error is gone. This is only for debugging a boot failure in a qemu machine (which is for a real fpga board), so I can follow

Re: adding GCC optimze O0 to early_fixmap_init causes compiler error (BUILD_BUG failed)

2022-01-23 Thread jim . cromie
On Sun, Jan 23, 2022 at 4:23 AM Chan Kim wrote: > > Hello all, > > In linux 5.4.21, when tell the compiler to use no optimzation for function > early_fixmap_init as below, > > (I need to compile with O0 to follow what’s happening here using gdb.) > > #pragma GCC push_options > > #pragma GCC

Re: ioctl number change / backwards compatibility doubt

2022-01-23 Thread Paulo Miguel Almeida
On Sun, Jan 23, 2022 at 12:04:48PM +0100, Greg KH wrote: > On Sun, Jan 23, 2022 at 08:55:30PM +1300, Paulo Miguel Almeida wrote: > > > > I googled a fair bit of time and I'm 99% confident that there isn't such > > userspace/lib tool so I guess this will have done the hard way :( > > If there is

Re: ioctl number change / backwards compatibility doubt

2022-01-23 Thread Greg KH
On Mon, Jan 24, 2022 at 05:49:06PM +1300, Paulo Miguel Almeida wrote: > On Sun, Jan 23, 2022 at 12:04:48PM +0100, Greg KH wrote: > > On Sun, Jan 23, 2022 at 08:55:30PM +1300, Paulo Miguel Almeida wrote: > > > > > > I googled a fair bit of time and I'm 99% confident that there isn't such > > >