linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the kvm tree with the arm64 tree
@ 2018-02-07  1:27 Stephen Rothwell
  2018-02-07  8:29 ` Christoffer Dall
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2018-02-07  1:27 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, KVM, Catalin Marinas
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Marc Zyngier,
	Christoffer Dall, Will Deacon

Hi all,

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

  arch/arm64/include/asm/pgtable-prot.h

between commit:

  41acec624087 ("arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()")

from the arm64 tree and commit:

  d0e22b4ac3ba ("KVM: arm/arm64: Limit icache invalidation to prefetch aborts")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/include/asm/pgtable-prot.h
index 2db84df5eb42,4e12dabd342b..000000000000
--- a/arch/arm64/include/asm/pgtable-prot.h
+++ b/arch/arm64/include/asm/pgtable-prot.h
@@@ -53,24 -47,23 +53,24 @@@
  #define PROT_SECT_NORMAL	(PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
  #define PROT_SECT_NORMAL_EXEC	(PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
  
 -#define _PAGE_DEFAULT		(PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
 +#define _PAGE_DEFAULT		(_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
 +#define _HYP_PAGE_DEFAULT	_PAGE_DEFAULT
  
 -#define PAGE_KERNEL		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE)
 -#define PAGE_KERNEL_RO		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
 -#define PAGE_KERNEL_ROX		__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
 -#define PAGE_KERNEL_EXEC	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE)
 -#define PAGE_KERNEL_EXEC_CONT	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_CONT)
 +#define PAGE_KERNEL		__pgprot(PROT_NORMAL)
 +#define PAGE_KERNEL_RO		__pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
 +#define PAGE_KERNEL_ROX		__pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
 +#define PAGE_KERNEL_EXEC	__pgprot(PROT_NORMAL & ~PTE_PXN)
 +#define PAGE_KERNEL_EXEC_CONT	__pgprot((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
  
 -#define PAGE_HYP		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
 -#define PAGE_HYP_EXEC		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
 -#define PAGE_HYP_RO		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
 +#define PAGE_HYP		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
 +#define PAGE_HYP_EXEC		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
 +#define PAGE_HYP_RO		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
  #define PAGE_HYP_DEVICE		__pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
  
- #define PAGE_S2			__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
- #define PAGE_S2_DEVICE		__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
 -#define PAGE_S2			__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY | PTE_S2_XN)
 -#define PAGE_S2_DEVICE		__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_S2_XN)
++#define PAGE_S2			__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY | PTE_S2_XN)
++#define PAGE_S2_DEVICE		__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_S2_XN)
  
 -#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_PXN | PTE_UXN)
 +#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)
  #define PAGE_SHARED		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
  #define PAGE_SHARED_EXEC	__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
  #define PAGE_READONLY		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)

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

* Re: linux-next: manual merge of the kvm tree with the arm64 tree
  2018-02-07  1:27 Stephen Rothwell
@ 2018-02-07  8:29 ` Christoffer Dall
  0 siblings, 0 replies; 8+ messages in thread
From: Christoffer Dall @ 2018-02-07  8:29 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Paolo Bonzini, Radim Krčmář, KVM, Catalin Marinas,
	Linux-Next Mailing List, Linux Kernel Mailing List, Marc Zyngier,
	Will Deacon

