LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/5] powerpc/mpic: Add non-contiguous interrupt sources
From: Bharat Bhushan @ 2018-07-27  9:47 UTC (permalink / raw)
  To: benh, paulus, mpe, oss, galak, mark.rutland, kstewart, gregkh,
	devicetree, linuxppc-dev, linux-kernel
  Cc: robh, keescook, tyreld, joe, Bharat Bhushan

Freescale MPIC h/w may not support all interrupt sources reported
by hardware or "last-interrupt-source" or platform. On these platforms
a misconfigured device tree that assigns one of the reserved
interrupts leaves a non-functioning system without warning.
 
First Patch just moves the last-irq calculation logic to a function,
Second patch reworks same logic, While I feel that device-tree should
 get precedence over platform provided last-irq, but in this series
 I have not changed this logic.
Third and fourth patch add non-contiguous interrupt sources support
Fifth patch enables this for P2020RDB-PC for now.

Bharat Bhushan (5):
  powerpc/mpic: move last irq logic to function
  powerpc/mpic: Rework last source irq calculation logic
  powerpc/mpic: Add support for non-contiguous irq ranges
  powerpc/mpic: Boot print supported interrupt ranges
  powerpc/fsl: Add supported-irq-ranges for P2020

 .../devicetree/bindings/powerpc/fsl/mpic.txt       |   8 +
 arch/powerpc/boot/dts/fsl/p2020si-post.dtsi        |   3 +
 arch/powerpc/include/asm/mpic.h                    |   9 +
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |   5 +
 arch/powerpc/sysdev/mpic.c                         | 184 ++++++++++++++++++---
 5 files changed, 182 insertions(+), 27 deletions(-)

-- 
1.9.3

^ permalink raw reply

* Re: linux-next: manual merge of the staging tree with the powerpc tree
From: Greg KH @ 2018-07-27  8:36 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Michael Ellerman, Benjamin Herrenschmidt, PowerPC,
	Linux-Next Mailing List, Linux Kernel Mailing List, Stefan Popa,
	Jonathan Cameron, Michael Hanselmann
In-Reply-To: <20180727175911.76ed6d44@canb.auug.org.au>

On Fri, Jul 27, 2018 at 05:59:11PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the staging tree got a conflict in:
> 
>   MAINTAINERS
> 
> between commit:
> 
>   d69ccc00c497 ("MAINTAINERS: Remove the entry for the orphaned ams driver")
> 
> from the powerpc tree and commit:
> 
>   28d1a7ac2a0d ("iio: dac: Add AD5758 support")
> 
> from the staging 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.

Looks good to me, thanks!

greg k-h

^ permalink raw reply

* linux-next: manual merge of the staging tree with the powerpc tree
From: Stephen Rothwell @ 2018-07-27  7:59 UTC (permalink / raw)
  To: Greg KH, Michael Ellerman, Benjamin Herrenschmidt, PowerPC
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Stefan Popa,
	Jonathan Cameron, Michael Hanselmann

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

Hi all,

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

  MAINTAINERS

between commit:

  d69ccc00c497 ("MAINTAINERS: Remove the entry for the orphaned ams driver")

from the powerpc tree and commit:

  28d1a7ac2a0d ("iio: dac: Add AD5758 support")

from the staging 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 MAINTAINERS
index fc92aab3ca2a,b9503cefc42d..000000000000
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@@ -807,6 -791,19 +807,14 @@@ S:	Supporte
  F:	drivers/net/ethernet/amd/xgbe/
  F:	arch/arm64/boot/dts/amd/amd-seattle-xgbe*.dtsi
  
 -AMS (Apple Motion Sensor) DRIVER
 -M:	Michael Hanselmann <linux-kernel@hansmi.ch>
 -S:	Supported
 -F:	drivers/macintosh/ams/
 -
+ ANALOG DEVICES INC AD5758 DRIVER
+ M:	Stefan Popa <stefan.popa@analog.com>
+ L:	linux-iio@vger.kernel.org
+ W:	http://ez.analog.com/community/linux-device-drivers
+ S:	Supported
+ F:	drivers/iio/dac/ad5758.c
+ F:	Documentation/devicetree/bindings/iio/dac/ad5758.txt
+ 
  ANALOG DEVICES INC AD5686 DRIVER
  M:	Stefan Popa <stefan.popa@analog.com>
  L:	linux-pm@vger.kernel.org

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

^ permalink raw reply

* Re: [PATCH] powerpc/64s: fix page table fragment refcount race vs speculative references
From: Aneesh Kumar K.V @ 2018-07-27  6:58 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev
In-Reply-To: <87tvonv621.fsf@linux.ibm.com>


Adding the list back.

Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> writes:

