linux_dsm_epyc7002/arch/mips
Atsushi Nemoto 656be92f9a [MIPS] Load modules to CKSEG0 if CONFIG_BUILD_ELF64=n
This is a patch to load 64-bit modules to CKSEG0 so that can be
compiled with -msym32 option.  This makes each module ~10% smaller.

* introduce MODULE_START and MODULE_END
* custom module_alloc()
* PGD for modules
* change XTLB refill handler synthesizer
* enable -msym32 for modules again
  (revert ca78b1a5c6a6e70e052d3ea253828e49b5d07c8a)

New XTLB refill handler looks like this:

80000080 dmfc0   k0,C0_BADVADDR
80000084 bltz    k0,800000e4			# goto l_module_alloc
80000088 lui     k1,0x8046			# %high(pgd_current)
8000008c ld      k1,24600(k1)			# %low(pgd_current)
80000090 dsrl    k0,k0,0x1b			# l_vmalloc_done:
80000094 andi    k0,k0,0x1ff8
80000098 daddu   k1,k1,k0
8000009c dmfc0   k0,C0_BADVADDR
800000a0 ld      k1,0(k1)
800000a4 dsrl    k0,k0,0x12
800000a8 andi    k0,k0,0xff8
800000ac daddu   k1,k1,k0
800000b0 dmfc0   k0,C0_XCONTEXT
800000b4 ld      k1,0(k1)
800000b8 andi    k0,k0,0xff0
800000bc daddu   k1,k1,k0
800000c0 ld      k0,0(k1)
800000c4 ld      k1,8(k1)
800000c8 dsrl    k0,k0,0x6
800000cc mtc0    k0,C0_ENTRYLO0
800000d0 dsrl    k1,k1,0x6
800000d4 mtc0    k1,C0_ENTRYL01
800000d8 nop
800000dc tlbwr
800000e0 eret
800000e4 dsll    k1,k0,0x2			# l_module_alloc:
800000e8 bgez    k1,80000008			# goto l_vmalloc
800000ec lui     k1,0xc000
800000f0 dsubu   k0,k0,k1
800000f4 lui     k1,0x8046			# %high(module_pg_dir)
800000f8 beq     zero,zero,80000000
800000fc nop
80000000 beq     zero,zero,80000090		# goto l_vmalloc_done
80000004 daddiu  k1,k1,0x4000
80000008 dsll32  k1,k1,0x0			# l_vmalloc:
8000000c dsubu   k0,k0,k1
80000010 beq     zero,zero,80000090		# goto l_vmalloc_done
80000014 lui     k1,0x8046			# %high(swapper_pg_dir)

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-11-30 01:14:44 +00:00
..
arc Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
au1000 [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
basler/excite [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
boot Add .gitignore files for MIPS. 2005-11-07 18:05:37 +00:00
cobalt [MIPS] Rewrite GALILEO_INL/GALILEO_OUTL to GT_READ/GT_WRITE 2006-11-30 01:14:43 +00:00
configs [MIPS] Update tb0287_defconfig 2006-10-19 17:55:14 +01:00
ddb5xxx [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
dec [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
emma2rh [MIPS] EMMA 2 / Markeins: struct resource takes physical addresses. 2006-10-30 21:41:30 +00:00
gt64120 [MIPS] Fix EV64120 and Ocelot builds by providing a plat_timer_setup(). 2006-11-06 20:55:39 +00:00
jazz [MIPS] Fix timer setup for Jazz 2006-10-11 19:30:58 +01:00
jmr3927 [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
kernel [MIPS] Load modules to CKSEG0 if CONFIG_BUILD_ELF64=n 2006-11-30 01:14:44 +00:00
lasat [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
lib Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
lib-32 Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
lib-64 [MIPS] 16K & 64K page size fixes 2006-11-01 17:46:09 +00:00
math-emu [MIPS] Make sure cpu_has_fpu is used only in atomic context 2006-10-09 23:20:48 +01:00
mips-boards [MIPS] Fix Bonito bootup message. 2006-11-28 19:13:34 +00:00
mm [MIPS] Load modules to CKSEG0 if CONFIG_BUILD_ELF64=n 2006-11-30 01:14:44 +00:00
momentum [MIPS] Ocelot 3: Fix MAC address detection after platform_device conversion. 2006-11-06 20:55:38 +00:00
oprofile [MIPS] Oprofile: Fix MIPSxx counter number detection. 2006-10-30 21:41:27 +00:00
pci [MIPS] Rewrite GALILEO_INL/GALILEO_OUTL to GT_READ/GT_WRITE 2006-11-30 01:14:43 +00:00
philips/pnx8550 [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
pmc-sierra [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
qemu [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
sgi-ip22 [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
sgi-ip27 [MIPS] Make irq number allocator generally available for fixing EV64120. 2006-11-06 20:55:38 +00:00
sgi-ip32 [MIPS] A few more pt_regs fixups. 2006-10-19 17:55:13 +01:00
sibyte [MIPS] Fixup migration to GENERIC_TIME 2006-10-31 20:13:23 +00:00
sni [MIPS] Cleanup unnecessary <asm/ptrace.h> inclusions. 2006-10-09 00:15:28 +01:00
tx4927 [MIPS] Add missing file for support of backplane on TX4927 based board 2006-10-31 20:13:20 +00:00
tx4938 [MIPS] Fix return value of TXX9 SPI interrupt handler 2006-10-30 21:41:29 +00:00
vr41xx [MIPS] Complete fixes after removal of pt_regs argument to int handlers. 2006-10-08 02:38:28 +01:00
defconfig [MIPS] lockdep: update defconfigs 2006-10-01 23:16:57 +01:00
Kconfig [MIPS] IP27: Allow SMP ;-) Another changeset messed up by patch. 2006-11-02 17:23:33 +00:00
Kconfig.debug [MIPS] TRACE_IRQFLAGS_SUPPORT support. 2006-07-13 21:26:09 +01:00
Makefile [MIPS] Load modules to CKSEG0 if CONFIG_BUILD_ELF64=n 2006-11-30 01:14:44 +00:00