All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the kvm tree with the kvm tree
@ 2021-12-15 13:10 broonie
  2021-12-16  4:47 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: broonie @ 2021-12-15 13:10 UTC (permalink / raw)
  To: Paolo Bonzini, KVM
  Cc: Alexey Kardashevskiy, Linux Kernel Mailing List,
	Linux Next Mailing List, Maciej S . Szmigiero, Michael Ellerman,
	Sean Christopherson

Hi all,

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

  arch/powerpc/kvm/book3s_hv.c

between commit:

  511d25d6b789f ("KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots")

from the kvm tree and commits:

  537a17b314930 ("KVM: Let/force architectures to deal with arch specific memslot data")
  eaaaed137eccb ("KVM: PPC: Avoid referencing userspace memory region in memslot updates")

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

diff --cc arch/powerpc/kvm/book3s_hv.c
index f64e45d6c0f4c,51e1c29a6fa08..0000000000000
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@@ -4866,21 -4854,17 +4866,22 @@@ static void kvmppc_core_free_memslot_hv
  }
  
  static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
- 					struct kvm_memory_slot *slot,
- 					const struct kvm_userspace_memory_region *mem,
- 					enum kvm_mr_change change)
+ 				const struct kvm_memory_slot *old,
+ 				struct kvm_memory_slot *new,
+ 				enum kvm_mr_change change)
  {
- 	unsigned long npages = mem->memory_size >> PAGE_SHIFT;
- 
  	if (change == KVM_MR_CREATE) {
- 		unsigned long size = array_size(npages, sizeof(*slot->arch.rmap));
 -		new->arch.rmap = vzalloc(array_size(new->npages,
 -					  sizeof(*new->arch.rmap)));
++		unsigned long size = array_size(new->npages,
++						sizeof(*new->arch.rmap));
 +
 +		if ((size >> PAGE_SHIFT) > totalram_pages())
 +			return -ENOMEM;
 +
- 		slot->arch.rmap = vzalloc(size);
- 		if (!slot->arch.rmap)
++		new->arch.rmap = vzalloc(size);
+ 		if (!new->arch.rmap)
  			return -ENOMEM;
+ 	} else if (change != KVM_MR_DELETE) {
+ 		new->arch.rmap = old->arch.rmap;
  	}
  
  	return 0;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the kvm tree with the kvm tree
  2021-12-15 13:10 linux-next: manual merge of the kvm tree with the kvm tree broonie
@ 2021-12-16  4:47 ` Michael Ellerman
  2021-12-17 17:07   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2021-12-16  4:47 UTC (permalink / raw)
  To: broonie, Paolo Bonzini, KVM
  Cc: Alexey Kardashevskiy, Linux Kernel Mailing List,
	Linux Next Mailing List, Maciej S . Szmigiero,
	Sean Christopherson

broonie@kernel.org writes:
> Hi all,
>
> Today's linux-next merge of the kvm tree got a conflict in:
>
>   arch/powerpc/kvm/book3s_hv.c
>
> between commit:
>
>   511d25d6b789f ("KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots")
>
> from the kvm tree and commits:

That's from the powerpc tree.

>   537a17b314930 ("KVM: Let/force architectures to deal with arch specific memslot data")
>   eaaaed137eccb ("KVM: PPC: Avoid referencing userspace memory region in memslot updates")
>
> from the kvm 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.

Thanks.

Paolo, if you want to avoid the conflict going to Linus, I have that
commit (and others) in a topic branch here (based on rc2):

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/ppc-kvm


cheers


> diff --cc arch/powerpc/kvm/book3s_hv.c
> index f64e45d6c0f4c,51e1c29a6fa08..0000000000000
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@@ -4866,21 -4854,17 +4866,22 @@@ static void kvmppc_core_free_memslot_hv
>   }
>   
>   static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
> - 					struct kvm_memory_slot *slot,
> - 					const struct kvm_userspace_memory_region *mem,
> - 					enum kvm_mr_change change)
> + 				const struct kvm_memory_slot *old,
> + 				struct kvm_memory_slot *new,
> + 				enum kvm_mr_change change)
>   {
> - 	unsigned long npages = mem->memory_size >> PAGE_SHIFT;
> - 
>   	if (change == KVM_MR_CREATE) {
> - 		unsigned long size = array_size(npages, sizeof(*slot->arch.rmap));
>  -		new->arch.rmap = vzalloc(array_size(new->npages,
>  -					  sizeof(*new->arch.rmap)));
> ++		unsigned long size = array_size(new->npages,
> ++						sizeof(*new->arch.rmap));
>  +
>  +		if ((size >> PAGE_SHIFT) > totalram_pages())
>  +			return -ENOMEM;
>  +
> - 		slot->arch.rmap = vzalloc(size);
> - 		if (!slot->arch.rmap)
> ++		new->arch.rmap = vzalloc(size);
> + 		if (!new->arch.rmap)
>   			return -ENOMEM;
> + 	} else if (change != KVM_MR_DELETE) {
> + 		new->arch.rmap = old->arch.rmap;
>   	}
>   
>   	return 0;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-next: manual merge of the kvm tree with the kvm tree
  2021-12-16  4:47 ` Michael Ellerman
@ 2021-12-17 17:07   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-12-17 17:07 UTC (permalink / raw)
  To: Michael Ellerman, broonie, KVM
  Cc: Alexey Kardashevskiy, Linux Kernel Mailing List,
	Linux Next Mailing List, Maciej S . Szmigiero,
	Sean Christopherson

On 12/16/21 05:47, Michael Ellerman wrote:
> broonie@kernel.org writes:
>> Hi all,
>>
>> Today's linux-next merge of the kvm tree got a conflict in:
>>
>>    arch/powerpc/kvm/book3s_hv.c
>>
>> between commit:
>>
>>    511d25d6b789f ("KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots")
>>
>> from the kvm tree and commits:
> 
> That's from the powerpc tree.
> 
>>    537a17b314930 ("KVM: Let/force architectures to deal with arch specific memslot data")
>>    eaaaed137eccb ("KVM: PPC: Avoid referencing userspace memory region in memslot updates")
>>
>> from the kvm 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.
> 
> Thanks.
> 
> Paolo, if you want to avoid the conflict going to Linus, I have that
> commit (and others) in a topic branch here (based on rc2):
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=topic/ppc-kvm

Will pull, thanks!

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-17 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 13:10 linux-next: manual merge of the kvm tree with the kvm tree broonie
2021-12-16  4:47 ` Michael Ellerman
2021-12-17 17:07   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.