> Nicholas Piggin <npiggin@gmail.com> writes:
>
>> The page table fragment allocator uses the main page refcount racily
>> with respect to speculative references. A customer observed a BUG due
>> to page table page refcount underflow in the fragment allocator. This
>> can be caused by the fragment allocator set_page_count stomping on a
>> speculative reference, and then the speculative failure handler
>> decrements the new reference, and the underflow eventually pops when
>> the page tables are freed.
>>
>> Fix this by using a dedicated field in the struct page for the page
>> table fragment allocator.
>>
>
> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>
>> Fixes: 5c1f6ee9a31c ("powerpc: Reduce PTE table memory wastage")
>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>> ---
>>  arch/powerpc/mm/mmu_context_book3s64.c |  8 ++++----
>>  arch/powerpc/mm/pgtable-book3s64.c     | 17 +++++++++++------
>>  include/linux/mm_types.h               |  5 ++++-
>>  3 files changed, 19 insertions(+), 11 deletions(-)
>>
>> diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
>> index f3d4b4a0e561..3bb5cec03d1f 100644
>> --- a/arch/powerpc/mm/mmu_context_book3s64.c
>> +++ b/arch/powerpc/mm/mmu_context_book3s64.c
>> @@ -200,9 +200,9 @@ static void pte_frag_destroy(void *pte_frag)
>>  	/* drop all the pending references */
>>  	count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
>>  	/* We allow PTE_FRAG_NR fragments from a PTE page */
>> -	if (page_ref_sub_and_test(page, PTE_FRAG_NR - count)) {
>> +	if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
>>  		pgtable_page_dtor(page);
>> -		free_unref_page(page);
>> +		__free_page(page);
>>  	}
>>  }
>>
>> @@ -215,9 +215,9 @@ static void pmd_frag_destroy(void *pmd_frag)
>>  	/* drop all the pending references */
>>  	count = ((unsigned long)pmd_frag & ~PAGE_MASK) >> PMD_FRAG_SIZE_SHIFT;
>>  	/* We allow PTE_FRAG_NR fragments from a PTE page */
>> -	if (page_ref_sub_and_test(page, PMD_FRAG_NR - count)) {
>> +	if (atomic_sub_and_test(PMD_FRAG_NR - count, &page->pt_frag_refcount)) {
>>  		pgtable_pmd_page_dtor(page);
>> -		free_unref_page(page);
>> +		__free_page(page);
>>  	}
>>  }
>>
>> diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
>> index 4afbfbb64bfd..78d0b3d5ebad 100644
>> --- a/arch/powerpc/mm/pgtable-book3s64.c
>> +++ b/arch/powerpc/mm/pgtable-book3s64.c
>> @@ -270,6 +270,8 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
>>  		return NULL;
>>  	}
>>
>> +	atomic_set(&page->pt_frag_refcount, 1);
>> +
>>  	ret = page_address(page);
>>  	/*
>>  	 * if we support only one fragment just return the
>> @@ -285,7 +287,7 @@ static pmd_t *__alloc_for_pmdcache(struct mm_struct *mm)
>>  	 * count.
>>  	 */
>>  	if (likely(!mm->context.pmd_frag)) {
>> -		set_page_count(page, PMD_FRAG_NR);
>> +		atomic_set(&page->pt_frag_refcount, PMD_FRAG_NR);
>>  		mm->context.pmd_frag = ret + PMD_FRAG_SIZE;
>>  	}
>>  	spin_unlock(&mm->page_table_lock);
>> @@ -308,9 +310,10 @@ void pmd_fragment_free(unsigned long *pmd)
>>  {
>>  	struct page *page = virt_to_page(pmd);
>>
>> -	if (put_page_testzero(page)) {
>> +	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
>> +	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
>>  		pgtable_pmd_page_dtor(page);
>> -		free_unref_page(page);
>> +		__free_page(page);
>>  	}
>>  }
>>
>> @@ -352,6 +355,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
>>  			return NULL;
>>  	}
>>
>> +	atomic_set(&page->pt_frag_refcount, 1);
>>
>>  	ret = page_address(page);
>>  	/*
>> @@ -367,7 +371,7 @@ static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel)
>>  	 * count.
>>  	 */
>>  	if (likely(!mm->context.pte_frag)) {
>> -		set_page_count(page, PTE_FRAG_NR);
>> +		atomic_set(&page->pt_frag_refcount, PTE_FRAG_NR);
>>  		mm->context.pte_frag = ret + PTE_FRAG_SIZE;
>>  	}
>>  	spin_unlock(&mm->page_table_lock);
>> @@ -390,10 +394,11 @@ void pte_fragment_free(unsigned long *table, int kernel)
>>  {
>>  	struct page *page = virt_to_page(table);
>>
>> -	if (put_page_testzero(page)) {
>> +	BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
>> +	if (atomic_dec_and_test(&page->pt_frag_refcount)) {
>>  		if (!kernel)
>>  			pgtable_page_dtor(page);
>> -		free_unref_page(page);
>> +		__free_page(page);
>>  	}
>>  }
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 99ce070e7dcb..22651e124071 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -139,7 +139,10 @@ struct page {
>>  			unsigned long _pt_pad_1;	/* compound_head */
>>  			pgtable_t pmd_huge_pte; /* protected by page->ptl */
>>  			unsigned long _pt_pad_2;	/* mapping */
>> -			struct mm_struct *pt_mm;	/* x86 pgds only */
>> +			union {
>> +				struct mm_struct *pt_mm; /* x86 pgds only */
>> +				atomic_t pt_frag_refcount; /* powerpc */
>> +			};
>>  #if ALLOC_SPLIT_PTLOCKS
>>  			spinlock_t *ptl;
>>  #else
>> -- 
>> 2.17.0

^ permalink raw reply

* Re: [PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives
From: Alexandre Ghiti @ 2018-07-27  6:51 UTC (permalink / raw)
  To: Mike Kravetz, Michael Ellerman, Michal Hocko
  Cc: linux, catalin.marinas, will.deacon, tony.luck, fenghua.yu, ralf,
	paul.burton, jhogan, jejb, deller, benh, paulus, ysato, dalias,
	davem, tglx, mingo, hpa, x86, arnd, linux-arm-kernel,
	linux-kernel, linux-ia64, linux-mips, linux-parisc, linuxppc-dev,
	linux-sh, sparclinux, linux-arch, Naoya Horiguchi,
	Aneesh Kumar K . V
In-Reply-To: <99473e0d-12d8-bbea-fe9c-4e3738ab7f5a@oracle.com>

Hi Mike,

Thanks for your review. I'm going to fix the 2nd patch as you said, 
you're right, no need to move the #include at the bottom of the file.
I'm going to post a v5, add -mm in cc and ask for inclusion in their tree.

Thanks again for your time,

Alex


On 07/26/2018 09:16 PM, Mike Kravetz wrote:
> On 07/26/2018 04:46 AM, Michael Ellerman wrote:
>> Mike Kravetz <mike.kravetz@oracle.com> writes:
>>
>>> On 07/20/2018 11:37 AM, Alex Ghiti wrote:
>>>> Does anyone have any suggestion about those patches ?
>>> I only took a quick look.  From the hugetlb perspective, I like the
>>> idea of moving routines to a common file.  If any of the arch owners
>>> (or anyone else) agree, I can do a review of the series.
>> The conversions look pretty good to me. If you want to give it a review
>> then from my point of view it could go in -mm to shake out any bugs.
> Nothing of significance found in a review.  As others have suggested,
> the (cross)compiler may be better at finding issues than human eyes.
>
> I also suggest it be added to -mm.

^ permalink raw reply

* Re: [PATCH v07 2/9] hotplug/cpu: Add operation queuing function
From: Michael Ellerman @ 2018-07-27  6:09 UTC (permalink / raw)
  To: Michael Bringmann, Nathan Fontenot, linuxppc-dev
  Cc: John Allen, Thomas Falcon, Tyrel Datwyler
In-Reply-To: <680c77f2-734c-aad5-03c6-5dbc92a0dedb@linux.vnet.ibm.com>

Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
> On 07/23/2018 12:51 PM, Nathan Fontenot wrote:
>> On 07/13/2018 03:18 PM, Michael Bringmann wrote:
...
>>> +
>>> +int dlpar_queued_actions_run(void)
>>> +{
>>> +=C2=A0=C2=A0=C2=A0 if (!list_empty(&dlpar_delayed_list)) {
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct pseries_hp_errorlog =
hp_errlog;
>>> +
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hp_errlog.resource =3D PSER=
IES_HP_ELOG_RESOURCE_PMT;
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hp_errlog.action =3D 0;
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hp_errlog.id_type =3D 0;
>>> +
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 queue_hotplug_event(&hp_err=
log, 0, 0); > +=C2=A0=C2=A0=C2=A0 }
>>> +=C2=A0=C2=A0=C2=A0 return 0;
>>> +}
>>=20
>> I'm a bit confused by this. Is there a reason this needs to queue a
>> hotplug event instead of just walking the list as is done in dlpar_pmt?
>
> Up to this point, the operations have only been added to 'dlpar_delayed_l=
ist'.
> This function separates the execution of the CPU readd and Memory readd
> operations from the execution of 'migration store'.  If we walk the list
> here, then we add the execution time of all of the readd operations to
> the time of 'migration store'.  This is not a large problem in small
> systems like we have in the Kernel Team.  This may be a major issue thoug=
h,
> for production SAP HANA systems where we may be readding thousands of pag=
es
> of memory.  By pushing the execution of the CPU readd and Memory readd
> operations after, and separate, from the execution of 'migration store',
> we do not delay the end of the operation or the return of the completion
> status to an associated HMC.

But you can't return completion status, because the operation hasn't
completed.

The migration isn't finished until we've updated the topology for the
new system.

If you decouple things like this you now have no way of reporting
progress or an error to the caller.

So I'm unconvinced this is the right solution.

cheers

^ permalink raw reply

* Re: [PATCH v07 2/9] hotplug/cpu: Add operation queuing function
From: Michael Ellerman @ 2018-07-27  5:57 UTC (permalink / raw)
  To: Michael Bringmann, John Allen
  Cc: Nathan Fontenot, linuxppc-dev, Tyrel Datwyler, Thomas Falcon,
	John Allen
In-Reply-To: <0bcf83ad-0d06-2311-e9c6-cd66326b5f93@linux.vnet.ibm.com>

Michael Bringmann <mwb@linux.vnet.ibm.com> writes:
> On 07/23/2018 10:54 AM, John Allen wrote:
>> On Fri, Jul 13, 2018 at 03:18:01PM -0500, Michael Bringmann wrote:
>>> @@ -407,6 +413,61 @@ void queue_hotplug_event(struct pseries_hp_errorlo=
g *hp_errlog,
...
>>> +
>>> +static int dlpar_pmt(struct pseries_hp_errorlog *work)
>>> +{
>>> +=C2=A0=C2=A0=C2=A0 struct list_head *pos, *q;
>>> +
>>> +=C2=A0=C2=A0=C2=A0 ssleep(15);
>>=20
>> Why do we need to sleep for so long here?
>
> One or more drivers were finishing their initialization about the same
> time as the 'migration_store' operation was completing.  E.g. 'ibmvscsi'
> When we did 'dlpar cpu readd' operations at the same time early on in
> testing, the errors / warnings were inconsistent.  I put in a delay to
> get beyond the driver re-init after migration.  15 seconds was an estimat=
e.
> As it occurs after the completion of the 'migration store' operation,
> it does not delay any responses returned to the HMC.
>
> We can rerun tests with reduced / removed delays to see if they are still
> necessary given some other corrections in the mix.

Please do.

I'm not inclined to merge code with "sleep 15" in it, unless there's
some incredibly good reason for it.

cheers

^ permalink raw reply

* Re: [PATCH 2/3] selftests/powerpc: Only run some tests on ppc64le
From: Michael Ellerman @ 2018-07-27  5:51 UTC (permalink / raw)
  To: Gustavo Romero, linuxppc-dev
In-Reply-To: <6f71e169-7d73-9128-5cff-72efcf734e7d@linux.vnet.ibm.com>

Gustavo Romero <gromero@linux.vnet.ibm.com> writes:

> Hi Michael,
>
> On 07/26/2018 09:24 AM, Michael Ellerman wrote:
>> These tests are currently failing on (some) big endian systems. Until
>> we can fix that, skip them unless we're on ppc64le.
>
> I can take a look at this.

Thanks!

> Is that the same issue related to the gcc version we discussed a month ago?

Maybe, I've forgotten :)

> If not, could you provide the crash logs as a starting point?

There's not much:

  test: tm_tar
  tags: git_version:9794259
  failure: tm_tar
  run-parts: ./tm-tar exited with return code 1
  
  test: tm_vmxcopy
  tags: git_version:9794259
  !! child died by signal 11
  failure: tm_vmxcopy
  run-parts: ./tm-vmxcopy exited with return code 1

And now I can't get the sigreturn one to fail :/


cheers

^ permalink raw reply

* [PATCH] of/fdt: Remove PPC32 longtrail hack in memory scan
From: Michael Ellerman @ 2018-07-27  5:35 UTC (permalink / raw)
  To: devicetree, robh+dt, frowand.list; +Cc: paulus, linuxppc-dev

When the OF code was originally made common by Grant in commit
51975db0b733 ("of/flattree: merge early_init_dt_scan_memory() common
code") (Feb 2010), the common code inherited a hack to handle
PPC "longtrail" machines, which had a "memory@0" node with no
device_type.

That check was then made to only apply to PPC32 in b44aa25d20e2 ("of:
Handle memory@0 node on PPC32 only") (May 2014).

But according to Paul Mackerras the "longtrail" machines are long
dead, if they were ever seen in the wild at all. If someone does still
have one, we can handle this firmware wart in powerpc platform code.

So remove the hack once and for all.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 drivers/of/fdt.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 6da20b9688f7..800ad252cf9c 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1034,14 +1034,7 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
 	bool hotpluggable;
 
 	/* We are scanning "memory" nodes only */
-	if (type == NULL) {
-		/*
-		 * The longtrail doesn't have a device_type on the
-		 * /memory node, so look for the node called /memory@0.
-		 */
-		if (!IS_ENABLED(CONFIG_PPC32) || depth != 1 || strcmp(uname, "memory@0") != 0)
-			return 0;
-	} else if (strcmp(type, "memory") != 0)
+	if (type == NULL || strcmp(type, "memory") != 0)
 		return 0;
 
 	reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
-- 
2.14.1

^ permalink raw reply related

* Re: [PATCH kernel RFC 1/3] powerpc/pseries/iommu: Allow dynamic window to start from zero
From: David Gibson @ 2018-07-27  3:42 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: linuxppc-dev, kvm-ppc, Benjamin Herrenschmidt, Michael Ellerman,
	Paul Mackerras, Russell Currey
In-Reply-To: <20180725095032.2196-2-aik@ozlabs.ru>

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

On Wed, Jul 25, 2018 at 07:50:30PM +1000, Alexey Kardashevskiy wrote:
> At the moment the kernel does not expect dynamic windows to ever start
> at zero on a PCI bus as PAPR requires the hypervisor to create a 32bit
> default window which starts from zero and the pseries kernel only
> creates additional windows.
> 
> However PAPR permits removing the default window and creating another
> one instead, starting from zero as well. In fact, the kernel used to
> remove the default window after sha1 25ebc45b934 but this has been
> reverted later.
> 
> Since there are devices capable of more than 32 bits for DMA but less than
> 50, and currently available hardware allows the second window only
> at 1<<59, we will need to be able to create bigger windows starting from
> zero. This does the initial preparation and should not cause any
> behavioral changes.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  arch/powerpc/platforms/pseries/iommu.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 06f0296..9ece42f 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -53,6 +53,8 @@
>  
>  #include "pseries.h"
>  
> +#define DDW_INVALID_OFFSET	((uint64_t)-1)
> +
>  static struct iommu_table_group *iommu_pseries_alloc_group(int node)
>  {
>  	struct iommu_table_group *table_group;
> @@ -844,7 +846,7 @@ static u64 find_existing_ddw(struct device_node *pdn)
>  {
>  	struct direct_window *window;
>  	const struct dynamic_dma_window_prop *direct64;
> -	u64 dma_addr = 0;
> +	u64 dma_addr = DDW_INVALID_OFFSET;
>  
>  	spin_lock(&direct_window_list_lock);
>  	/* check if we already created a window and dupe that config if so */
> @@ -992,7 +994,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
>  	mutex_lock(&direct_window_init_mutex);
>  
>  	dma_addr = find_existing_ddw(pdn);
> -	if (dma_addr != 0)
> +	if (dma_addr != DDW_INVALID_OFFSET)
>  		goto out_unlock;
>  
>  	/*
> @@ -1228,7 +1230,7 @@ static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
>  		}
>  		if (pdn && PCI_DN(pdn)) {
>  			dma_offset = enable_ddw(pdev, pdn);
> -			if (dma_offset != 0) {
> +			if (dma_offset != DDW_INVALID_OFFSET) {
>  				dev_info(dev, "Using 64-bit direct DMA at offset %llx\n", dma_offset);
>  				set_dma_offset(dev, dma_offset);
>  				set_dma_ops(dev, &dma_nommu_ops);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH v4 02/11] hugetlb: Introduce generic version of hugetlb_free_pgd_range
From: Mike Kravetz @ 2018-07-26 18:45 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-3-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, arm64, mips, parisc, sh, x86 architectures use the
> same version of hugetlb_free_pgd_range, so move this generic
> implementation into asm-generic/hugetlb.h.
> 

Just one small issue below.  Not absolutely necessary to fix.
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb.h     | 12 ++----------
>  arch/arm64/include/asm/hugetlb.h   | 10 ----------
>  arch/ia64/include/asm/hugetlb.h    |  5 +++--
>  arch/mips/include/asm/hugetlb.h    | 13 ++-----------
>  arch/parisc/include/asm/hugetlb.h  | 12 ++----------
>  arch/powerpc/include/asm/hugetlb.h |  4 +++-
>  arch/sh/include/asm/hugetlb.h      | 12 ++----------
>  arch/sparc/include/asm/hugetlb.h   |  4 +++-
>  arch/x86/include/asm/hugetlb.h     | 11 ++---------
>  include/asm-generic/hugetlb.h      | 11 +++++++++++
>  10 files changed, 30 insertions(+), 64 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
> index 7d26f6c4f0f5..047b893ef95d 100644
> --- a/arch/arm/include/asm/hugetlb.h
> +++ b/arch/arm/include/asm/hugetlb.h
> @@ -23,19 +23,9 @@
>  #define _ASM_ARM_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
>  
>  #include <asm/hugetlb-3level.h>
>  
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr, unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
> -
>  static inline int is_hugepage_only_range(struct mm_struct *mm,
>  					 unsigned long addr, unsigned long len)
>  {
> @@ -68,4 +58,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  	clear_bit(PG_dcache_clean, &page->flags);
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +

I don't think moving the #include is necessary in this case where you are
not adding a __HAVE_ARCH_HUGE* definition.  I like having all the #include
statements at the top if possible.
-- 
Mike Kravetz

>  #endif /* _ASM_ARM_HUGETLB_H */
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 3fcf14663dfa..4af1a800a900 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -25,16 +25,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return READ_ONCE(*ptep);
>  }
>  
> -
> -
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr, unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
>  static inline int is_hugepage_only_range(struct mm_struct *mm,
>  					 unsigned long addr, unsigned long len)
>  {
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index 74d2a5540aaf..afe9fa4d969b 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -3,9 +3,8 @@
>  #define _ASM_IA64_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
> -
>  
> +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
>  void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
>  			    unsigned long end, unsigned long floor,
>  			    unsigned long ceiling);
> @@ -70,4 +69,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* _ASM_IA64_HUGETLB_H */
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 982bc0685330..53764050243e 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -10,8 +10,6 @@
>  #define __ASM_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
> -
>  
>  static inline int is_hugepage_only_range(struct mm_struct *mm,
>  					 unsigned long addr,
> @@ -38,15 +36,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr,
> -					  unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
>  static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  				   pte_t *ptep, pte_t pte)
>  {
> @@ -114,4 +103,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* __ASM_HUGETLB_H */
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 58e0f4620426..28c23b68d38d 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -3,8 +3,6 @@
>  #define _ASM_PARISC64_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
> -
>  
>  void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  		     pte_t *ptep, pte_t pte);
> @@ -32,14 +30,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr, unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> @@ -71,4 +61,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* _ASM_PARISC64_HUGETLB_H */
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 3225eb6402cc..a7d5c739df9b 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -4,7 +4,6 @@
>  
>  #ifdef CONFIG_HUGETLB_PAGE
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
>  
>  extern struct kmem_cache *hugepte_cache;
>  
> @@ -113,6 +112,7 @@ static inline void flush_hugetlb_page(struct vm_area_struct *vma,
>  void flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
>  #endif
>  
> +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
>  void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
>  			    unsigned long end, unsigned long floor,
>  			    unsigned long ceiling);
> @@ -179,6 +179,8 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #else /* ! CONFIG_HUGETLB_PAGE */
>  static inline void flush_hugetlb_page(struct vm_area_struct *vma,
>  				      unsigned long vmaddr)
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index 735939c0f513..f6a51b609409 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -4,8 +4,6 @@
>  
>  #include <asm/cacheflush.h>
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
> -
>  
>  static inline int is_hugepage_only_range(struct mm_struct *mm,
>  					 unsigned long addr,
> @@ -27,14 +25,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr, unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
>  static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  				   pte_t *ptep, pte_t pte)
>  {
> @@ -85,4 +75,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  	clear_bit(PG_dcache_clean, &page->flags);
>  }
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* _ASM_SH_HUGETLB_H */
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 300557c66698..59d89b52ccb7 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -3,7 +3,6 @@
>  #define _ASM_SPARC64_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
>  
>  #ifdef CONFIG_HUGETLB_PAGE
>  struct pud_huge_patch_entry {
> @@ -84,8 +83,11 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
>  
> +#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
>  void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
>  			    unsigned long end, unsigned long floor,
>  			    unsigned long ceiling);
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* _ASM_SPARC64_HUGETLB_H */
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 5ed826da5e07..996ce8e15365 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -3,7 +3,6 @@
>  #define _ASM_X86_HUGETLB_H
>  
>  #include <asm/page.h>
> -#include <asm-generic/hugetlb.h>
>  
>  #define hugepages_supported() boot_cpu_has(X86_FEATURE_PSE)
>  
> @@ -28,14 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> -					  unsigned long addr, unsigned long end,
> -					  unsigned long floor,
> -					  unsigned long ceiling)
> -{
> -	free_pgd_range(tlb, addr, end, floor, ceiling);
> -}
> -
>  static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  				   pte_t *ptep, pte_t pte)
>  {
> @@ -90,4 +81,6 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  static inline bool gigantic_page_supported(void) { return true; }
>  #endif
>  
> +#include <asm-generic/hugetlb.h>
> +
>  #endif /* _ASM_X86_HUGETLB_H */
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 3da7cff52360..c697ca9dda18 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -40,4 +40,15 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
> +static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> +		unsigned long addr, unsigned long end,
> +		unsigned long floor, unsigned long ceiling)
> +{
> +	free_pgd_range(tlb, addr, end, floor, ceiling);
> +}
> +
> +
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives
From: Helge Deller @ 2018-07-26 21:08 UTC (permalink / raw)
  To: Alex Ghiti
  Cc: Michael Ellerman, Michal Hocko, linux, catalin.marinas,
	will.deacon, tony.luck, fenghua.yu, ralf, paul.burton, jhogan,
	jejb, benh, paulus, ysato, dalias, davem, tglx, mingo, hpa, x86,
	arnd, linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch,
	Naoya Horiguchi, Mike Kravetz
In-Reply-To: <6ec7c5dc-feb1-86ff-b7d9-7794c92eaf0f@ghiti.fr>

Hi Alex,

On 26.07.2018 21:13, Alex Ghiti wrote:
> $ make ARCH=parisc O=build_parisc generic-64bit_defconfig
> $ PATH=/home/alex/wip/toolchain/gcc-8.1.0-nolibc/hppa64-linux/bin:$PATH make ARCH=parisc CROSS_COMPILE=hppa64-linux-
> 
>> ...
>>  LD      vmlinux.o
>>  MODPOST vmlinux.o
>> hppa64-linux-ld: init/main.o(.text+0x98): cannot reach strreplace
>> init/main.o: In function `initcall_blacklisted':
>> init/.tmp_main.o:(.text+0x98): relocation truncated to fit: R_PARISC_PCREL22F against symbol `strreplace' defined in .text section in lib/string.o
>> hppa64-linux-ld: init/main.o(.text+0xbc): cannot reach strcmp

In order to be able to link vmlinux, we need to enable 
CONFIG_MLONGCALLS=y in the defconfig.

Nevertheless, I see some modversion issues too which I still need 
to analyze (but that's a completely off-topic issue here).

Helge

^ permalink raw reply

* Re: [PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives
From: Mike Kravetz @ 2018-07-26 19:16 UTC (permalink / raw)
  To: Michael Ellerman, Alex Ghiti, Michal Hocko
  Cc: linux, catalin.marinas, will.deacon, tony.luck, fenghua.yu, ralf,
	paul.burton, jhogan, jejb, deller, benh, paulus, ysato, dalias,
	davem, tglx, mingo, hpa, x86, arnd, linux-arm-kernel,
	linux-kernel, linux-ia64, linux-mips, linux-parisc, linuxppc-dev,
	linux-sh, sparclinux, linux-arch, Naoya Horiguchi,
	Aneesh Kumar K . V
In-Reply-To: <87tvomgqyv.fsf@concordia.ellerman.id.au>

On 07/26/2018 04:46 AM, Michael Ellerman wrote:
> Mike Kravetz <mike.kravetz@oracle.com> writes:
> 
>> On 07/20/2018 11:37 AM, Alex Ghiti wrote:
>>> Does anyone have any suggestion about those patches ?
>>
>> I only took a quick look.  From the hugetlb perspective, I like the
>> idea of moving routines to a common file.  If any of the arch owners
>> (or anyone else) agree, I can do a review of the series.
> 
> The conversions look pretty good to me. If you want to give it a review
> then from my point of view it could go in -mm to shake out any bugs.

Nothing of significance found in a review.  As others have suggested,
the (cross)compiler may be better at finding issues than human eyes.

I also suggest it be added to -mm.
-- 
Mike Kravetz

^ permalink raw reply

* Re: [PATCH v4 11/11] hugetlb: Introduce generic version of huge_ptep_get
From: Mike Kravetz @ 2018-07-26 19:13 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-12-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> ia64, mips, parisc, powerpc, sh, sparc, x86 architectures use the
> same version of huge_ptep_get, so move this generic implementation into
> asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h | 1 +
>  arch/arm64/include/asm/hugetlb.h      | 1 +
>  arch/ia64/include/asm/hugetlb.h       | 5 -----
>  arch/mips/include/asm/hugetlb.h       | 5 -----
>  arch/parisc/include/asm/hugetlb.h     | 5 -----
>  arch/powerpc/include/asm/hugetlb.h    | 5 -----
>  arch/sh/include/asm/hugetlb.h         | 5 -----
>  arch/sparc/include/asm/hugetlb.h      | 5 -----
>  arch/x86/include/asm/hugetlb.h        | 5 -----
>  include/asm-generic/hugetlb.h         | 7 +++++++
>  10 files changed, 9 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index 54e4b097b1f5..0d9f3918fa7e 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -29,6 +29,7 @@
>   * ptes.
>   * (The valid bit is automatically cleared by set_pte_at for PROT_NONE ptes).
>   */
> +#define __HAVE_ARCH_HUGE_PTEP_GET
>  static inline pte_t huge_ptep_get(pte_t *ptep)
>  {
>  	pte_t retval = *ptep;
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 80887abcef7f..fb6609875455 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -20,6 +20,7 @@
>  
>  #include <asm/page.h>
>  
> +#define __HAVE_ARCH_HUGE_PTEP_GET
>  static inline pte_t huge_ptep_get(pte_t *ptep)
>  {
>  	return READ_ONCE(*ptep);
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index e9b42750fdf5..36cc0396b214 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -27,11 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 120adc3b2ffd..425bb6fc3bda 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -82,11 +82,6 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  	return changed;
>  }
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 165b4e5a6f32..7cb595dcb7d7 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -48,11 +48,6 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty);
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 658bf7136a3c..33a2d9e3ea9e 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -142,11 +142,6 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  				      unsigned long addr, pte_t *ptep,
>  				      pte_t pte, int dirty);
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index c87195ae0cfa..6f025fe18146 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -32,11 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  	clear_bit(PG_dcache_clean, &page->flags);
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 028a1465fbe7..3963f80d1cb3 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -53,11 +53,6 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  	return changed;
>  }
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 1df8944904c6..c97b34a29054 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -12,11 +12,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -static inline pte_t huge_ptep_get(pte_t *ptep)
> -{
> -	return *ptep;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  }
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index f3c99a03ee83..71d7b77eea50 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -119,4 +119,11 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTEP_GET
> +static inline pte_t huge_ptep_get(pte_t *ptep)
> +{
> +	return *ptep;
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives
From: Alex Ghiti @ 2018-07-26 19:13 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Ellerman, Michal Hocko, linux, catalin.marinas,
	will.deacon, tony.luck, fenghua.yu, ralf, paul.burton, jhogan,
	jejb, benh, paulus, ysato, dalias, davem, tglx, mingo, hpa, x86,
	arnd, linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch,
	Naoya Horiguchi, Mike Kravetz
In-Reply-To: <de188e2f-99ab-53fa-20df-4fec00a935e9@ghiti.fr>

Actually, I went back to v4.17, and I have the same errors.

I used:

$ make ARCH=parisc O=build_parisc generic-64bit_defconfig
$ PATH=/home/alex/wip/toolchain/gcc-8.1.0-nolibc/hppa64-linux/bin:$PATH 
make ARCH=parisc CROSS_COMPILE=hppa64-linux-

I downloaded the crosscompiler here: 
https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/


On 07/26/2018 05:01 PM, Alex Ghiti wrote:
> Hi Helge,
>
> Thanks for your tests.
> In case it can help you, this is what I get when I try to build 
> generic-64bit_defconfig (I truncated the output):
>
> ...
>
>  LD      vmlinux.o
>  MODPOST vmlinux.o
> hppa64-linux-ld: init/main.o(.text+0x98): cannot reach strreplace
> init/main.o: In function `initcall_blacklisted':
> init/.tmp_main.o:(.text+0x98): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strreplace' defined in .text section 
> in lib/string.o
> hppa64-linux-ld: init/main.o(.text+0xbc): cannot reach strcmp
> init/.tmp_main.o:(.text+0xbc): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.text+0x21c): cannot reach strcpy
> init/main.o: In function `do_one_initcall':
> (.text+0x21c): relocation truncated to fit: R_PARISC_PCREL22F against 
> symbol `strcpy' defined in .text section in lib/string.o
> hppa64-linux-ld: init/main.o(.text+0x250): cannot reach strlcat
> (.text+0x250): relocation truncated to fit: R_PARISC_PCREL22F against 
> symbol `strlcat' defined in .text section in lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x1d4): cannot reach strcmp
> init/main.o: In function `do_early_param':
> init/.tmp_main.o:(.init.text+0x1d4): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x250): cannot reach strcmp
> init/.tmp_main.o:(.init.text+0x250): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x294): cannot reach strlen
> init/main.o: In function `repair_env_string':
> init/.tmp_main.o:(.init.text+0x294): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x2f0): cannot reach strlen
> init/.tmp_main.o:(.init.text+0x2f0): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x308): cannot reach memmove
> init/.tmp_main.o:(.init.text+0x308): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `memmove' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x454): cannot reach strlen
> init/main.o: In function `unknown_bootoption':
> init/.tmp_main.o:(.init.text+0x454): relocation truncated to fit: 
> R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
> lib/string.o
> hppa64-linux-ld: init/main.o(.init.text+0x4dc): cannot reach strchr
> init/.tmp_main.o:(.init.text+0x4dc): additional relocation overflows 
> omitted from the output
> hppa64-linux-ld: init/main.o(.init.text+0x638): cannot reach strncmp
> hppa64-linux-ld: init/main.o(.init.text+0x694): cannot reach get_option
> hppa64-linux-ld: init/main.o(.init.text+0x744): cannot reach strsep
> hppa64-linux-ld: init/main.o(.init.text+0x798): cannot reach strlen
> hppa64-linux-ld: init/main.o(.init.text+0x7d0): cannot reach strcpy
> hppa64-linux-ld: init/main.o(.init.text+0x954): cannot reach strlcpy
> hppa64-linux-ld: init/main.o(.init.text+0xab8): cannot reach strlen
> hppa64-linux-ld: init/main.o(.init.text+0xafc): cannot reach strlen
> hppa64-linux-ld: init/main.o(.init.text+0xb40): cannot reach strlen
> hppa64-linux-ld: init/main.o(.init.text+0xb84): cannot reach strlen
> hppa64-linux-ld: init/main.o(.init.text+0xbd0): cannot reach strcpy
> hppa64-linux-ld: init/main.o(.init.text+0xbe8): cannot reach strcpy
> hppa64-linux-ld: init/main.o(.init.text+0xc3c): cannot reach 
> build_all_zonelists
> hppa64-linux-ld: init/main.o(.init.text+0x1200): cannot reach unknown
> hppa64-linux-ld: init/main.o(.init.text+0x1278): cannot reach 
> wait_for_completion
> hppa64-linux-ld: init/main.o(.init.text+0x12b0): cannot reach 
> _raw_spin_lock
> hppa64-linux-ld: init/main.o(.init.text+0x147c): cannot reach strcpy
> hppa64-linux-ld: init/main.o(.ref.text+0x40): cannot reach kernel_thread
> hppa64-linux-ld: init/main.o(.ref.text+0x60): cannot reach 
> find_task_by_pid_ns
> hppa64-linux-ld: init/main.o(.ref.text+0x98): cannot reach 
> set_cpus_allowed_ptr
> hppa64-linux-ld: init/main.o(.ref.text+0xbc): cannot reach kernel_thread
> hppa64-linux-ld: init/main.o(.ref.text+0xd4): cannot reach 
> find_task_by_pid_ns
> hppa64-linux-ld: init/main.o(.ref.text+0x108): cannot reach complete
> hppa64-linux-ld: init/main.o(.ref.text+0x128): cannot reach 
> cpu_startup_entry
> hppa64-linux-ld: init/main.o(.ref.text+0x164): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x174): cannot reach 
> async_synchronize_full
> hppa64-linux-ld: init/main.o(.ref.text+0x1a4): cannot reach 
> rcu_barrier_sched
> hppa64-linux-ld: init/main.o(.ref.text+0x1b4): cannot reach 
> mark_rodata_ro
> hppa64-linux-ld: init/main.o(.ref.text+0x1d4): cannot reach 
> rcu_end_inkernel_boot
> hppa64-linux-ld: init/main.o(.ref.text+0x1f4): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x218): cannot reach printk
> hppa64-linux-ld: init/main.o(.ref.text+0x238): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x258): cannot reach panic
> hppa64-linux-ld: init/main.o(.ref.text+0x268): cannot reach printk
> hppa64-linux-ld: init/main.o(.ref.text+0x280): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x29c): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x2b8): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x2d4): cannot reach unknown
> hppa64-linux-ld: init/main.o(.ref.text+0x2f0): cannot reach panic
> hppa64-linux-ld: init/do_mounts.o(.text+0x30): cannot reach strncasecmp
> hppa64-linux-ld: init/do_mounts.o(.text+0x158): cannot reach strncmp
> hppa64-linux-ld: init/do_mounts.o(.text+0x180): cannot reach strchr
>
> ...
>
>
> On 07/26/2018 12:59 PM, Helge Deller wrote:
>> * Alex Ghiti <alex@ghiti.fr>:
>>> This is the result of the build for all arches tackled in this series
>>> rebased on 4.18-rc6:
>>> ...
>>> parisc:
>>>          generic-64bit_defconfig: with huge page does not link
>>>          generic-64bit_defconfig: without huge page does not link
>>>          BUT not because of this series, any feedback welcome.
>> Strange, but I will check that later....
>>
>> Anyway, I applied your v4-patch to my parisc64 tree, built the kernel,
>> started it and ran some hugetlb LTP testcases sucessfully.
>> So, please add:
>>
>> Tested-by: Helge Deller <deller@gmx.de> # parisc
>>
>> Helge
>

