From: Peter Chubb <peterc@gelato.unsw.edu.au>
To: linux-ia64@vger.kernel.org, tony.luck@intel.com, dmosberger@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: RE: ip_contrack refuses to load if built UP as a module on IA64
Date: Thu, 1 Sep 2005 14:59:49 +1000 [thread overview]
Message-ID: <17174.35525.283392.703723@berry.gelato.unsw.EDU.AU> (raw)
In-Reply-To: <ed5aea43050830150112ee6103@mail.gmail.com>
This patch makes UP and SMP do the same thing as far as module per-cpu
data go.
Unfortunately it affects core code.
To repeat the problem:
IA64 keeps per-cpu data in a small data area that is referenced by a
22-bit offset, for both UP and SMP cases. If a module defines
per-cpu data, it too will end up in the small-data area. But the
module loader at present special-cases the UP treatment of per-cpu
data, assumes that it is in the GP-relative data area, and does
nothing (for SMP it allocates space, and copies initialised data
items into it)
The effect is that modules defining per-cpu data fail to load if
they're built UP, because of an impossible relocation.
The appended patch makes the treatment of per-cpu data uniform
between UP and SMP cases. For most architectures, the per-cpu data
section will be empty for UP, and so the per-cpu setup code will not
be invoked.
Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -951,4 +951,10 @@ percpu_modcopy (void *pcpudst, const voi
if (cpu_possible(i))
memcpy(pcpudst + __per_cpu_offset[i], src, size);
}
+#else
+void
+percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
+{
+ memcpy(pcpudst, src, size);
+}
#endif /* CONFIG_SMP */
diff --git a/kernel/module.c b/kernel/module.c
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -209,7 +209,6 @@ static struct module *find_module(const
return NULL;
}
-#ifdef CONFIG_SMP
/* Number of blocks used and allocated. */
static unsigned int pcpu_num_used, pcpu_num_allocated;
/* Size of each block. -ve means used. */
@@ -352,29 +351,7 @@ static int percpu_modinit(void)
return 0;
}
__initcall(percpu_modinit);
-#else /* ... !CONFIG_SMP */
-static inline void *percpu_modalloc(unsigned long size, unsigned long align,
- const char *name)
-{
- return NULL;
-}
-static inline void percpu_modfree(void *pcpuptr)
-{
- BUG();
-}
-static inline unsigned int find_pcpusec(Elf_Ehdr *hdr,
- Elf_Shdr *sechdrs,
- const char *secstrings)
-{
- return 0;
-}
-static inline void percpu_modcopy(void *pcpudst, const void *src,
- unsigned long size)
-{
- /* pcpusec should be 0, and size of that section should be 0. */
- BUG_ON(size != 0);
-}
-#endif /* CONFIG_SMP */
+
#ifdef CONFIG_MODULE_UNLOAD
#define MODINFO_ATTR(field) \
next parent reply other threads:[~2005-09-01 4:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B8E391BBE9FE384DAA4C5C003888BE6F0443A5FA@scsmsx401.amr.corp.intel.com>
[not found] ` <ed5aea430508301229386fc596@mail.gmail.com>
[not found] ` <17172.54563.329758.846131@wombat.chubb.wattle.id.au>
[not found] ` <ed5aea43050830150112ee6103@mail.gmail.com>
2005-09-01 4:59 ` Peter Chubb [this message]
2005-09-22 22:04 ` ip_contrack refuses to load if built UP as a module on IA64 dann frazier
2005-12-19 21:07 ` Luck, Tony
2006-01-10 21:21 ` dann frazier
2006-01-22 19:31 ` dann frazier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17174.35525.283392.703723@berry.gelato.unsw.EDU.AU \
--to=peterc@gelato.unsw.edu.au \
--cc=dmosberger@gmail.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).