m68k/atari: ARAnyM - Fix NatFeat module support
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 25 Jul 2013 22:08:25 +0000 (00:08 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 10 Sep 2013 00:57:24 +0000 (01:57 +0100)
commit52bd8a0804eda6fde7f25ab24caf8dcb6d40da9e
treef6a80ca7928f9a3ad941efdb99236ed885cfecd0
parentbd20948dc24c3a1cf5ea18385943783f11c2c751
m68k/atari: ARAnyM - Fix NatFeat module support

commit e8184e10f89736a23ea6eea8e24cd524c5c513d2 upstream.

As pointed out by Andreas Schwab, pointers passed to ARAnyM NatFeat calls
should be physical addresses, not virtual addresses.

Fortunately on Atari, physical and virtual kernel addresses are the same,
as long as normal kernel memory is concerned, so this usually worked fine
without conversion.

But for modules, pointers to literal strings are located in vmalloc()ed
memory. Depending on the version of ARAnyM, this causes the nf_get_id()
call to just fail, or worse, crash ARAnyM itself with e.g.

    Gotcha! Illegal memory access. Atari PC = $968c

This is a big issue for distro kernels, who want to have all drivers as
loadable modules in an initrd.

Add a wrapper for nf_get_id() that copies the literal to the stack to
work around this issue.

Reported-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/m68k/emu/natfeat.c