^ permalink raw reply

* Re: [PATCH v4 10/11] hugetlb: Introduce generic version of huge_ptep_set_access_flags
From: Mike Kravetz @ 2018-07-26 19:12 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-11-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, ia64, sh, x86 architectures use the same version
> of huge_ptep_set_access_flags, so move this generic implementation
> into asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h | 7 -------
>  arch/arm64/include/asm/hugetlb.h      | 1 +
>  arch/ia64/include/asm/hugetlb.h       | 7 -------
>  arch/mips/include/asm/hugetlb.h       | 1 +
>  arch/parisc/include/asm/hugetlb.h     | 1 +
>  arch/powerpc/include/asm/hugetlb.h    | 1 +
>  arch/sh/include/asm/hugetlb.h         | 7 -------
>  arch/sparc/include/asm/hugetlb.h      | 1 +
>  arch/x86/include/asm/hugetlb.h        | 7 -------
>  include/asm-generic/hugetlb.h         | 9 +++++++++
>  10 files changed, 14 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index 8247cd6a2ac6..54e4b097b1f5 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -37,11 +37,4 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return retval;
>  }
>  
> -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> -					     unsigned long addr, pte_t *ptep,
> -					     pte_t pte, int dirty)
> -{
> -	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
> -}
> -
>  #endif /* _ASM_ARM_HUGETLB_3LEVEL_H */
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index f4f69ae5466e..80887abcef7f 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -42,6 +42,7 @@ extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
>  #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
>  extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  			    pte_t *ptep, pte_t pte);
> +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
>  extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  				      unsigned long addr, pte_t *ptep,
>  				      pte_t pte, int dirty);
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index 49d1f7949f3a..e9b42750fdf5 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -27,13 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> -					     unsigned long addr, pte_t *ptep,
> -					     pte_t pte, int dirty)
> -{
> -	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
> -}
> -
>  static inline pte_t huge_ptep_get(pte_t *ptep)
>  {
>  	return *ptep;
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 3dcf5debf8c4..120adc3b2ffd 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -63,6 +63,7 @@ static inline int huge_pte_none(pte_t pte)
>  	return !val || (val == (unsigned long)invalid_pte_table);
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr,
>  					     pte_t *ptep, pte_t pte,
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 9c3950ca2974..165b4e5a6f32 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -43,6 +43,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep);
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
>  int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty);
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 69c14ecac133..658bf7136a3c 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -137,6 +137,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  	flush_hugetlb_page(vma, addr);
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
>  extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  				      unsigned long addr, pte_t *ptep,
>  				      pte_t pte, int dirty);
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index 8df4004977b9..c87195ae0cfa 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -32,13 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> -					     unsigned long addr, pte_t *ptep,
> -					     pte_t pte, int dirty)
> -{
> -	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
> -}
> -
>  static inline pte_t huge_ptep_get(pte_t *ptep)
>  {
>  	return *ptep;
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index c41754a113f3..028a1465fbe7 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -40,6 +40,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  	set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index de370836a17d..1df8944904c6 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -12,13 +12,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> -					     unsigned long addr, pte_t *ptep,
> -					     pte_t pte, int dirty)
> -{
> -	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
> -}
> -
>  static inline pte_t huge_ptep_get(pte_t *ptep)
>  {
>  	return *ptep;
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 9b9039845278..f3c99a03ee83 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -110,4 +110,13 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
> +static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> +		unsigned long addr, pte_t *ptep,
> +		pte_t pte, int dirty)
> +{
> +	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 09/11] hugetlb: Introduce generic version of huge_ptep_set_wrprotect
From: Mike Kravetz @ 2018-07-26 19:10 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-10-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, ia64, mips, sh, x86 architectures use the same version
> of huge_ptep_set_wrprotect, so move this generic implementation into
> asm-generic/hugetlb.h.
> Note: powerpc uses twice for book3s/32 and nohash/32 the same version as
> the above architectures, but the modification was not straightforward
> and hence has not been done.
> 

