From: Christoph Hellwig <hch@lst.de>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: alpha fp-emu vs module refcounting
Date: Sun, 16 May 2004 12:04:35 +0200 [thread overview]
Message-ID: <20040516100435.GD16301@infradead.org> (raw)
In-Reply-To: <20040508025142.A4330@jurassic.park.msu.ru>
On Sat, May 08, 2004 at 02:51:42AM +0400, Ivan Kokshaysky wrote:
> On Sat, May 08, 2004 at 12:41:04AM +0200, Christoph Hellwig wrote:
> > either that or just marking it unloadable by removing the cleanup_module
> > handler sound like the simplest solution I guess.
>
> Or leave it as it is for now - 'CONFIG_MATHEMU=m' won't compile. ;-)
Well, still false positives in grep. What about this patch to simply
remove any traces of CONFIG_MATHEMU and modular math emulation?
--- 1.36/arch/alpha/Kconfig Sat Mar 20 19:29:54 2004
+++ edited/arch/alpha/Kconfig Sun May 16 11:14:44 2004
@@ -625,14 +625,6 @@
Say Y here if you are developing drivers or trying to debug and
identify kernel problems.
-config MATHEMU
- tristate "Kernel FP software completion" if DEBUG_KERNEL
- default y if !DEBUG_KERNEL
- help
- This option is required for IEEE compliant floating point arithmetic
- on the Alpha. The only time you would ever not say Y is to say M in
- order to debug the code. Say Y unless you know what you are doing.
-
config DEBUG_SLAB
bool "Debug memory allocations"
depends on DEBUG_KERNEL
===== arch/alpha/kernel/alpha_ksyms.c 1.37 vs edited =====
--- 1.37/arch/alpha/kernel/alpha_ksyms.c Thu Mar 18 01:58:10 2004
+++ edited/arch/alpha/kernel/alpha_ksyms.c Sun May 16 11:15:01 2004
@@ -169,13 +169,6 @@
EXPORT_SYMBOL(csum_partial_copy_from_user);
EXPORT_SYMBOL(csum_ipv6_magic);
-#ifdef CONFIG_MATHEMU_MODULE
-extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
-extern long (*alpha_fp_emul) (unsigned long pc);
-EXPORT_SYMBOL(alpha_fp_emul_imprecise);
-EXPORT_SYMBOL(alpha_fp_emul);
-#endif
-
#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
EXPORT_SYMBOL(__min_ipl);
#endif
===== arch/alpha/kernel/traps.c 1.29 vs edited =====
--- 1.29/arch/alpha/kernel/traps.c Thu Apr 22 10:40:31 2004
+++ edited/arch/alpha/kernel/traps.c Sun May 16 11:15:09 2004
@@ -191,16 +191,8 @@
do_exit(SIGSEGV);
}
-#ifndef CONFIG_MATHEMU
-static long dummy_emul(void) { return 0; }
-long (*alpha_fp_emul_imprecise)(struct pt_regs *regs, unsigned long writemask)
- = (void *)dummy_emul;
-long (*alpha_fp_emul) (unsigned long pc)
- = (void *)dummy_emul;
-#else
long alpha_fp_emul_imprecise(struct pt_regs *regs, unsigned long writemask);
long alpha_fp_emul (unsigned long pc);
-#endif
asmlinkage void
do_entArith(unsigned long summary, unsigned long write_mask,
===== arch/alpha/math-emu/Makefile 1.9 vs edited =====
--- 1.9/arch/alpha/math-emu/Makefile Sun Feb 23 02:34:29 2003
+++ edited/arch/alpha/math-emu/Makefile Sun May 16 11:15:21 2004
@@ -4,4 +4,4 @@
EXTRA_CFLAGS := -w
-obj-$(CONFIG_MATHEMU) += math.o qrnnd.o
+obj-y += math.o qrnnd.o
===== arch/alpha/math-emu/math.c 1.5 vs edited =====
--- 1.5/arch/alpha/math-emu/math.c Fri Apr 4 00:49:57 2003
+++ edited/arch/alpha/math-emu/math.c Sun May 16 11:15:57 2004
@@ -48,43 +48,6 @@
extern unsigned long alpha_read_fp_reg_s (unsigned long reg);
extern void alpha_write_fp_reg_s (unsigned long reg, unsigned long val);
-
-#ifdef MODULE
-
-MODULE_DESCRIPTION("FP Software completion module");
-
-extern long (*alpha_fp_emul_imprecise)(struct pt_regs *, unsigned long);
-extern long (*alpha_fp_emul) (unsigned long pc);
-
-static long (*save_emul_imprecise)(struct pt_regs *, unsigned long);
-static long (*save_emul) (unsigned long pc);
-
-long do_alpha_fp_emul_imprecise(struct pt_regs *, unsigned long);
-long do_alpha_fp_emul(unsigned long);
-
-int init_module(void)
-{
- save_emul_imprecise = alpha_fp_emul_imprecise;
- save_emul = alpha_fp_emul;
- alpha_fp_emul_imprecise = do_alpha_fp_emul_imprecise;
- alpha_fp_emul = do_alpha_fp_emul;
- return 0;
-}
-
-void cleanup_module(void)
-{
- alpha_fp_emul_imprecise = save_emul_imprecise;
- alpha_fp_emul = save_emul;
-}
-
-#undef alpha_fp_emul_imprecise
-#define alpha_fp_emul_imprecise do_alpha_fp_emul_imprecise
-#undef alpha_fp_emul
-#define alpha_fp_emul do_alpha_fp_emul
-
-#endif /* MODULE */
-
-
/*
* Emulate the floating point instruction at address PC. Returns -1 if the
* instruction to be emulated is illegal (such as with the opDEC trap), else
@@ -106,8 +69,6 @@
__u32 insn;
long si_code;
- MOD_INC_USE_COUNT;
-
get_user(insn, (__u32*)pc);
fc = (insn >> 0) & 0x1f; /* destination register */
fb = (insn >> 16) & 0x1f;
@@ -320,7 +281,6 @@
if (_fex & IEEE_TRAP_ENABLE_INV) si_code = FPE_FLTINV;
}
- MOD_DEC_USE_COUNT;
return si_code;
}
@@ -328,13 +288,11 @@
requires that the result *always* be written... so we do the write
immediately after the operations above. */
- MOD_DEC_USE_COUNT;
return 0;
bad_insn:
printk(KERN_ERR "alpha_fp_emul: Invalid FP insn %#x at %#lx\n",
insn, pc);
- MOD_DEC_USE_COUNT;
return -1;
}
@@ -344,8 +302,6 @@
unsigned long trigger_pc = regs->pc - 4;
unsigned long insn, opcode, rc, si_code = 0;
- MOD_INC_USE_COUNT;
-
/*
* Turn off the bits corresponding to registers that are the
* target of instructions that set bits in the exception
@@ -403,6 +359,5 @@
}
egress:
- MOD_DEC_USE_COUNT;
return si_code;
}
next prev parent reply other threads:[~2004-05-16 10:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-07 11:02 alpha fp-emu vs module refcounting Christoph Hellwig
2004-05-07 14:32 ` Ivan Kokshaysky
2004-05-07 14:35 ` Christoph Hellwig
2004-05-07 22:37 ` Ivan Kokshaysky
2004-05-07 22:41 ` Christoph Hellwig
2004-05-07 22:51 ` Ivan Kokshaysky
2004-05-16 10:04 ` Christoph Hellwig [this message]
2004-05-16 12:44 ` Ivan Kokshaysky
2004-05-16 13:09 ` Christoph Hellwig
2004-05-17 22:39 ` Richard Henderson
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=20040516100435.GD16301@infradead.org \
--to=hch@lst.de \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-kernel@vger.kernel.org \
/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