On Wed, Feb 07, 2018 at 12:27:53PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the kvm tree got a conflict in:
> 
>   arch/arm64/include/asm/pgtable-prot.h
> 
> between commit:
> 
>   41acec624087 ("arm64: kpti: Make use of nG dependent on arm64_kernel_unmapped_at_el0()")
> 
> from the arm64 tree and commit:
> 
>   d0e22b4ac3ba ("KVM: arm/arm64: Limit icache invalidation to prefetch aborts")
> 
> 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.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc arch/arm64/include/asm/pgtable-prot.h
> index 2db84df5eb42,4e12dabd342b..000000000000
> --- a/arch/arm64/include/asm/pgtable-prot.h
> +++ b/arch/arm64/include/asm/pgtable-prot.h
> @@@ -53,24 -47,23 +53,24 @@@
>   #define PROT_SECT_NORMAL	(PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
>   #define PROT_SECT_NORMAL_EXEC	(PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
>   
>  -#define _PAGE_DEFAULT		(PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
>  +#define _PAGE_DEFAULT		(_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
>  +#define _HYP_PAGE_DEFAULT	_PAGE_DEFAULT
>   
>  -#define PAGE_KERNEL		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_WRITE)
>  -#define PAGE_KERNEL_RO		__pgprot(_PAGE_DEFAULT | PTE_PXN | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
>  -#define PAGE_KERNEL_ROX		__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_RDONLY)
>  -#define PAGE_KERNEL_EXEC	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE)
>  -#define PAGE_KERNEL_EXEC_CONT	__pgprot(_PAGE_DEFAULT | PTE_UXN | PTE_DIRTY | PTE_WRITE | PTE_CONT)
>  +#define PAGE_KERNEL		__pgprot(PROT_NORMAL)
>  +#define PAGE_KERNEL_RO		__pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
>  +#define PAGE_KERNEL_ROX		__pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
>  +#define PAGE_KERNEL_EXEC	__pgprot(PROT_NORMAL & ~PTE_PXN)
>  +#define PAGE_KERNEL_EXEC_CONT	__pgprot((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
>   
>  -#define PAGE_HYP		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
>  -#define PAGE_HYP_EXEC		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
>  -#define PAGE_HYP_RO		__pgprot(_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
>  +#define PAGE_HYP		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_HYP_XN)
>  +#define PAGE_HYP_EXEC		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY)
>  +#define PAGE_HYP_RO		__pgprot(_HYP_PAGE_DEFAULT | PTE_HYP | PTE_RDONLY | PTE_HYP_XN)
>   #define PAGE_HYP_DEVICE		__pgprot(PROT_DEVICE_nGnRE | PTE_HYP)
>   
> - #define PAGE_S2			__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
> - #define PAGE_S2_DEVICE		__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
>  -#define PAGE_S2			__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY | PTE_S2_XN)
>  -#define PAGE_S2_DEVICE		__pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_S2_XN)
> ++#define PAGE_S2			__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY | PTE_S2_XN)
> ++#define PAGE_S2_DEVICE		__pgprot(_PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_S2_XN)
>   
>  -#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_PXN | PTE_UXN)
>  +#define PAGE_NONE		__pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)
>   #define PAGE_SHARED		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
>   #define PAGE_SHARED_EXEC	__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
>   #define PAGE_READONLY		__pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN)


This looks correct to me.

Thanks,
-Christoffer

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

* linux-next: manual merge of the kvm tree with the arm64 tree
@ 2018-06-04  6:57 Stephen Rothwell
  2018-06-04  7:33 ` Dave Martin
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2018-06-04  6:57 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, KVM, Catalin Marinas,
	Will Deacon
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Dave Martin,
	Marc Zyngier

[-- Attachment #1: Type: text/plain, Size: 1901 bytes --]

Hi all,

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

  arch/arm64/include/asm/processor.h

between commit:

  94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv")

from the arm64 tree and commit:

  9a6e594869b2 ("arm64/sve: Move sve_pffr() to fpsimd.h and make inline")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/include/asm/processor.h
index 65ab83e8926e,c99e657fdd57..000000000000
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@@ -246,9 -246,17 +248,20 @@@ void cpu_enable_pan(const struct arm64_
  void cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused);
  void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused);
  
 +extern unsigned long __ro_after_init signal_minsigstksz; /* sigframe size */
 +extern void __init minsigstksz_setup(void);
 +
+ /*
+  * Not at the top of the file due to a direct #include cycle between
+  * <asm/fpsimd.h> and <asm/processor.h>.  Deferring this #include
+  * ensures that contents of processor.h are visible to fpsimd.h even if
+  * processor.h is included first.
+  *
+  * These prctl helpers are the only things in this file that require
+  * fpsimd.h.  The core code expects them to be in this header.
+  */
+ #include <asm/fpsimd.h>
+ 
  /* Userspace interface for PR_SVE_{SET,GET}_VL prctl()s: */
  #define SVE_SET_VL(arg)	sve_set_current_vl(arg)
  #define SVE_GET_VL()	sve_get_current_vl()

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the kvm tree with the arm64 tree
  2018-06-04  6:57 Stephen Rothwell
@ 2018-06-04  7:33 ` Dave Martin
  2018-06-05 17:08   ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Martin @ 2018-06-04  7:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Paolo Bonzini, Radim Krčmář, KVM, Catalin Marinas,
	Will Deacon, Linux-Next Mailing List, Linux Kernel Mailing List,
	Marc Zyngier

