Re: [PATCH] PowerPC64 symbols start with '.'

2007-05-16 Thread Sam Ravnborg
On Wed, May 16, 2007 at 01:59:53PM +1000, Stephen Rothwell wrote:
> Hi Sam,
> 
> On Tue, 15 May 2007 22:39:35 +0200 Sam Ravnborg <[EMAIL PROTECTED]> wrote:
> >
> > On Fri, May 11, 2007 at 03:45:01PM +1000, Stephen Rothwell wrote:
> > > which we want to skip during modpost processing.  We need this to make
> > > some of the whitelisting work.
> >
> > I have a popwerpc64 crosscompiler and would like to reproduce
> > this bug.
> > What config shall I use to try it out.
> 
> I use allmodconfig, but that doesn't really build at the moment, so I
> have attached a config that should build (with a recent Linus tree).
> 
> > Can you please supply the exact warning message too.
> 
> WARNING: mm/built-in.o - Section mismatch: reference to 
> .init.text:.__alloc_bootmem_node from .text between '.sparse_index_alloc' (at 
> offset 0x27df0) and '.__section_nr'
> 
> The '.sparse_index_alloc' doesn't match "sparse_index_alloc" in pat4sym
> due to the '.' at the beginning.  I have seen another one as well, but
> cannot reproduce it at the moment.

I'm reluctant to apply this patch for two reasons.
1) I cannot reproduce it
2) The cases that this patch would repair are most likely
   better addressed by the upcoming __init_refok marker.

ad 1) I think the alloc_bootmem warning was fixed by
correcting the __init / __initdata markes so it got
fixed in the rigt way and not by whitelisting.

I had a bunch or warnings like this:
WARNING: arch/ppc/platforms/built-in.o(.data+0x18): Section mismatch: reference 
to .init.text:Powerplus_Map_Non0 (between 'mot_info' and 'Mesquite_pci_IRQ_map')
This is mot_info that should be marked __initdata - shall I post a patch?

And one warning like this:
WARNING: arch/ppc/mm/built-in.o(.text+0x1000): Section mismatch: reference to 
.init.text:early_get_page (between 'pte_alloc_one_kernel' and 'hash_page_sync')

The latter is a __init_Refok candidate.
The logic make sure we call early_get_page only if we are in init mode.

I also saw a number of:
WARNING: "next_slot" [arch/ppc/mm/built-in] is COMMON symbol

I can see where modpost post this warning but I do not know the rationale
behind it.
The symbols that modpost complain about are all assembler defined symbols.
Maybe something needs to be fixed in the assembler code?
The offending symbols are marked with .comm but other global symbols
are marked with _GLOBAL(symbol).

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PowerPC64 symbols start with '.'

2007-05-15 Thread Stephen Rothwell
Hi Sam,

On Tue, 15 May 2007 22:39:35 +0200 Sam Ravnborg <[EMAIL PROTECTED]> wrote:
>
> On Fri, May 11, 2007 at 03:45:01PM +1000, Stephen Rothwell wrote:
> > which we want to skip during modpost processing.  We need this to make
> > some of the whitelisting work.
>
> I have a popwerpc64 crosscompiler and would like to reproduce
> this bug.
> What config shall I use to try it out.

I use allmodconfig, but that doesn't really build at the moment, so I
have attached a config that should build (with a recent Linus tree).

> Can you please supply the exact warning message too.

WARNING: mm/built-in.o - Section mismatch: reference to 
.init.text:.__alloc_bootmem_node from .text between '.sparse_index_alloc' (at 
offset 0x27df0) and '.__section_nr'

The '.sparse_index_alloc' doesn't match "sparse_index_alloc" in pat4sym
due to the '.' at the beginning.  I have seen another one as well, but
cannot reproduce it at the moment.

--
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.22-rc1
# Wed May 16 13:52:50 2007
#
CONFIG_PPC64=y
CONFIG_64BIT=y
CONFIG_PPC_MERGE=y
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_IRQ_PER_CPU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_ARCH_HAS_ILOG2_U64=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
CONFIG_COMPAT=y
CONFIG_SYSVIPC_COMPAT=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_PPC_UDBG_16550=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_DEFAULT_UIMAGE is not set

#
# Processor support
#
# CONFIG_POWER4_ONLY is not set
CONFIG_POWER3=y
CONFIG_POWER4=y
CONFIG_PPC_FPU=y
# CONFIG_PPC_DCR_NATIVE is not set
# CONFIG_PPC_DCR_MMIO is not set
# CONFIG_PPC_OF_PLATFORM_PCI is not set
CONFIG_ALTIVEC=y
CONFIG_PPC_STD_MMU=y
CONFIG_PPC_MM_SLICES=y
CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_SMP=y
CONFIG_NR_CPUS=128
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32

#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_IPC_NS is not set
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set
# CONFIG_UTS_NS is not set
CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_CPUSETS=y
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
# CONFIG_SLUB is not set
# CONFIG_SLOB is not set
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
CONFIG_KMOD=y
CONFIG_STOP_MACHINE=y

#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_IO_TRACE is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"

