From: Wang Chen <wangchen@cn.fujitsu.com>
To: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: [tip:x86/fixmap] x86: dont' define __this_fixmap_does_not_exist
Date: Sat, 07 Mar 2009 13:34:19 +0800 [thread overview]
Message-ID: <49B2075B.4070509@cn.fujitsu.com> (raw)
Commit "1b42f51630c7eebce6fb780b480731eb81afd325" defined
__this_fixmap_does_not_exist().
This causes linker can't report error when __this_fixmap_does_not_exist() be
called with not-constant parameter.
Ingo defined __this_fixmap_does_not_exist() because he want to get virt
addresses of fix memory of nest level by non-constant index.
After defining __this_fixmap_does_not_exist(), he made the linker stopped
complaining "undefined symbol".
How to fix:
The fixmaps are fixed, so we can get the four slot virt addresses on link time
and store them to array slot_virt.
Then we can refer the slot_virt with non-constant index.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
arch/x86/mm/ioremap.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 433f7bd..d7e329d 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -508,13 +508,17 @@ static inline pte_t * __init early_ioremap_pte(unsigned long addr)
return &bm_pte[pte_index(addr)];
}
+static unsigned long slot_virt[FIX_BTMAPS_SLOTS] __initdata;
void __init early_ioremap_init(void)
{
pmd_t *pmd;
+ int i;
if (early_ioremap_debug)
printk(KERN_INFO "early_ioremap_init()\n");
+ for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
+ slot_virt[i] = fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
memset(bm_pte, 0, sizeof(bm_pte));
pmd_populate_kernel(&init_mm, pmd, bm_pte);
@@ -668,9 +672,9 @@ static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned lo
--nrpages;
}
if (early_ioremap_debug)
- printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0));
+ printk(KERN_CONT "%08lx + %08lx\n", offset, slot_virt[slot]);
- prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0));
+ prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]);
return prev_map[slot];
}
@@ -738,8 +742,3 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
}
prev_map[slot] = NULL;
}
-
-void __this_fixmap_does_not_exist(void)
-{
- WARN_ON(1);
-}
--
1.5.3.4
next reply other threads:[~2009-03-07 5:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-07 5:34 Wang Chen [this message]
2009-03-08 18:12 ` [tip:x86/fixmap] x86: don't define __this_fixmap_does_not_exist() Wang Chen
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=49B2075B.4070509@cn.fujitsu.com \
--to=wangchen@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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