Messages in this thread Patch in this message | | | Date | Mon, 28 Jun 2004 16:57:07 -0700 | From | Andrew Morton <> | Subject | Re: __setup()'s not processed in bk-current |
| |
Ricky Beam <jfbeam@bluetronic.net> wrote: > > Do I smell some bad pointer math? Yeap: > DEBUG: sizeof(obs_kernel_param): 24 (0x18) > > obsolete_checksetup(): line: ro > obsolete_checksetup(): checking: nosmp(5) @ ffffffff80593510 > obsolete_checksetup(): checking: <NULL>(1) @ ffffffff80593528 > > p++ moved the pointer sizeof(obs_kernel_param) ahead, but that's 8 bytes > short.
Thanks for working that out. It's been handing around for ages.
We're now putting 24-byte structures into .init.setup via __setup. But x86_64's compiler is emitting a `.align 16' in there, so they end up on 32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong.
Fix that up by forcing the compiler to align these structures to sizeof(long).
---
25-akpm/include/linux/init.h | 1 + 1 files changed, 1 insertion(+)
diff -puN include/linux/init.h~x86_64-setup-section-alignment-fix include/linux/init.h --- 25/include/linux/init.h~x86_64-setup-section-alignment-fix 2004-06-28 16:47:41.000000000 -0700 +++ 25-akpm/include/linux/init.h 2004-06-28 16:47:41.000000000 -0700 @@ -119,6 +119,7 @@ struct obs_kernel_param { static struct obs_kernel_param __setup_##unique_id \ __attribute_used__ \ __attribute__((__section__(".init.setup"))) \ + __attribute__((aligned((sizeof(long))))) \ = { __setup_str_##unique_id, fn, early } #define __setup_null_param(str, unique_id) \ _
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |