All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
@ 2017-01-11  5:58 ` Huang Shijie
  0 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-11  5:58 UTC (permalink / raw)
  To: catalin.marinas
  Cc: will.deacon, linux-arm-kernel, steve.capper, kaly.xin,
	Huang Shijie, stable

In current code, the @changed always returns the last one's
status for the huge page with the contiguous bit set.
This is really not what we want. Even one of the PTEs is changed,
we should tell it to the caller.

This patch fixes this issue.

Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
Cc: stable@vger.kernel.org
Signed-off-by: Huang Shijie <shijie.huang@arm.com>
---
 arch/arm64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 964b7549af5c..e25584d72396 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
                ncontig = find_num_contig(vma->vm_mm, addr, cpte,
                                          *cpte, &pgsize);
                for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
-                       changed = ptep_set_access_flags(vma, addr, cpte,
+                       changed |= ptep_set_access_flags(vma, addr, cpte,
                                                        pfn_pte(pfn,
                                                                hugeprot),
                                                        dirty);
--
2.5.5

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
@ 2017-01-11  5:58 ` Huang Shijie
  0 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-11  5:58 UTC (permalink / raw)
  To: linux-arm-kernel

In current code, the @changed always returns the last one's
status for the huge page with the contiguous bit set.
This is really not what we want. Even one of the PTEs is changed,
we should tell it to the caller.

This patch fixes this issue.

Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
Cc: stable at vger.kernel.org
Signed-off-by: Huang Shijie <shijie.huang@arm.com>
---
 arch/arm64/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index 964b7549af5c..e25584d72396 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
                ncontig = find_num_contig(vma->vm_mm, addr, cpte,
                                          *cpte, &pgsize);
                for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
-                       changed = ptep_set_access_flags(vma, addr, cpte,
+                       changed |= ptep_set_access_flags(vma, addr, cpte,
                                                        pfn_pte(pfn,
                                                                hugeprot),
                                                        dirty);
--
2.5.5

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
  2017-01-11  5:58 ` Huang Shijie
@ 2017-01-11  6:00   ` Huang Shijie
  -1 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-11  6:00 UTC (permalink / raw)
  To: catalin.marinas
  Cc: will.deacon, linux-arm-kernel, steve.capper, kaly.xin, stable, nd

On Wed, Jan 11, 2017 at 01:58:28PM +0800, Huang Shijie wrote:
> In current code, the @changed always returns the last one's
> status for the huge page with the contiguous bit set.
> This is really not what we want. Even one of the PTEs is changed,
> we should tell it to the caller.
> 
> This patch fixes this issue.
> 
> Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
> Cc: stable@vger.kernel.org
> Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> ---
>  arch/arm64/mm/hugetlbpage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 964b7549af5c..e25584d72396 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  		ncontig = find_num_contig(vma->vm_mm, addr, cpte,
>  					  *cpte, &pgsize);
>  		for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
> -			changed = ptep_set_access_flags(vma, addr, cpte,
> +			changed |= ptep_set_access_flags(vma, addr, cpte,
>  							pfn_pte(pfn,
>  								hugeprot),
>  							dirty);
> -- 
> 2.5.5
> 
sorry, I missed to remove the disclaimer.

Huang Shijie

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

* [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
@ 2017-01-11  6:00   ` Huang Shijie
  0 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-11  6:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 11, 2017 at 01:58:28PM +0800, Huang Shijie wrote:
> In current code, the @changed always returns the last one's
> status for the huge page with the contiguous bit set.
> This is really not what we want. Even one of the PTEs is changed,
> we should tell it to the caller.
> 
> This patch fixes this issue.
> 
> Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
> Cc: stable at vger.kernel.org
> Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> ---
>  arch/arm64/mm/hugetlbpage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> index 964b7549af5c..e25584d72396 100644
> --- a/arch/arm64/mm/hugetlbpage.c
> +++ b/arch/arm64/mm/hugetlbpage.c
> @@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
>  		ncontig = find_num_contig(vma->vm_mm, addr, cpte,
>  					  *cpte, &pgsize);
>  		for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
> -			changed = ptep_set_access_flags(vma, addr, cpte,
> +			changed |= ptep_set_access_flags(vma, addr, cpte,
>  							pfn_pte(pfn,
>  								hugeprot),
>  							dirty);
> -- 
> 2.5.5
> 
sorry, I missed to remove the disclaimer.

Huang Shijie

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

* Re: [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
  2017-01-11  6:00   ` Huang Shijie
@ 2017-01-11 10:19     ` Catalin Marinas
  -1 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2017-01-11 10:19 UTC (permalink / raw)
  To: Huang Shijie
  Cc: steve.capper, will.deacon, stable, kaly.xin, nd, linux-arm-kernel

On Wed, Jan 11, 2017 at 02:00:46PM +0800, Huang Shijie wrote:
> On Wed, Jan 11, 2017 at 01:58:28PM +0800, Huang Shijie wrote:
> > In current code, the @changed always returns the last one's
> > status for the huge page with the contiguous bit set.
> > This is really not what we want. Even one of the PTEs is changed,
> > we should tell it to the caller.
> > 
> > This patch fixes this issue.
> > 
> > Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> > ---
> >  arch/arm64/mm/hugetlbpage.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> > index 964b7549af5c..e25584d72396 100644
> > --- a/arch/arm64/mm/hugetlbpage.c
> > +++ b/arch/arm64/mm/hugetlbpage.c
> > @@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> >  		ncontig = find_num_contig(vma->vm_mm, addr, cpte,
> >  					  *cpte, &pgsize);
> >  		for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
> > -			changed = ptep_set_access_flags(vma, addr, cpte,
> > +			changed |= ptep_set_access_flags(vma, addr, cpte,
> >  							pfn_pte(pfn,
> >  								hugeprot),
> >  							dirty);
> > -- 
> > 2.5.5
> > 
> sorry, I missed to remove the disclaimer.

The disclaimer is not the main issue. The patch that ended up on the
list seems to have been corrupted probably by the SMTP server (all tabs
converted to spaces).

-- 
Catalin

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

* [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
@ 2017-01-11 10:19     ` Catalin Marinas
  0 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2017-01-11 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 11, 2017 at 02:00:46PM +0800, Huang Shijie wrote:
> On Wed, Jan 11, 2017 at 01:58:28PM +0800, Huang Shijie wrote:
> > In current code, the @changed always returns the last one's
> > status for the huge page with the contiguous bit set.
> > This is really not what we want. Even one of the PTEs is changed,
> > we should tell it to the caller.
> > 
> > This patch fixes this issue.
> > 
> > Fixes: 66b3923a1a0f ("arm64: hugetlb: add support for PTE contiguous bit")
> > Cc: stable at vger.kernel.org
> > Signed-off-by: Huang Shijie <shijie.huang@arm.com>
> > ---
> >  arch/arm64/mm/hugetlbpage.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
> > index 964b7549af5c..e25584d72396 100644
> > --- a/arch/arm64/mm/hugetlbpage.c
> > +++ b/arch/arm64/mm/hugetlbpage.c
> > @@ -239,7 +239,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
> >  		ncontig = find_num_contig(vma->vm_mm, addr, cpte,
> >  					  *cpte, &pgsize);
> >  		for (i = 0; i < ncontig; ++i, ++cpte, addr += pgsize) {
> > -			changed = ptep_set_access_flags(vma, addr, cpte,
> > +			changed |= ptep_set_access_flags(vma, addr, cpte,
> >  							pfn_pte(pfn,
> >  								hugeprot),
> >  							dirty);
> > -- 
> > 2.5.5
> > 
> sorry, I missed to remove the disclaimer.

The disclaimer is not the main issue. The patch that ended up on the
list seems to have been corrupted probably by the SMTP server (all tabs
converted to spaces).

-- 
Catalin

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

* Re: [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
  2017-01-11 10:19     ` Catalin Marinas
@ 2017-01-13  2:50       ` Huang Shijie
  -1 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-13  2:50 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: steve.capper, will.deacon, stable, kaly.xin, nd, linux-arm-kernel

On Wed, Jan 11, 2017 at 10:19:25AM +0000, Catalin Marinas wrote:
> The disclaimer is not the main issue. The patch that ended up on the
> list seems to have been corrupted probably by the SMTP server (all tabs
> converted to spaces).
Thanks for pointing this. I will change another SMTP server if the issue
still exists in future.

Thanks
Huang Shijie

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

* [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags
@ 2017-01-13  2:50       ` Huang Shijie
  0 siblings, 0 replies; 8+ messages in thread
From: Huang Shijie @ 2017-01-13  2:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 11, 2017 at 10:19:25AM +0000, Catalin Marinas wrote:
> The disclaimer is not the main issue. The patch that ended up on the
> list seems to have been corrupted probably by the SMTP server (all tabs
> converted to spaces).
Thanks for pointing this. I will change another SMTP server if the issue
still exists in future.

Thanks
Huang Shijie

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

end of thread, other threads:[~2017-01-13  2:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11  5:58 [PATCH] arm64: hugetlb: fix the wrong return value for huge_ptep_set_access_flags Huang Shijie
2017-01-11  5:58 ` Huang Shijie
2017-01-11  6:00 ` Huang Shijie
2017-01-11  6:00   ` Huang Shijie
2017-01-11 10:19   ` Catalin Marinas
2017-01-11 10:19     ` Catalin Marinas
2017-01-13  2:50     ` Huang Shijie
2017-01-13  2:50       ` Huang Shijie

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