Just one small comment, otehrwise
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h        | 6 ------
>  arch/arm64/include/asm/hugetlb.h             | 1 +
>  arch/ia64/include/asm/hugetlb.h              | 6 ------
>  arch/mips/include/asm/hugetlb.h              | 6 ------
>  arch/parisc/include/asm/hugetlb.h            | 1 +
>  arch/powerpc/include/asm/book3s/32/pgtable.h | 2 ++
>  arch/powerpc/include/asm/book3s/64/pgtable.h | 1 +
>  arch/powerpc/include/asm/nohash/32/pgtable.h | 2 ++
>  arch/powerpc/include/asm/nohash/64/pgtable.h | 1 +

As in patch 03, the book3s and nohash header files do not explicitly
include <asm-generic/hugetlb.h>.  With these, I had an even harder time
finding out who brought in that file.  This is not an issue with this
patch, just wish there was some easier way to check/prove include file
dependencies.  Since it compiles, I am sure it is OK.
-- 
Mike Kravetz

>  arch/sh/include/asm/hugetlb.h                | 6 ------
>  arch/sparc/include/asm/hugetlb.h             | 1 +
>  arch/x86/include/asm/hugetlb.h               | 6 ------
>  include/asm-generic/hugetlb.h                | 8 ++++++++
>  13 files changed, 17 insertions(+), 30 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index b897541520ef..8247cd6a2ac6 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return retval;
>  }
>  
> -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> -					   unsigned long addr, pte_t *ptep)
> -{
> -	ptep_set_wrprotect(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 3e7f6e69b28d..f4f69ae5466e 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -48,6 +48,7 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  				     unsigned long addr, pte_t *ptep);
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  				    unsigned long addr, pte_t *ptep);
>  #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index cbe296271030..49d1f7949f3a 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -27,12 +27,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> -					   unsigned long addr, pte_t *ptep)
> -{
> -	ptep_set_wrprotect(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 6ff2531cfb1d..3dcf5debf8c4 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -63,12 +63,6 @@ static inline int huge_pte_none(pte_t pte)
>  	return !val || (val == (unsigned long)invalid_pte_table);
>  }
>  
> -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> -					   unsigned long addr, pte_t *ptep)
> -{
> -	ptep_set_wrprotect(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr,
>  					     pte_t *ptep, pte_t pte,
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index fb7e0fd858a3..9c3950ca2974 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -39,6 +39,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep);
>  
> diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h
> index 02f5acd7ccc4..d2cd1d0226e9 100644
> --- a/arch/powerpc/include/asm/book3s/32/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
> @@ -228,6 +228,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
>  {
>  	pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), _PAGE_RO);
>  }
> +
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 42aafba7a308..7d957f7c47cd 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -451,6 +451,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
>  		pte_update(mm, addr, ptep, 0, _PAGE_PRIVILEGED, 0);
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h
> index 7c46a98cc7f4..f39e200d9591 100644
> --- a/arch/powerpc/include/asm/nohash/32/pgtable.h
> +++ b/arch/powerpc/include/asm/nohash/32/pgtable.h
> @@ -249,6 +249,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
>  {
>  	pte_update(ptep, (_PAGE_RW | _PAGE_HWWRITE), _PAGE_RO);
>  }
> +
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h
> index dd0c7236208f..69fbf7e9b4db 100644
> --- a/arch/powerpc/include/asm/nohash/64/pgtable.h
> +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h
> @@ -238,6 +238,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
>  	pte_update(mm, addr, ptep, _PAGE_RW, 0, 0);
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index f1bbd255ee43..8df4004977b9 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -32,12 +32,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> -					   unsigned long addr, pte_t *ptep)
> -{
> -	ptep_set_wrprotect(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 2101ea217f33..c41754a113f3 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -32,6 +32,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 2e5117d37c7d..de370836a17d 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -12,12 +12,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> -					   unsigned long addr, pte_t *ptep)
> -{
> -	ptep_set_wrprotect(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 6c0c8b0c71e0..9b9039845278 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -102,4 +102,12 @@ static inline int prepare_hugepage_range(struct file *file,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
> +static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
> +		unsigned long addr, pte_t *ptep)
> +{
> +	ptep_set_wrprotect(mm, addr, ptep);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 06/11] hugetlb: Introduce generic version of huge_pte_none
From: Mike Kravetz @ 2018-07-26 19:04 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-7-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, arm64, ia64, parisc, powerpc, sh, sparc, x86 architectures
> use the same version of huge_pte_none, so move this generic
> implementation into asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb.h     | 5 -----
>  arch/arm64/include/asm/hugetlb.h   | 5 -----
>  arch/ia64/include/asm/hugetlb.h    | 5 -----
>  arch/mips/include/asm/hugetlb.h    | 1 +
>  arch/parisc/include/asm/hugetlb.h  | 5 -----
>  arch/powerpc/include/asm/hugetlb.h | 5 -----
>  arch/sh/include/asm/hugetlb.h      | 5 -----
>  arch/sparc/include/asm/hugetlb.h   | 5 -----
>  arch/x86/include/asm/hugetlb.h     | 5 -----
>  include/asm-generic/hugetlb.h      | 7 +++++++
>  10 files changed, 8 insertions(+), 40 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
> index 047b893ef95d..3d2ce4dbc145 100644
> --- a/arch/arm/include/asm/hugetlb.h
> +++ b/arch/arm/include/asm/hugetlb.h
> @@ -43,11 +43,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 4c8dd488554d..49247c6f94db 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -42,11 +42,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index 41b5f6adeee4..bf573500b3c4 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -26,11 +26,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 7df1f116a3cc..1c9c4531376c 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -55,6 +55,7 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  	flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma)));
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTE_NONE
>  static inline int huge_pte_none(pte_t pte)
>  {
>  	unsigned long val = pte_val(pte) & ~_PAGE_GLOBAL;
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 9afff26747a1..c09d8c74553c 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -38,11 +38,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 0b02856aa85b..3562d46585ba 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -152,11 +152,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  	flush_hugetlb_page(vma, addr);
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index 9abf9c86b769..a9f8266f33cf 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -31,11 +31,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 651a9593fcee..11115bbd712e 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -48,11 +48,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 8347d5abf882..c5fdc53b6e41 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -27,11 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline int huge_pte_none(pte_t pte)
> -{
> -	return pte_none(pte);
> -}
> -
>  static inline pte_t huge_pte_wrprotect(pte_t pte)
>  {
>  	return pte_wrprotect(pte);
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index ffa63fd8388d..2fc3d68424e9 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -73,4 +73,11 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTE_NONE
> +static inline int huge_pte_none(pte_t pte)
> +{
> +	return pte_none(pte);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 08/11] hugetlb: Introduce generic version of prepare_hugepage_range
From: Mike Kravetz @ 2018-07-26 19:05 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-9-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, arm64, powerpc, sparc, x86 architectures use the same version of
> prepare_hugepage_range, so move this generic implementation into
> asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb.h     | 11 -----------
>  arch/arm64/include/asm/hugetlb.h   | 11 -----------
>  arch/ia64/include/asm/hugetlb.h    |  1 +
>  arch/mips/include/asm/hugetlb.h    |  1 +
>  arch/parisc/include/asm/hugetlb.h  |  1 +
>  arch/powerpc/include/asm/hugetlb.h | 15 ---------------
>  arch/sh/include/asm/hugetlb.h      |  1 +
>  arch/sparc/include/asm/hugetlb.h   | 16 ----------------
>  arch/x86/include/asm/hugetlb.h     | 15 ---------------
>  include/asm-generic/hugetlb.h      | 15 +++++++++++++++
>  10 files changed, 19 insertions(+), 68 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
> index 1e718a626ef9..34fb401efe81 100644
> --- a/arch/arm/include/asm/hugetlb.h
> +++ b/arch/arm/include/asm/hugetlb.h
> @@ -32,17 +32,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -static inline int prepare_hugepage_range(struct file *file,
> -					 unsigned long addr, unsigned long len)
> -{
> -	struct hstate *h = hstate_file(file);
> -	if (len & ~huge_page_mask(h))
> -		return -EINVAL;
> -	if (addr & ~huge_page_mask(h))
> -		return -EINVAL;
> -	return 0;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  	clear_bit(PG_dcache_clean, &page->flags);
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 1fd64ebf0cd7..3e7f6e69b28d 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -31,17 +31,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -static inline int prepare_hugepage_range(struct file *file,
> -					 unsigned long addr, unsigned long len)
> -{
> -	struct hstate *h = hstate_file(file);
> -	if (len & ~huge_page_mask(h))
> -		return -EINVAL;
> -	if (addr & ~huge_page_mask(h))
> -		return -EINVAL;
> -	return 0;
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  	clear_bit(PG_dcache_clean, &page->flags);
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index 82fe3d7a38d9..cbe296271030 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -9,6 +9,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
>  			    unsigned long end, unsigned long floor,
>  			    unsigned long ceiling);
>  
> +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
>  int prepare_hugepage_range(struct file *file,
>  			unsigned long addr, unsigned long len);
>  
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index b3d6bb53ee6e..6ff2531cfb1d 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -18,6 +18,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
>  static inline int prepare_hugepage_range(struct file *file,
>  					 unsigned long addr,
>  					 unsigned long len)
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 5a102d7251e4..fb7e0fd858a3 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -22,6 +22,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>   * If the arch doesn't supply something else, assume that hugepage
>   * size aligned regions are ok without further preparation.
>   */
> +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
>  static inline int prepare_hugepage_range(struct file *file,
>  			unsigned long addr, unsigned long len)
>  {
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 7123599089c6..69c14ecac133 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -117,21 +117,6 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
>  			    unsigned long end, unsigned long floor,
>  			    unsigned long ceiling);
>  
> -/*
> - * If the arch doesn't supply something else, assume that hugepage
> - * size aligned regions are ok without further preparation.
> - */
> -static inline int prepare_hugepage_range(struct file *file,
> -			unsigned long addr, unsigned long len)
> -{
> -	struct hstate *h = hstate_file(file);
> -	if (len & ~huge_page_mask(h))
> -		return -EINVAL;
> -	if (addr & ~huge_page_mask(h))
> -		return -EINVAL;
> -	return 0;
> -}
> -
>  #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index 54f65094efe6..f1bbd255ee43 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -15,6 +15,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>   * If the arch doesn't supply something else, assume that hugepage
>   * size aligned regions are ok without further preparation.
>   */
> +#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
>  static inline int prepare_hugepage_range(struct file *file,
>  			unsigned long addr, unsigned long len)
>  {
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index f661362376e0..2101ea217f33 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -26,22 +26,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -/*
> - * If the arch doesn't supply something else, assume that hugepage
> - * size aligned regions are ok without further preparation.
> - */
> -static inline int prepare_hugepage_range(struct file *file,
> -			unsigned long addr, unsigned long len)
> -{
> -	struct hstate *h = hstate_file(file);
> -
> -	if (len & ~huge_page_mask(h))
> -		return -EINVAL;
> -	if (addr & ~huge_page_mask(h))
> -		return -EINVAL;
> -	return 0;
> -}
> -
>  #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 19668672ab37..2e5117d37c7d 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -12,21 +12,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  	return 0;
>  }
>  
> -/*
> - * If the arch doesn't supply something else, assume that hugepage
> - * size aligned regions are ok without further preparation.
> - */
> -static inline int prepare_hugepage_range(struct file *file,
> -			unsigned long addr, unsigned long len)
> -{
> -	struct hstate *h = hstate_file(file);
> -	if (len & ~huge_page_mask(h))
> -		return -EINVAL;
> -	if (addr & ~huge_page_mask(h))
> -		return -EINVAL;
> -	return 0;
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index cd9697672b79..6c0c8b0c71e0 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -87,4 +87,19 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
> +static inline int prepare_hugepage_range(struct file *file,
> +		unsigned long addr, unsigned long len)
> +{
> +	struct hstate *h = hstate_file(file);
> +
> +	if (len & ~huge_page_mask(h))
> +		return -EINVAL;
> +	if (addr & ~huge_page_mask(h))
> +		return -EINVAL;
> +
> +	return 0;
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 07/11] hugetlb: Introduce generic version of huge_pte_wrprotect
From: Mike Kravetz @ 2018-07-26 19:05 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-8-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, arm64, ia64, mips, parisc, powerpc, sh, sparc, x86
> architectures use the same version of huge_pte_wrprotect, so move
> this generic implementation into asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb.h     | 5 -----
>  arch/arm64/include/asm/hugetlb.h   | 5 -----
>  arch/ia64/include/asm/hugetlb.h    | 5 -----
>  arch/mips/include/asm/hugetlb.h    | 5 -----
>  arch/parisc/include/asm/hugetlb.h  | 5 -----
>  arch/powerpc/include/asm/hugetlb.h | 5 -----
>  arch/sh/include/asm/hugetlb.h      | 5 -----
>  arch/sparc/include/asm/hugetlb.h   | 5 -----
>  arch/x86/include/asm/hugetlb.h     | 5 -----
>  include/asm-generic/hugetlb.h      | 7 +++++++
>  10 files changed, 7 insertions(+), 45 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb.h b/arch/arm/include/asm/hugetlb.h
> index 3d2ce4dbc145..1e718a626ef9 100644
> --- a/arch/arm/include/asm/hugetlb.h
> +++ b/arch/arm/include/asm/hugetlb.h
> @@ -43,11 +43,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  	clear_bit(PG_dcache_clean, &page->flags);
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 49247c6f94db..1fd64ebf0cd7 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -42,11 +42,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void arch_clear_hugepage_flags(struct page *page)
>  {
>  	clear_bit(PG_dcache_clean, &page->flags);
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index bf573500b3c4..82fe3d7a38d9 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -26,11 +26,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 1c9c4531376c..b3d6bb53ee6e 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -62,11 +62,6 @@ static inline int huge_pte_none(pte_t pte)
>  	return !val || (val == (unsigned long)invalid_pte_table);
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index c09d8c74553c..5a102d7251e4 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -38,11 +38,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep);
>  
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 3562d46585ba..7123599089c6 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -152,11 +152,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  	flush_hugetlb_page(vma, addr);
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  				      unsigned long addr, pte_t *ptep,
>  				      pte_t pte, int dirty);
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index a9f8266f33cf..54f65094efe6 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -31,11 +31,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 11115bbd712e..f661362376e0 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -48,11 +48,6 @@ static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  {
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index c5fdc53b6e41..19668672ab37 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -27,11 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline pte_t huge_pte_wrprotect(pte_t pte)
> -{
> -	return pte_wrprotect(pte);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 2fc3d68424e9..cd9697672b79 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -80,4 +80,11 @@ static inline int huge_pte_none(pte_t pte)
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTE_WRPROTECT
> +static inline pte_t huge_pte_wrprotect(pte_t pte)
> +{
> +	return pte_wrprotect(pte);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 05/11] hugetlb: Introduce generic version of huge_ptep_clear_flush
From: Mike Kravetz @ 2018-07-26 19:03 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-6-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, x86 architectures use the same version of
> huge_ptep_clear_flush, so move this generic implementation into
> asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h | 6 ------
>  arch/arm64/include/asm/hugetlb.h      | 1 +
>  arch/ia64/include/asm/hugetlb.h       | 1 +
>  arch/mips/include/asm/hugetlb.h       | 1 +
>  arch/parisc/include/asm/hugetlb.h     | 1 +
>  arch/powerpc/include/asm/hugetlb.h    | 1 +
>  arch/sh/include/asm/hugetlb.h         | 1 +
>  arch/sparc/include/asm/hugetlb.h      | 1 +
>  arch/x86/include/asm/hugetlb.h        | 6 ------
>  include/asm-generic/hugetlb.h         | 8 ++++++++
>  10 files changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index ad36e84b819a..b897541520ef 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return retval;
>  }
>  
> -static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
> -					 unsigned long addr, pte_t *ptep)
> -{
> -	ptep_clear_flush(vma, addr, ptep);
> -}
> -
>  static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  					   unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 6ae0bcafe162..4c8dd488554d 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -71,6 +71,7 @@ extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  				     unsigned long addr, pte_t *ptep);
>  extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  				    unsigned long addr, pte_t *ptep);
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  extern void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  				  unsigned long addr, pte_t *ptep);
>  #define __HAVE_ARCH_HUGE_PTE_CLEAR
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index 6719c74da0de..41b5f6adeee4 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -20,6 +20,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  		REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 0959cc5a41fa..7df1f116a3cc 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -48,6 +48,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  	return pte;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 6e281e1bb336..9afff26747a1 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -32,6 +32,7 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 970101cf9c82..0b02856aa85b 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -143,6 +143,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  #endif
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index 08ee6c00b5e9..9abf9c86b769 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -25,6 +25,7 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 944e3a4bfaff..651a9593fcee 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -42,6 +42,7 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 48b8d9b13cc6..8347d5abf882 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -27,12 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
> -					 unsigned long addr, pte_t *ptep)
> -{
> -	ptep_clear_flush(vma, addr, ptep);
> -}
> -
>  static inline int huge_pte_none(pte_t pte)
>  {
>  	return pte_none(pte);
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 0f6f151780dd..ffa63fd8388d 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -65,4 +65,12 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
> +static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
> +		unsigned long addr, pte_t *ptep)
> +{
> +	ptep_clear_flush(vma, addr, ptep);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 04/11] hugetlb: Introduce generic version of huge_ptep_get_and_clear
From: Mike Kravetz @ 2018-07-26 19:02 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-5-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, ia64, sh, x86 architectures use the
> same version of huge_ptep_get_and_clear, so move this generic
> implementation into asm-generic/hugetlb.h.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h | 6 ------
>  arch/arm64/include/asm/hugetlb.h      | 1 +
>  arch/ia64/include/asm/hugetlb.h       | 6 ------
>  arch/mips/include/asm/hugetlb.h       | 1 +
>  arch/parisc/include/asm/hugetlb.h     | 1 +
>  arch/powerpc/include/asm/hugetlb.h    | 1 +
>  arch/sh/include/asm/hugetlb.h         | 6 ------
>  arch/sparc/include/asm/hugetlb.h      | 1 +
>  arch/x86/include/asm/hugetlb.h        | 6 ------
>  include/asm-generic/hugetlb.h         | 8 ++++++++
>  10 files changed, 13 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index 398fb06e8207..ad36e84b819a 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -49,12 +49,6 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  	ptep_set_wrprotect(mm, addr, ptep);
>  }
>  
> -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> -					    unsigned long addr, pte_t *ptep)
> -{
> -	return ptep_get_and_clear(mm, addr, ptep);
> -}
> -
>  static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  					     unsigned long addr, pte_t *ptep,
>  					     pte_t pte, int dirty)
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 874661a1dff1..6ae0bcafe162 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -66,6 +66,7 @@ extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  				      unsigned long addr, pte_t *ptep,
>  				      pte_t pte, int dirty);
> +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  				     unsigned long addr, pte_t *ptep);
>  extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index a235d6f60fb3..6719c74da0de 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -20,12 +20,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  		REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
>  }
>  
> -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> -					    unsigned long addr, pte_t *ptep)
> -{
> -	return ptep_get_and_clear(mm, addr, ptep);
> -}
> -
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 8ea439041d5d..0959cc5a41fa 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -36,6 +36,7 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 77c8adbac7c3..6e281e1bb336 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -8,6 +8,7 @@
>  void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  		     pte_t *ptep, pte_t pte);
>  
> +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
>  			      pte_t *ptep);
>  
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index 0794b53439d4..970101cf9c82 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -132,6 +132,7 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index bc552e37c1c9..08ee6c00b5e9 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -25,12 +25,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> -					    unsigned long addr, pte_t *ptep)
> -{
> -	return ptep_get_and_clear(mm, addr, ptep);
> -}
> -
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 16b0c53ea6c9..944e3a4bfaff 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -16,6 +16,7 @@ extern struct pud_huge_patch_entry __pud_huge_patch, __pud_huge_patch_end;
>  void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  		     pte_t *ptep, pte_t pte);
>  
> +#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
>  pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
>  			      pte_t *ptep);
>  
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 554d5614b375..48b8d9b13cc6 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -27,12 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> -					    unsigned long addr, pte_t *ptep)
> -{
> -	return ptep_get_and_clear(mm, addr, ptep);
> -}
> -
>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index ee010b756246..0f6f151780dd 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -57,4 +57,12 @@ static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  }
>  #endif
>  
> +#ifndef __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
> +static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
> +		unsigned long addr, pte_t *ptep)
> +{
> +	return ptep_get_and_clear(mm, addr, ptep);
> +}
> +#endif
> +
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 03/11] hugetlb: Introduce generic version of set_huge_pte_at
From: Mike Kravetz @ 2018-07-26 19:00 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-4-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> arm, ia64, mips, powerpc, sh, x86 architectures use the
> same version of set_huge_pte_at, so move this generic
> implementation into asm-generic/hugetlb.h.
> 

Just one comment below, otherwise:
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm/include/asm/hugetlb-3level.h | 6 ------
>  arch/arm64/include/asm/hugetlb.h      | 1 +
>  arch/ia64/include/asm/hugetlb.h       | 6 ------
>  arch/mips/include/asm/hugetlb.h       | 6 ------
>  arch/parisc/include/asm/hugetlb.h     | 1 +
>  arch/powerpc/include/asm/hugetlb.h    | 6 ------
>  arch/sh/include/asm/hugetlb.h         | 6 ------
>  arch/sparc/include/asm/hugetlb.h      | 1 +
>  arch/x86/include/asm/hugetlb.h        | 6 ------
>  include/asm-generic/hugetlb.h         | 8 +++++++-
>  10 files changed, 10 insertions(+), 37 deletions(-)
> 
> diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
> index d4014fbe5ea3..398fb06e8207 100644
> --- a/arch/arm/include/asm/hugetlb-3level.h
> +++ b/arch/arm/include/asm/hugetlb-3level.h
> @@ -37,12 +37,6 @@ static inline pte_t huge_ptep_get(pte_t *ptep)
>  	return retval;
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -

Since <asm-generic/hugetlb.h> is not directly included in this file,
I had to search around in the #include dependency chain to look for
it.  It makes me just a tiny bit nervous, but since it compiled, I'm
sure there is not an issue.
-- 
Mike Kravetz

>  static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  					 unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index 4af1a800a900..874661a1dff1 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -60,6 +60,7 @@ static inline void arch_clear_hugepage_flags(struct page *page)
>  extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
>  				struct page *page, int writable);
>  #define arch_make_huge_pte arch_make_huge_pte
> +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
>  extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  			    pte_t *ptep, pte_t pte);
>  extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> diff --git a/arch/ia64/include/asm/hugetlb.h b/arch/ia64/include/asm/hugetlb.h
> index afe9fa4d969b..a235d6f60fb3 100644
> --- a/arch/ia64/include/asm/hugetlb.h
> +++ b/arch/ia64/include/asm/hugetlb.h
> @@ -20,12 +20,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
>  		REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
> index 53764050243e..8ea439041d5d 100644
> --- a/arch/mips/include/asm/hugetlb.h
> +++ b/arch/mips/include/asm/hugetlb.h
> @@ -36,12 +36,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/parisc/include/asm/hugetlb.h b/arch/parisc/include/asm/hugetlb.h
> index 28c23b68d38d..77c8adbac7c3 100644
> --- a/arch/parisc/include/asm/hugetlb.h
> +++ b/arch/parisc/include/asm/hugetlb.h
> @@ -4,6 +4,7 @@
>  
>  #include <asm/page.h>
>  
> +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
>  void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  		     pte_t *ptep, pte_t pte);
>  
> diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
> index a7d5c739df9b..0794b53439d4 100644
> --- a/arch/powerpc/include/asm/hugetlb.h
> +++ b/arch/powerpc/include/asm/hugetlb.h
> @@ -132,12 +132,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
> index f6a51b609409..bc552e37c1c9 100644
> --- a/arch/sh/include/asm/hugetlb.h
> +++ b/arch/sh/include/asm/hugetlb.h
> @@ -25,12 +25,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
> index 59d89b52ccb7..16b0c53ea6c9 100644
> --- a/arch/sparc/include/asm/hugetlb.h
> +++ b/arch/sparc/include/asm/hugetlb.h
> @@ -12,6 +12,7 @@ struct pud_huge_patch_entry {
>  extern struct pud_huge_patch_entry __pud_huge_patch, __pud_huge_patch_end;
>  #endif
>  
> +#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
>  void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
>  		     pte_t *ptep, pte_t pte);
>  
> diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h
> index 996ce8e15365..554d5614b375 100644
> --- a/arch/x86/include/asm/hugetlb.h
> +++ b/arch/x86/include/asm/hugetlb.h
> @@ -27,12 +27,6 @@ static inline int prepare_hugepage_range(struct file *file,
>  	return 0;
>  }
>  
> -static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> -				   pte_t *ptep, pte_t pte)
> -{
> -	set_pte_at(mm, addr, ptep, pte);
> -}
> -
>  static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
>  					    unsigned long addr, pte_t *ptep)
>  {
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index c697ca9dda18..ee010b756246 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -47,8 +47,14 @@ static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
>  {
>  	free_pgd_range(tlb, addr, end, floor, ceiling);
>  }
> +#endif
>  
> -
> +#ifndef __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
> +static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
> +		pte_t *ptep, pte_t pte)
> +{
> +	set_pte_at(mm, addr, ptep, pte);
> +}
>  #endif
>  
>  #endif /* _ASM_GENERIC_HUGETLB_H */
> 