On Mon, Jun 04, 2018 at 04:57:54PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the kvm tree got a conflict in:
> 
>   arch/arm64/include/asm/processor.h
> 
> between commit:
> 
>   94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv")
> 
> from the arm64 tree and commit:
> 
>   9a6e594869b2 ("arm64/sve: Move sve_pffr() to fpsimd.h and make inline")
> 
> 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.

The resolution looks fine here, thanks.

---Dave

> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc arch/arm64/include/asm/processor.h
> index 65ab83e8926e,c99e657fdd57..000000000000
> --- a/arch/arm64/include/asm/processor.h
> +++ b/arch/arm64/include/asm/processor.h
> @@@ -246,9 -246,17 +248,20 @@@ void cpu_enable_pan(const struct arm64_
>   void cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused);
>   void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused);
>   
>  +extern unsigned long __ro_after_init signal_minsigstksz; /* sigframe size */
>  +extern void __init minsigstksz_setup(void);
>  +
> + /*
> +  * Not at the top of the file due to a direct #include cycle between
> +  * <asm/fpsimd.h> and <asm/processor.h>.  Deferring this #include
> +  * ensures that contents of processor.h are visible to fpsimd.h even if
> +  * processor.h is included first.
> +  *
> +  * These prctl helpers are the only things in this file that require
> +  * fpsimd.h.  The core code expects them to be in this header.
> +  */
> + #include <asm/fpsimd.h>
> + 
>   /* Userspace interface for PR_SVE_{SET,GET}_VL prctl()s: */
>   #define SVE_SET_VL(arg)	sve_set_current_vl(arg)
>   #define SVE_GET_VL()	sve_get_current_vl()

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

* Re: linux-next: manual merge of the kvm tree with the arm64 tree
  2018-06-04  7:33 ` Dave Martin
@ 2018-06-05 17:08   ` Paolo Bonzini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2018-06-05 17:08 UTC (permalink / raw)
  To: Dave Martin, Stephen Rothwell
  Cc: Radim Krčmář, KVM, Catalin Marinas, Will Deacon,
	Linux-Next Mailing List, Linux Kernel Mailing List, Marc Zyngier

On 04/06/2018 09:33, Dave Martin wrote:
> On Mon, Jun 04, 2018 at 04:57:54PM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> Today's linux-next merge of the kvm tree got a conflict in:
>>
>>   arch/arm64/include/asm/processor.h
>>
>> between commit:
>>
>>   94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv")
>>
>> from the arm64 tree and commit:
>>
>>   9a6e594869b2 ("arm64/sve: Move sve_pffr() to fpsimd.h and make inline")
>>
>> 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.
> 
> The resolution looks fine here, thanks.

Looks good, but it would have been even better if the ARM64 tree
provided a topic branch and the kvm/arm tree pulled it.

Thanks,

Paolo

> ---Dave
> 
>>
>> -- 
>> Cheers,
>> Stephen Rothwell
>>
>> diff --cc arch/arm64/include/asm/processor.h
>> index 65ab83e8926e,c99e657fdd57..000000000000
>> --- a/arch/arm64/include/asm/processor.h
>> +++ b/arch/arm64/include/asm/processor.h
>> @@@ -246,9 -246,17 +248,20 @@@ void cpu_enable_pan(const struct arm64_
>>   void cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused);
>>   void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused);
>>   
>>  +extern unsigned long __ro_after_init signal_minsigstksz; /* sigframe size */
>>  +extern void __init minsigstksz_setup(void);
>>  +
>> + /*
>> +  * Not at the top of the file due to a direct #include cycle between
>> +  * <asm/fpsimd.h> and <asm/processor.h>.  Deferring this #include
>> +  * ensures that contents of processor.h are visible to fpsimd.h even if
>> +  * processor.h is included first.
>> +  *
>> +  * These prctl helpers are the only things in this file that require
>> +  * fpsimd.h.  The core code expects them to be in this header.
>> +  */
>> + #include <asm/fpsimd.h>
>> + 
>>   /* Userspace interface for PR_SVE_{SET,GET}_VL prctl()s: */
>>   #define SVE_SET_VL(arg)	sve_set_current_vl(arg)
>>   #define SVE_GET_VL()	sve_get_current_vl()
> 
> 

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

* linux-next: manual merge of the kvm tree with the arm64 tree
@ 2024-10-28  6:03 Stephen Rothwell
  2024-10-28 17:44 ` Catalin Marinas
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Rothwell @ 2024-10-28  6:03 UTC (permalink / raw)
  To: Paolo Bonzini, Catalin Marinas, Will Deacon
  Cc: KVM, Linux Kernel Mailing List, Linux Next Mailing List,
	Sean Christopherson, Yang Shi

[-- Attachment #1: Type: text/plain, Size: 1763 bytes --]

Hi all,

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

  arch/arm64/kvm/guest.c

between commit:

  25c17c4b55de ("hugetlb: arm64: add mte support")

from the arm64 tree and commit:

  570d666c11af ("KVM: arm64: Use __gfn_to_page() when copying MTE tags to/from userspace")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/kvm/guest.c
index e738a353b20e,4cd7ffa76794..000000000000
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@@ -1051,13 -1051,11 +1051,12 @@@ int kvm_vm_ioctl_mte_copy_tags(struct k
  	}
  
  	while (length > 0) {
- 		kvm_pfn_t pfn = gfn_to_pfn_prot(kvm, gfn, write, NULL);
+ 		struct page *page = __gfn_to_page(kvm, gfn, write);
  		void *maddr;
  		unsigned long num_tags;
- 		struct page *page;
 +		struct folio *folio;
  
- 		if (is_error_noslot_pfn(pfn)) {
+ 		if (!page) {
  			ret = -EFAULT;
  			goto out;
  		}
@@@ -1099,12 -1090,8 +1097,12 @@@
  			/* uaccess failed, don't leave stale tags */
  			if (num_tags != MTE_GRANULES_PER_PAGE)
  				mte_clear_page_tags(maddr);
 -			set_page_mte_tagged(page);
 +			if (folio_test_hugetlb(folio))
 +				folio_set_hugetlb_mte_tagged(folio);
 +			else
 +				set_page_mte_tagged(page);
 +
- 			kvm_release_pfn_dirty(pfn);
+ 			kvm_release_page_dirty(page);
  		}
  
  		if (num_tags != MTE_GRANULES_PER_PAGE) {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

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

* Re: linux-next: manual merge of the kvm tree with the arm64 tree
  2024-10-28  6:03 linux-next: manual merge of the kvm tree with the arm64 tree Stephen Rothwell
@ 2024-10-28 17:44 ` Catalin Marinas
  2024-10-28 18:06   ` Sean Christopherson
  0 siblings, 1 reply; 8+ messages in thread
From: Catalin Marinas @ 2024-10-28 17:44 UTC (permalink / raw)
  To: Stephen Rothwell, Paolo Bonzini, Marc Zyngier, Oliver Upton
  Cc: Will Deacon, KVM, Linux Kernel Mailing List,
	Linux Next Mailing List, Sean Christopherson, Yang Shi

On Mon, Oct 28, 2024 at 05:03:10PM +1100, Stephen Rothwell wrote:
> Today's linux-next merge of the kvm tree got a conflict in:
> 
>   arch/arm64/kvm/guest.c
> 
> between commit:
> 
>   25c17c4b55de ("hugetlb: arm64: add mte support")
> 
> from the arm64 tree and commit:
> 
>   570d666c11af ("KVM: arm64: Use __gfn_to_page() when copying MTE tags to/from userspace")
> 
> from the kvm tree.
[...]
> diff --cc arch/arm64/kvm/guest.c
> index e738a353b20e,4cd7ffa76794..000000000000
> --- a/arch/arm64/kvm/guest.c
> +++ b/arch/arm64/kvm/guest.c
> @@@ -1051,13 -1051,11 +1051,12 @@@ int kvm_vm_ioctl_mte_copy_tags(struct k
>   	}
>   
>   	while (length > 0) {
> - 		kvm_pfn_t pfn = gfn_to_pfn_prot(kvm, gfn, write, NULL);
> + 		struct page *page = __gfn_to_page(kvm, gfn, write);
>   		void *maddr;
>   		unsigned long num_tags;
> - 		struct page *page;
>  +		struct folio *folio;
>   
> - 		if (is_error_noslot_pfn(pfn)) {
> + 		if (!page) {
>   			ret = -EFAULT;
>   			goto out;
>   		}
> @@@ -1099,12 -1090,8 +1097,12 @@@
>   			/* uaccess failed, don't leave stale tags */
>   			if (num_tags != MTE_GRANULES_PER_PAGE)
>   				mte_clear_page_tags(maddr);
>  -			set_page_mte_tagged(page);
>  +			if (folio_test_hugetlb(folio))
>  +				folio_set_hugetlb_mte_tagged(folio);
>  +			else
>  +				set_page_mte_tagged(page);
>  +
> - 			kvm_release_pfn_dirty(pfn);
> + 			kvm_release_page_dirty(page);
>   		}
>   
>   		if (num_tags != MTE_GRANULES_PER_PAGE) {

Thanks Stephen. The resolution looks fine and I'm happy to leave to
Linus to fix it up during the merging window.

To the KVM maintainers, if you prefer a conflict-free linux-next, feel
free to pull the arm64 for-next/mte branch with the above commit (and a
kselftest). The other way around is not something I'd suggest we do,
there are over 80 patches in that kvm series.

-- 
Catalin

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

* Re: linux-next: manual merge of the kvm tree with the arm64 tree
  2024-10-28 17:44 ` Catalin Marinas
