s390/early: get rid of memmove_early
memmove_early was introduced with commitd543a106f9
("s390: fix initrd corruptions with gcov/kcov instrumented kernels"). The reason for writing this extra memmove implementation was to be able to move memory from an unknown location (aka SCSI IPL parameter block) to a known location. This had to done early before it was known if the SCSI IPL parameter block pointer was valid or not, and therefore the memmove implementation was supposed to be able to handle program checks. The code has been changed and especially with commitd08091ac96
("s390/ipl: rely on diag308 store to get ipl info") and commitb4623d4e5b
("s390: provide memmove implementation") there is no need to have a memmove version that can handle program checks, and in addition it cannot be gcov/kcov instrumented anymore. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Родитель
77715b7ddb
Коммит
1155a26a25
|
@ -310,38 +310,6 @@ static int __init cad_setup(char *str)
|
||||||
}
|
}
|
||||||
early_param("cad", cad_setup);
|
early_param("cad", cad_setup);
|
||||||
|
|
||||||
static __init void memmove_early(void *dst, const void *src, size_t n)
|
|
||||||
{
|
|
||||||
unsigned long addr;
|
|
||||||
long incr;
|
|
||||||
psw_t old;
|
|
||||||
|
|
||||||
if (!n)
|
|
||||||
return;
|
|
||||||
incr = 1;
|
|
||||||
if (dst > src) {
|
|
||||||
incr = -incr;
|
|
||||||
dst += n - 1;
|
|
||||||
src += n - 1;
|
|
||||||
}
|
|
||||||
old = S390_lowcore.program_new_psw;
|
|
||||||
S390_lowcore.program_new_psw.mask = __extract_psw();
|
|
||||||
asm volatile(
|
|
||||||
" larl %[addr],1f\n"
|
|
||||||
" stg %[addr],%[psw_pgm_addr]\n"
|
|
||||||
"0: mvc 0(1,%[dst]),0(%[src])\n"
|
|
||||||
" agr %[dst],%[incr]\n"
|
|
||||||
" agr %[src],%[incr]\n"
|
|
||||||
" brctg %[n],0b\n"
|
|
||||||
"1:\n"
|
|
||||||
: [addr] "=&d" (addr),
|
|
||||||
[psw_pgm_addr] "=Q" (S390_lowcore.program_new_psw.addr),
|
|
||||||
[dst] "+&a" (dst), [src] "+&a" (src), [n] "+d" (n)
|
|
||||||
: [incr] "d" (incr)
|
|
||||||
: "cc", "memory");
|
|
||||||
S390_lowcore.program_new_psw = old;
|
|
||||||
}
|
|
||||||
|
|
||||||
static __init noinline void rescue_initrd(void)
|
static __init noinline void rescue_initrd(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_BLK_DEV_INITRD
|
#ifdef CONFIG_BLK_DEV_INITRD
|
||||||
|
@ -356,7 +324,7 @@ static __init noinline void rescue_initrd(void)
|
||||||
return;
|
return;
|
||||||
if (INITRD_START >= min_initrd_addr)
|
if (INITRD_START >= min_initrd_addr)
|
||||||
return;
|
return;
|
||||||
memmove_early((void *) min_initrd_addr, (void *) INITRD_START, INITRD_SIZE);
|
memmove((void *) min_initrd_addr, (void *) INITRD_START, INITRD_SIZE);
|
||||||
INITRD_START = min_initrd_addr;
|
INITRD_START = min_initrd_addr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче