arm64: KVM: Invoke compute_layout() before alternatives are applied
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 28 Nov 2019 19:58:05 +0000 (20:58 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 6 Dec 2019 12:14:45 +0000 (12:14 +0000)
commit0492747c72a3db0425a234abafb763c5b28c845d
tree971ffafe7f1468781a0b969fe0ae51f69655ca20
parentdf325e05a682e9c624f471835c35bd3f870d5e8c
arm64: KVM: Invoke compute_layout() before alternatives are applied

compute_layout() is invoked as part of an alternative fixup under
stop_machine(). This function invokes get_random_long() which acquires a
sleeping lock on -RT which can not be acquired in this context.

Rename compute_layout() to kvm_compute_layout() and invoke it before
stop_machine() applies the alternatives. Add a __init prefix to
kvm_compute_layout() because the caller has it, too (and so the code can be
discarded after boot).

Reviewed-by: James Morse <james.morse@arm.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/kvm_mmu.h
arch/arm64/kernel/smp.c
arch/arm64/kvm/va_layout.c