Commit d879ac67 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Vasily Gorbik
Browse files

s390/pfault: Fix virtual vs physical address confusion



When Linux is running as guest, runs a user space process and the
user space process accesses a page that the host has paged out,
the guest gets a pfault interrupt and schedules a different process.
Without this mechanism the host would have to suspend the whole
virtual CPU until the page has been paged in.

To setup the pfault interrupt the real address of parameter list
should be passed to DIAGNOSE 0x258, but a virtual address is passed
instead.

That has a performance impact, since the pfault setup never succeeds,
the interrupt is never delivered to a guest and the whole virtual CPU
is suspended as result.

Cc: stable@vger.kernel.org
Fixes: c98d2eca ("s390/mm: Uncouple physical vs virtual address spaces")
Reported-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 1623a554
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ int __pfault_init(void)
		"0:	nopr	%%r7\n"
		EX_TABLE(0b, 0b)
		: [rc] "+d" (rc)
		: [refbk] "a" (&pfault_init_refbk), "m" (pfault_init_refbk)
		: [refbk] "a" (virt_to_phys(&pfault_init_refbk)), "m" (pfault_init_refbk)
		: "cc");
	return rc;
}
@@ -84,7 +84,7 @@ void __pfault_fini(void)
		"0:	nopr	%%r7\n"
		EX_TABLE(0b, 0b)
		:
		: [refbk] "a" (&pfault_fini_refbk), "m" (pfault_fini_refbk)
		: [refbk] "a" (virt_to_phys(&pfault_fini_refbk)), "m" (pfault_fini_refbk)
		: "cc");
}