linux-next: manual merge of the kvm-fixes tree with Linus' tree

From: Stephen Rothwell
Date: Tue Nov 12 2019 - 16:00:45 EST


Hi all,

Today's linux-next merge of the kvm-fixes tree got a conflict in:

virt/kvm/kvm_main.c

between commit:

1aa9b9572b10 ("kvm: x86: mmu: Recovery of shattered NX large pages")

from Linus' tree and commit:

8a44119a98be ("KVM: Fix NULL-ptr deref after kvm_create_vm fails")

from the kvm-fixes tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc virt/kvm/kvm_main.c
index 4aab3547a165,0dac149ead16..000000000000
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@@ -693,16 -700,7 +718,11 @@@ static struct kvm *kvm_create_vm(unsign
INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list);
#endif

- if (init_srcu_struct(&kvm->srcu))
- goto out_err_no_srcu;
- if (init_srcu_struct(&kvm->irq_srcu))
- goto out_err_no_irq_srcu;
-
r = kvm_init_mmu_notifier(kvm);
+ if (r)
+ goto out_err_no_mmu_notifier;
+
+ r = kvm_arch_post_init_vm(kvm);
if (r)
goto out_err;

@@@ -715,15 -713,6 +735,11 @@@
return kvm;

out_err:
+#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
+ if (kvm->mmu_notifier.ops)
+ mmu_notifier_unregister(&kvm->mmu_notifier, current->mm);
+#endif
+out_err_no_mmu_notifier:
- cleanup_srcu_struct(&kvm->irq_srcu);
- out_err_no_irq_srcu:
- cleanup_srcu_struct(&kvm->srcu);
- out_err_no_srcu:
hardware_disable_all();
out_err_no_disable:
kvm_arch_destroy_vm(kvm);

Attachment: pgpgeSeuu3AIb.pgp
Description: OpenPGP digital signature