^ permalink raw reply

* Re: [PATCH v4 01/11] hugetlb: Harmonize hugetlb.h arch specific defines with pgtable.h
From: Mike Kravetz @ 2018-07-26 18:40 UTC (permalink / raw)
  To: Alexandre Ghiti, linux, catalin.marinas, will.deacon, tony.luck,
	fenghua.yu, ralf, paul.burton, jhogan, jejb, deller, benh, paulus,
	mpe, ysato, dalias, davem, tglx, mingo, hpa, x86, arnd,
	linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch
In-Reply-To: <20180705110716.3919-2-alex@ghiti.fr>

On 07/05/2018 04:07 AM, Alexandre Ghiti wrote:
> asm-generic/hugetlb.h proposes generic implementations of hugetlb
> related functions: use __HAVE_ARCH_HUGE* defines in order to make arch
> specific implementations of hugetlb functions consistent with pgtable.h
> scheme.
> 

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
> ---
>  arch/arm64/include/asm/hugetlb.h | 2 +-
>  include/asm-generic/hugetlb.h    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h
> index e73f68569624..3fcf14663dfa 100644
> --- a/arch/arm64/include/asm/hugetlb.h
> +++ b/arch/arm64/include/asm/hugetlb.h
> @@ -81,9 +81,9 @@ extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
>  				    unsigned long addr, pte_t *ptep);
>  extern void huge_ptep_clear_flush(struct vm_area_struct *vma,
>  				  unsigned long addr, pte_t *ptep);
> +#define __HAVE_ARCH_HUGE_PTE_CLEAR
>  extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
>  			   pte_t *ptep, unsigned long sz);
> -#define huge_pte_clear huge_pte_clear
>  extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr,
>  				 pte_t *ptep, pte_t pte, unsigned long sz);
>  #define set_huge_swap_pte_at set_huge_swap_pte_at
> diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
> index 9d0cde8ab716..3da7cff52360 100644
> --- a/include/asm-generic/hugetlb.h
> +++ b/include/asm-generic/hugetlb.h
> @@ -32,7 +32,7 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot)
>  	return pte_modify(pte, newprot);
>  }
>  
> -#ifndef huge_pte_clear
> +#ifndef __HAVE_ARCH_HUGE_PTE_CLEAR
>  static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
>  		    pte_t *ptep, unsigned long sz)
>  {
> 

^ permalink raw reply

* Re: [PATCH v4 00/11] hugetlb: Factorize hugetlb architecture primitives
From: Alex Ghiti @ 2018-07-26 17:01 UTC (permalink / raw)
  To: Helge Deller
  Cc: Michael Ellerman, Michal Hocko, linux, catalin.marinas,
	will.deacon, tony.luck, fenghua.yu, ralf, paul.burton, jhogan,
	jejb, benh, paulus, ysato, dalias, davem, tglx, mingo, hpa, x86,
	arnd, linux-arm-kernel, linux-kernel, linux-ia64, linux-mips,
	linux-parisc, linuxppc-dev, linux-sh, sparclinux, linux-arch,
	Naoya Horiguchi, Mike Kravetz
In-Reply-To: <20180726125940.GA15033@ls3530>

Hi Helge,

Thanks for your tests.
In case it can help you, this is what I get when I try to build 
generic-64bit_defconfig (I truncated the output):

...

  LD      vmlinux.o
  MODPOST vmlinux.o
hppa64-linux-ld: init/main.o(.text+0x98): cannot reach strreplace
init/main.o: In function `initcall_blacklisted':
init/.tmp_main.o:(.text+0x98): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strreplace' defined in .text section 
in lib/string.o
hppa64-linux-ld: init/main.o(.text+0xbc): cannot reach strcmp
init/.tmp_main.o:(.text+0xbc): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.text+0x21c): cannot reach strcpy
init/main.o: In function `do_one_initcall':
(.text+0x21c): relocation truncated to fit: R_PARISC_PCREL22F against 
symbol `strcpy' defined in .text section in lib/string.o
hppa64-linux-ld: init/main.o(.text+0x250): cannot reach strlcat
(.text+0x250): relocation truncated to fit: R_PARISC_PCREL22F against 
symbol `strlcat' defined in .text section in lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x1d4): cannot reach strcmp
init/main.o: In function `do_early_param':
init/.tmp_main.o:(.init.text+0x1d4): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x250): cannot reach strcmp
init/.tmp_main.o:(.init.text+0x250): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strcmp' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x294): cannot reach strlen
init/main.o: In function `repair_env_string':
init/.tmp_main.o:(.init.text+0x294): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x2f0): cannot reach strlen
init/.tmp_main.o:(.init.text+0x2f0): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x308): cannot reach memmove
init/.tmp_main.o:(.init.text+0x308): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `memmove' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x454): cannot reach strlen
init/main.o: In function `unknown_bootoption':
init/.tmp_main.o:(.init.text+0x454): relocation truncated to fit: 
R_PARISC_PCREL22F against symbol `strlen' defined in .text section in 
lib/string.o
hppa64-linux-ld: init/main.o(.init.text+0x4dc): cannot reach strchr
init/.tmp_main.o:(.init.text+0x4dc): additional relocation overflows 
omitted from the output
hppa64-linux-ld: init/main.o(.init.text+0x638): cannot reach strncmp
hppa64-linux-ld: init/main.o(.init.text+0x694): cannot reach get_option
hppa64-linux-ld: init/main.o(.init.text+0x744): cannot reach strsep
hppa64-linux-ld: init/main.o(.init.text+0x798): cannot reach strlen
hppa64-linux-ld: init/main.o(.init.text+0x7d0): cannot reach strcpy
hppa64-linux-ld: init/main.o(.init.text+0x954): cannot reach strlcpy
hppa64-linux-ld: init/main.o(.init.text+0xab8): cannot reach strlen
hppa64-linux-ld: init/main.o(.init.text+0xafc): cannot reach strlen
hppa64-linux-ld: init/main.o(.init.text+0xb40): cannot reach strlen
hppa64-linux-ld: init/main.o(.init.text+0xb84): cannot reach strlen
hppa64-linux-ld: init/main.o(.init.text+0xbd0): cannot reach strcpy
hppa64-linux-ld: init/main.o(.init.text+0xbe8): cannot reach strcpy
hppa64-linux-ld: init/main.o(.init.text+0xc3c): cannot reach 
build_all_zonelists
hppa64-linux-ld: init/main.o(.init.text+0x1200): cannot reach unknown
hppa64-linux-ld: init/main.o(.init.text+0x1278): cannot reach 
wait_for_completion
hppa64-linux-ld: init/main.o(.init.text+0x12b0): cannot reach _raw_spin_lock
hppa64-linux-ld: init/main.o(.init.text+0x147c): cannot reach strcpy
hppa64-linux-ld: init/main.o(.ref.text+0x40): cannot reach kernel_thread
hppa64-linux-ld: init/main.o(.ref.text+0x60): cannot reach 
find_task_by_pid_ns
hppa64-linux-ld: init/main.o(.ref.text+0x98): cannot reach 
set_cpus_allowed_ptr
hppa64-linux-ld: init/main.o(.ref.text+0xbc): cannot reach kernel_thread
hppa64-linux-ld: init/main.o(.ref.text+0xd4): cannot reach 
find_task_by_pid_ns
hppa64-linux-ld: init/main.o(.ref.text+0x108): cannot reach complete
hppa64-linux-ld: init/main.o(.ref.text+0x128): cannot reach 
cpu_startup_entry
hppa64-linux-ld: init/main.o(.ref.text+0x164): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x174): cannot reach 
async_synchronize_full
hppa64-linux-ld: init/main.o(.ref.text+0x1a4): cannot reach 
rcu_barrier_sched
hppa64-linux-ld: init/main.o(.ref.text+0x1b4): cannot reach mark_rodata_ro
hppa64-linux-ld: init/main.o(.ref.text+0x1d4): cannot reach 
rcu_end_inkernel_boot
hppa64-linux-ld: init/main.o(.ref.text+0x1f4): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x218): cannot reach printk
hppa64-linux-ld: init/main.o(.ref.text+0x238): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x258): cannot reach panic
hppa64-linux-ld: init/main.o(.ref.text+0x268): cannot reach printk
hppa64-linux-ld: init/main.o(.ref.text+0x280): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x29c): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x2b8): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x2d4): cannot reach unknown
hppa64-linux-ld: init/main.o(.ref.text+0x2f0): cannot reach panic
hppa64-linux-ld: init/do_mounts.o(.text+0x30): cannot reach strncasecmp
hppa64-linux-ld: init/do_mounts.o(.text+0x158): cannot reach strncmp
hppa64-linux-ld: init/do_mounts.o(.text+0x180): cannot reach strchr

...


On 07/26/2018 12:59 PM, Helge Deller wrote:
> * Alex Ghiti <alex@ghiti.fr>:
>> This is the result of the build for all arches tackled in this series
>> rebased on 4.18-rc6:
>> ...
>> parisc:
>>          generic-64bit_defconfig: with huge page does not link
>>          generic-64bit_defconfig: without huge page does not link
>>          BUT not because of this series, any feedback welcome.
> Strange, but I will check that later....
>
> Anyway, I applied your v4-patch to my parisc64 tree, built the kernel,
> started it and ran some hugetlb LTP testcases sucessfully.
> So, please add:
>
> Tested-by: Helge Deller <deller@gmx.de> # parisc
>
> Helge

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox