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

From: Stephen Rothwell <[email-masked]>
Date: Wed, 17 Jul 2024 13:58:08 +1000

Hi all,

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

  arch/x86/kvm/x86.c
  include/uapi/linux/kvm.h

between commits:

  bc1a5cd00211 ("KVM: Add KVM_PRE_FAULT_MEMORY vcpu ioctl to pre-populate guest memory")
  6e01b7601dfe ("KVM: x86: Implement kvm_arch_vcpu_pre_fault_memory()")

from the kvm tree and commits:

  6fef518594bc ("KVM: x86: Add a capability to configure bus frequency for APIC timer")
  85542adb65ec ("KVM: x86: Add KVM_RUN_X86_GUEST_MODE kvm_run flag")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/x86/kvm/x86.c
index a6968eadd418,994743266480..000000000000
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@@ -4703,11 -4690,12 +4690,15 @@@ int kvm_vm_ioctl_check_extension(struc
  	case KVM_CAP_VM_DISABLE_NX_HUGE_PAGES:
  	case KVM_CAP_IRQFD_RESAMPLE:
  	case KVM_CAP_MEMORY_FAULT_INFO:
+ 	case KVM_CAP_X86_GUEST_MODE:
  		r = 1;
  		break;
 +	case KVM_CAP_PRE_FAULT_MEMORY:
 +		r = tdp_enabled;
 +		break;
+ 	case KVM_CAP_X86_APIC_BUS_CYCLES_NS:
+ 		r = APIC_BUS_CYCLE_NS_DEFAULT;
+ 		break;
  	case KVM_CAP_EXIT_HYPERCALL:
  		r = KVM_EXIT_HYPERCALL_VALID_MASK;
  		break;
diff --cc include/uapi/linux/kvm.h
index e5af8c692dc0,e065d9fe7ab2..000000000000
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@@ -917,7 -930,8 +930,9 @@@ struct kvm_enable_cap 
  #define KVM_CAP_MEMORY_ATTRIBUTES 233
  #define KVM_CAP_GUEST_MEMFD 234
  #define KVM_CAP_VM_TYPES 235
 -#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 236
 -#define KVM_CAP_X86_GUEST_MODE 237
 +#define KVM_CAP_PRE_FAULT_MEMORY 236
++#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237
++#define KVM_CAP_X86_GUEST_MODE 238
  
  struct kvm_irq_routing_irqchip {
  	__u32 irqchip;