@ 2024-10-28 18:06   ` Sean Christopherson
  0 siblings, 0 replies; 8+ messages in thread
From: Sean Christopherson @ 2024-10-28 18:06 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Stephen Rothwell, Paolo Bonzini, Marc Zyngier, Oliver Upton,
	Will Deacon, KVM, Linux Kernel Mailing List,
	Linux Next Mailing List, Yang Shi

On Mon, Oct 28, 2024, Catalin Marinas wrote:
> On Mon, Oct 28, 2024 at 05:03:10PM +1100, Stephen Rothwell wrote:
> > Today's linux-next merge of the kvm tree got a conflict in:
> > 
> >   arch/arm64/kvm/guest.c
> > 
> > between commit:
> > 
> >   25c17c4b55de ("hugetlb: arm64: add mte support")
> > 
> > from the arm64 tree and commit:
> > 
> >   570d666c11af ("KVM: arm64: Use __gfn_to_page() when copying MTE tags to/from userspace")
> > 
> > from the kvm tree.
> [...]
> > diff --cc arch/arm64/kvm/guest.c
> > index e738a353b20e,4cd7ffa76794..000000000000
> > --- a/arch/arm64/kvm/guest.c
> > +++ b/arch/arm64/kvm/guest.c
> > @@@ -1051,13 -1051,11 +1051,12 @@@ int kvm_vm_ioctl_mte_copy_tags(struct k
> >   	}
> >   
> >   	while (length > 0) {
> > - 		kvm_pfn_t pfn = gfn_to_pfn_prot(kvm, gfn, write, NULL);
> > + 		struct page *page = __gfn_to_page(kvm, gfn, write);
> >   		void *maddr;
> >   		unsigned long num_tags;
> > - 		struct page *page;
> >  +		struct folio *folio;
> >   
> > - 		if (is_error_noslot_pfn(pfn)) {
> > + 		if (!page) {
> >   			ret = -EFAULT;
> >   			goto out;
> >   		}
> > @@@ -1099,12 -1090,8 +1097,12 @@@
> >   			/* uaccess failed, don't leave stale tags */
> >   			if (num_tags != MTE_GRANULES_PER_PAGE)
> >   				mte_clear_page_tags(maddr);
> >  -			set_page_mte_tagged(page);
> >  +			if (folio_test_hugetlb(folio))
> >  +				folio_set_hugetlb_mte_tagged(folio);
> >  +			else
> >  +				set_page_mte_tagged(page);
> >  +
> > - 			kvm_release_pfn_dirty(pfn);
> > + 			kvm_release_page_dirty(page);
> >   		}
> >   
> >   		if (num_tags != MTE_GRANULES_PER_PAGE) {
> 
> Thanks Stephen. The resolution looks fine

Looks correct to my eyes, too.  Thanks Stephen!

> and I'm happy to leave to Linus to fix it up during the merging window.
> 
> To the KVM maintainers, if you prefer a conflict-free linux-next, feel
> free to pull the arm64 for-next/mte branch with the above commit (and a
> kselftest). The other way around is not something I'd suggest we do,
> there are over 80 patches in that kvm series.

Not feeling lucky today? ;-)

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

end of thread, other threads:[~2024-10-28 18:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28  6:03 linux-next: manual merge of the kvm tree with the arm64 tree Stephen Rothwell
2024-10-28 17:44 ` Catalin Marinas
2024-10-28 18:06   ` Sean Christopherson
  -- strict thread matches above, loose matches on Subject: below --
2018-06-04  6:57 Stephen Rothwell
2018-06-04  7:33 ` Dave Martin
2018-06-05 17:08   ` Paolo Bonzini
2018-02-07  1:27 Stephen Rothwell
2018-02-07  8:29 ` Christoffer Dall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).