* [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
@ 2012-12-17 17:52 Dave Kleikamp
2012-12-17 18:24 ` Josip Rodin
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Dave Kleikamp @ 2012-12-17 17:52 UTC (permalink / raw)
To: sparclinux
On 12/16/2012 10:52 AM, David Miller wrote:
> From: Dave Kleikamp <dave.kleikamp@oracle.com>
> Date: Fri, 14 Dec 2012 15:02:00 -0600
>
>> 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);
>> + int changed = !pte_same(*ptep, pte);
>> + if (changed)
>> + set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
>> + return changed;
>> }
>>
>> static inline pte_t huge_ptep_get(pte_t *ptep)
>
> This lacks the TLB flush after setting the pte, which is really
> needed.
Modifying the huge pte's requires that all the underlying pte's be
modified.
Version 2: added missing flush_tlb_page()
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
arch/sparc/include/asm/hugetlb.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index 8c5eed6..9661e9b 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -61,14 +61,20 @@ static inline pte_t huge_pte_wrprotect(pte_t pte)
static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
- ptep_set_wrprotect(mm, addr, ptep);
+ pte_t old_pte = *ptep;
+ set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
}
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);
+ int changed = !pte_same(*ptep, pte);
+ if (changed) {
+ set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
+ flush_tlb_page(vma, addr);
+ }
+ return changed;
}
static inline pte_t huge_ptep_get(pte_t *ptep)
--
1.8.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
@ 2012-12-17 18:24 ` Josip Rodin
2012-12-17 18:44 ` Dave Kleikamp
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Josip Rodin @ 2012-12-17 18:24 UTC (permalink / raw)
To: sparclinux
On Mon, Dec 17, 2012 at 11:52:47AM -0600, Dave Kleikamp wrote:
> 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);
> + int changed = !pte_same(*ptep, pte);
> + if (changed) {
> + set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
> + flush_tlb_page(vma, addr);
> + }
> + return changed;
> }
I've no idea what this really does, but I noticed that you are ignoring the
'dirty' parameter in the new version. If it's irrelevant, maybe make a note
of it to avoid the impression it got lost?
--
2. That which causes joy or happiness.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
2012-12-17 18:24 ` Josip Rodin
@ 2012-12-17 18:44 ` Dave Kleikamp
2012-12-17 19:17 ` David Miller
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dave Kleikamp @ 2012-12-17 18:44 UTC (permalink / raw)
To: sparclinux
On 12/17/2012 12:24 PM, Josip Rodin wrote:
> On Mon, Dec 17, 2012 at 11:52:47AM -0600, Dave Kleikamp wrote:
>> 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);
>> + int changed = !pte_same(*ptep, pte);
>> + if (changed) {
>> + set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
>> + flush_tlb_page(vma, addr);
>> + }
>> + return changed;
>> }
>
> I've no idea what this really does, but I noticed that you are ignoring the
> 'dirty' parameter in the new version. If it's irrelevant, maybe make a note
> of it to avoid the impression it got lost?
It seems x86 is the only architecture that pays any attention to this
flag. ptep_set_access_flags() ignores it as well.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
2012-12-17 18:24 ` Josip Rodin
2012-12-17 18:44 ` Dave Kleikamp
@ 2012-12-17 19:17 ` David Miller
2012-12-17 19:30 ` Dave Kleikamp
2012-12-18 23:48 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-12-17 19:17 UTC (permalink / raw)
To: sparclinux
From: Dave Kleikamp <dave.kleikamp@oracle.com>
Date: Mon, 17 Dec 2012 11:52:47 -0600
> On 12/16/2012 10:52 AM, David Miller wrote:
>> From: Dave Kleikamp <dave.kleikamp@oracle.com>
>> Date: Fri, 14 Dec 2012 15:02:00 -0600
>>
>>> 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);
>>> + int changed = !pte_same(*ptep, pte);
>>> + if (changed)
>>> + set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
>>> + return changed;
>>> }
>>>
>>> static inline pte_t huge_ptep_get(pte_t *ptep)
>>
>> This lacks the TLB flush after setting the pte, which is really
>> needed.
>
> Modifying the huge pte's requires that all the underlying pte's be
> modified.
>
> Version 2: added missing flush_tlb_page()
>
> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Please don't submit new versions of patches as a reply like this.
Always submit new patches as fresh list postings, that way the
maintainer doesn't have to edit out all of the unnecessary
reply verbiage from the resulting commit message during checkin.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
` (2 preceding siblings ...)
2012-12-17 19:17 ` David Miller
@ 2012-12-17 19:30 ` Dave Kleikamp
2012-12-18 23:48 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Dave Kleikamp @ 2012-12-17 19:30 UTC (permalink / raw)
To: sparclinux
On 12/17/2012 01:17 PM, David Miller wrote:
>
> Please don't submit new versions of patches as a reply like this.
>
> Always submit new patches as fresh list postings, that way the
> maintainer doesn't have to edit out all of the unnecessary
> reply verbiage from the resulting commit message during checkin.
Sorry about that.
Shaggy
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
` (3 preceding siblings ...)
2012-12-17 19:30 ` Dave Kleikamp
@ 2012-12-18 23:48 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-12-18 23:48 UTC (permalink / raw)
To: sparclinux
From: Dave Kleikamp <dave.kleikamp@oracle.com>
Date: Mon, 17 Dec 2012 11:52:47 -0600
> Modifying the huge pte's requires that all the underlying pte's be
> modified.
>
> Version 2: added missing flush_tlb_page()
>
> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-12-18 23:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 17:52 [PATCH v2] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Dave Kleikamp
2012-12-17 18:24 ` Josip Rodin
2012-12-17 18:44 ` Dave Kleikamp
2012-12-17 19:17 ` David Miller
2012-12-17 19:30 ` Dave Kleikamp
2012-12-18 23:48 ` David Miller
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.