Skip to contentSkip to conversation

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

PATCH Mark Brown 3 participants 4 messages Mar 12

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

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

arch/x86/kvm/svm/svm.c

between commit:

6b1ca262a943a ("KVM: x86: clarify leave_smm() return value")

from the kvm-fixes tree and commit:

84dc9fd0354d3 ("KVM: nSVM: Cache all used fields from VMCB12")

from the kvm-x86 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.

I suspect this may be flagging an issue with the merge I just posted and removal of the check for the cache...

arch/x86/kvm/svm/svm.c +0 -0
diff --cc arch/x86/kvm/svm/svm.c
index e6477affac9a0,3407deac90bd6..0000000000000
@@@ -4880,15 -5030,11 +5030,11 @@@ static int svm_leave_smm(struct kvm_vcp
  	vmcb12 = map.hva;
  	nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
  	nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
 -	ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false);
  
- 	if (nested_svm_check_cached_vmcb12(vcpu) < 0)
- 		goto unmap_save;
- 
- 	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa,
- 				 vmcb12, false) != 0)
 -	if (ret)
++	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false) != 0)
  		goto unmap_save;
  
 +	ret = 0;
  	svm->nested.nested_run_pending = 1;
  
  unmap_save:
maintainer
#1 lore raw

arch/x86/kvm/svm/svm.c

Quoted 12 lines · Mark Brown
arch/x86/kvm/svm/svm.c +0 -2
diff --cc arch/x86/kvm/svm/svm.c
index e6477affac9a0,3407deac90bd6..0000000000000
@@@ -4880,15 -5030,11 +5030,11 @@@ static int svm_leave_smm(struct kvm_vcp
   	vmcb12 = map.hva;
   	nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
   	nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
  -	ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false);
 
- 	if (nested_svm_check_cached_vmcb12(vcpu) < 0)
- 		goto unmap_save;

The right resolution is to keep these two lines...

arch/x86/kvm/svm/svm.c

Quoted 5 lines
arch/x86/kvm/svm/svm.c +1 -3
-
- 	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa,
- 				 vmcb12, false) != 0)
  -	if (ret)
++	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false) != 0)

... while of course this part is okay.

Paolo

Quoted 6 lines
   		goto unmap_save;
  +	ret = 0;
   	svm->nested.nested_run_pending = 1;

unmap_save:

#2 lore raw
Quoted 15 lines · Paolo Bonzini

arch/x86/kvm/svm/svm.c

Quoted 11 lines · Mark Brown
arch/x86/kvm/svm/svm.c +0 -2
diff --cc arch/x86/kvm/svm/svm.c
index e6477affac9a0,3407deac90bd6..0000000000000
@@@ -4880,15 -5030,11 +5030,11 @@@ static int svm_leave_smm(struct kvm_vcp
   	vmcb12 = map.hva;
   	nested_copy_vmcb_control_to_cache(svm, &vmcb12->control);
   	nested_copy_vmcb_save_to_cache(svm, &vmcb12->save);
  -	ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false);
- 	if (nested_svm_check_cached_vmcb12(vcpu) < 0)
- 		goto unmap_save;

The right resolution is to keep these two lines...

Quoted 7 lines

arch/x86/kvm/svm/svm.c

Quoted 5 lines
arch/x86/kvm/svm/svm.c +1 -3
-
- 	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa,
- 				 vmcb12, false) != 0)
  -	if (ret)
++	if (enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false) != 0)

... while of course this part is okay.

I'm in the process of redoing kvm-x86/next on top of kvm/next, so I'll sort this out on my end (and double check that I come up with the same resolution as Paolo).

author maintainer
#3 lore raw
In reply to Paolo Bonzini
Quoted 7 lines · Paolo Bonzini

Review

Quoted 3 lines · Mark Brown
  -	ret = enter_svm_guest_mode(vcpu, smram64->svm_guest_vmcb_gpa, false);
(quoted diff) +0 -2
- 	if (nested_svm_check_cached_vmcb12(vcpu) < 0)
- 		goto unmap_save;

The right resolution is to keep these two lines...

Yeah, that was the bit about the prior resolution being wrong.