#
# Platform support
#
CONFIG_PPC_MULTIPLATFORM=y
# CONFIG_EMBEDDED6xx is not set
# CONFIG_APUS is not set
CONFIG_PPC_PSERIES=y
CONFIG_PPC_SPLPAR=y
CONFIG_EEH=y
CONFIG_SCANLOG=m
CONFIG_LPARCFG=y
# CONFIG_PPC_ISERIES is not set
# CONFIG_PPC_MPC52xx is not set
# CONFIG_PPC_MPC5200 is not set
# CONFIG_PPC_PMAC is not set
# CONFIG_PPC_MAPLE is not set
# CONFIG_PPC_PASEMI is not set
# CONFIG_PPC_CELLEB is not set
# CONFIG_PPC_PS3 is not set
# CONFIG_PPC_CELL is not set
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PPC_IBM_CELL_BLADE is not set
# CONFIG_PQ2ADS is not set
CONFIG_PPC_NATIVE=y
# CONFIG_UDBG_RTAS_CONSOLE is not set
CONFIG_XICS=y
CONFIG_MPIC=y
# CONFIG_MPIC_WEIRD is not set
CONFIG_PPC_I8259=y
# CONFIG_U3_DART is not set
CONFIG_PPC_RTAS=y
CONFIG_RTAS_ERROR_LOGGING=y
CONFIG_RTAS_PROC=y
CONFIG_RTAS_FLASH=m
# CONFIG_MMIO_NVRAM is not set
CONFIG_IBMVIO=y
CONFIG_IBMEBUS=y
# CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set
# CONFIG_PPC_INDIRECT_IO is not set
# CONFIG_GENERIC_IOMAP is not set
# CONFIG_CPU_FREQ is not set
# CONFIG_CPM2 is not set

#
# Kernel options
#
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
C

Re: [PATCH] PowerPC64 symbols start with '.'

2007-05-15 Thread Sam Ravnborg
On Fri, May 11, 2007 at 03:45:01PM +1000, Stephen Rothwell wrote:
> which we want to skip during modpost processing.  We need this to make
> some of the whitelisting work.

I have a popwerpc64 crosscompiler and would like to reproduce
this bug.
It is gcc 4.1.0 build with Dan Kegel's crosstool.

What config shall I use to try it out.
Can you please supply the exact warning message too.

Thanks,
Sam

> 
> Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
> ---
>  scripts/mod/modpost.c |   18 +-
>  1 files changed, 17 insertions(+), 1 deletions(-)
> 
> -- 
> Cheers,
> Stephen Rothwell[EMAIL PROTECTED]
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 113dc77..748b058 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -164,7 +164,13 @@ static inline unsigned int tdb_hash(const char *name)
>  static struct symbol *alloc_symbol(const char *name, unsigned int weak,
>  struct symbol *next)
>  {
> - struct symbol *s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
> + struct symbol *s;
> +
> + /* For our purposes, .foo matches foo.  PPC64 needs this. */
> + if (name[0] == '.')
> + name++;
> +
> + s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
>  
>   memset(s, 0, sizeof(*s));
>   strcpy(s->name, name);
> @@ -180,6 +186,10 @@ static struct symbol *new_symbol(const char *name, 
> struct module *module,
>   unsigned int hash;
>   struct symbol *new;
>  
> + /* For our purposes, .foo matches foo.  PPC64 needs this. */
> + if (name[0] == '.')
> + name++;
> +
>   hash = tdb_hash(name) % SYMBOL_HASH_SIZE;
>   new = symbolhash[hash] = alloc_symbol(name, 0, symbolhash[hash]);
>   new->module = module;
> @@ -684,6 +694,12 @@ static int secref_whitelist(const char *modname, const 
> char *tosec,
>   NULL
>   };
>  
> + /* For our purposes, .foo matches foo.  PPC64 needs this. */
> + if (atsym[0] == '.')
> + atsym++;
> + if (refsymname[0] == '.')
> + refsymname++;
> +
>   /* Check for pattern 1 */
>   if (strcmp(tosec, ".init.data") != 0)
>   f1 = 0;
> -- 
> 1.5.1.4
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] PowerPC64 symbols start with '.'

2007-05-10 Thread Stephen Rothwell
which we want to skip during modpost processing.  We need this to make
some of the whitelisting work.

Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]>
---
 scripts/mod/modpost.c |   18 +-
 1 files changed, 17 insertions(+), 1 deletions(-)

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 113dc77..748b058 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -164,7 +164,13 @@ static inline unsigned int tdb_hash(const char *name)
 static struct symbol *alloc_symbol(const char *name, unsigned int weak,
   struct symbol *next)
 {
-   struct symbol *s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
+   struct symbol *s;
+
+   /* For our purposes, .foo matches foo.  PPC64 needs this. */
+   if (name[0] == '.')
+   name++;
+
+   s = NOFAIL(malloc(sizeof(*s) + strlen(name) + 1));
 
memset(s, 0, sizeof(*s));
strcpy(s->name, name);
@@ -180,6 +186,10 @@ static struct symbol *new_symbol(const char *name, struct 
module *module,
unsigned int hash;
struct symbol *new;
 
+   /* For our purposes, .foo matches foo.  PPC64 needs this. */
+   if (name[0] == '.')
+   name++;
+
hash = tdb_hash(name) % SYMBOL_HASH_SIZE;
new = symbolhash[hash] = alloc_symbol(name, 0, symbolhash[hash]);
new->module = module;
@@ -684,6 +694,12 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
NULL
};
 
+   /* For our purposes, .foo matches foo.  PPC64 needs this. */
+   if (atsym[0] == '.')
+   atsym++;
+   if (refsymname[0] == '.')
+   refsymname++;
+
/* Check for pattern 1 */
if (strcmp(tosec, ".init.data") != 0)
f1 = 0;
-- 
1.5.1.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/