Thread (127 messages) 127 messages, 14 authors, 2022-12-01

Re: [PATCH 05/44] KVM: s390: Unwind kvm_arch_init() piece-by-piece() if a step fails

From: Eric Farman <farman@linux.ibm.com>
Date: 2022-11-07 18:02:53
Also in: kvm, kvm-riscv, kvmarm, linux-mips, linux-riscv, linux-s390, linuxppc-dev, lkml

On Wed, 2022-11-02 at 23:18 +0000, Sean Christopherson wrote:
In preparation for folding kvm_arch_hardware_setup() into
kvm_arch_init(),
unwind initialization one step at a time instead of simply calling
kvm_arch_exit().  Using kvm_arch_exit() regardless of which
initialization
step failed relies on all affected state playing nice with being
undone
even if said state wasn't first setup.  That holds true for state
that is
currently configured by kvm_arch_init(), but not for state that's
handled
by kvm_arch_hardware_setup(), e.g. calling
gmap_unregister_pte_notifier()
without first registering a notifier would result in list corruption
due
to attempting to delete an entry that was never added to the list.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/s390/kvm/kvm-s390.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
Reviewed-by: Eric Farman <farman@linux.ibm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help