<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE>@font-face {
        font-family: 宋体;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @宋体;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="FONT-SIZE: 10pt; FONT-FAMILY: verdana">
<DIV><FONT face=Verdana color=#000080 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2>2008-09-18 </FONT></DIV><FONT 
face=Verdana color=#000080 size=2>
<HR style="WIDTH: 122px; HEIGHT: 2px" align=left SIZE=2>
</FONT>
<DIV><FONT face=Verdana color=#c0c0c0 size=2><SPAN>limitjiang</SPAN> 
</FONT></DIV><FONT face=Verdana color=#000080 size=2>
<HR>
</FONT>
<DIV><FONT face=Verdana size=2><STRONG>发件人:</STRONG> 
linuxppc-dev-request@ozlabs.org </FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>发送时间:</STRONG> 2008-09-18&nbsp; 09:55:11 
</FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>收件人:</STRONG> linuxppc-dev@ozlabs.org 
</FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>抄送:</STRONG> </FONT></DIV>
<DIV><FONT face=Verdana size=2><STRONG>主题:</STRONG> Linuxppc-dev Digest, Vol 49, 
Issue 89 </FONT></DIV>
<DIV><FONT face=Verdana size=2></FONT> </DIV>
<DIV><FONT face=Verdana size=2>
<DIV>Send&nbsp;Linuxppc-dev&nbsp;mailing&nbsp;list&nbsp;submissions&nbsp;to</DIV>
<DIV>linuxppc-dev@ozlabs.org</DIV>
<DIV>&nbsp;</DIV>
<DIV>To&nbsp;subscribe&nbsp;or&nbsp;unsubscribe&nbsp;via&nbsp;the&nbsp;World&nbsp;Wide&nbsp;Web,&nbsp;visit</DIV>
<DIV>https://ozlabs.org/mailman/listinfo/linuxppc-dev</DIV>
<DIV>or,&nbsp;via&nbsp;email,&nbsp;send&nbsp;a&nbsp;message&nbsp;with&nbsp;subject&nbsp;or&nbsp;body&nbsp;'help'&nbsp;to</DIV>
<DIV>linuxppc-dev-request@ozlabs.org</DIV>
<DIV>&nbsp;</DIV>
<DIV>You&nbsp;can&nbsp;reach&nbsp;the&nbsp;person&nbsp;managing&nbsp;the&nbsp;list&nbsp;at</DIV>
<DIV>linuxppc-dev-owner@ozlabs.org</DIV>
<DIV>&nbsp;</DIV>
<DIV>When&nbsp;replying,&nbsp;please&nbsp;edit&nbsp;your&nbsp;Subject&nbsp;line&nbsp;so&nbsp;it&nbsp;is&nbsp;more&nbsp;specific</DIV>
<DIV>than&nbsp;"Re:&nbsp;Contents&nbsp;of&nbsp;Linuxppc-dev&nbsp;digest..."</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Today's&nbsp;Topics:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;1.&nbsp;[PATCH&nbsp;v7&nbsp;2/4]&nbsp;powerpc:&nbsp;Fixes&nbsp;for&nbsp;CONFIG_PTE_64BIT&nbsp;for&nbsp;SMP</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;support&nbsp;(Kumar&nbsp;Gala)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;2.&nbsp;[PATCH&nbsp;v7&nbsp;3/4]&nbsp;powerpc/fsl-booke:&nbsp;Fixup&nbsp;64-bit&nbsp;PTE&nbsp;reading</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;SMP 
support&nbsp;(Kumar&nbsp;Gala)</DIV>
<DIV>&nbsp;&nbsp;&nbsp;3.&nbsp;[PATCH&nbsp;v7&nbsp;4/4]&nbsp;powerpc/mm:&nbsp;Implement&nbsp;_PAGE_SPECIAL&nbsp;&amp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pte_special() 
for&nbsp;32-bit&nbsp;(Kumar&nbsp;Gala)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>----------------------------------------------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>Message:&nbsp;1</DIV>
<DIV>Date:&nbsp;Wed,&nbsp;17&nbsp;Sep&nbsp;2008&nbsp;18:00:03&nbsp;-0500</DIV>
<DIV>From:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org &gt;</DIV>
<DIV>Subject:&nbsp;[PATCH&nbsp;v7&nbsp;2/4]&nbsp;powerpc:&nbsp;Fixes&nbsp;for&nbsp;CONFIG_PTE_64BIT&nbsp;for&nbsp;SMP</DIV>
<DIV>support</DIV>
<DIV>To:&nbsp;linuxppc-dev@ozlabs.org</DIV>
<DIV>Message-ID:</DIV>
<DIV>&lt;1221692405-19880-2-git-send-email-galak@kernel.crashing.org &gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>There&nbsp;are&nbsp;some&nbsp;minor&nbsp;issues&nbsp;with&nbsp;support&nbsp;64-bit&nbsp;PTEs&nbsp;on&nbsp;a&nbsp;32-bit&nbsp;processor</DIV>
<DIV>when&nbsp;dealing&nbsp;with&nbsp;SMP.</DIV>
<DIV>&nbsp;</DIV>
<DIV>*&nbsp;We&nbsp;need&nbsp;to&nbsp;order&nbsp;the&nbsp;stores&nbsp;in&nbsp;set_pte_at&nbsp;to&nbsp;make&nbsp;sure&nbsp;the&nbsp;flag&nbsp;word</DIV>
<DIV>&nbsp;&nbsp;is&nbsp;set&nbsp;second.</DIV>
<DIV>*&nbsp;Change&nbsp;pte_clear&nbsp;to&nbsp;use&nbsp;pte_update&nbsp;so&nbsp;only&nbsp;the&nbsp;flag&nbsp;word&nbsp;is&nbsp;cleared</DIV>
<DIV>*&nbsp;Added&nbsp;a&nbsp;check&nbsp;to&nbsp;set_pte_at&nbsp;to&nbsp;clear&nbsp;the&nbsp;pte&nbsp;if&nbsp;it&nbsp;happened&nbsp;to&nbsp;be&nbsp;set.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Signed-off-by:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org 
&gt;</DIV>
<DIV>---</DIV>
<DIV>&nbsp;</DIV>
<DIV>Changed&nbsp;the&nbsp;set_pte_at&nbsp;checking&nbsp;to&nbsp;deal&nbsp;with&nbsp;the&nbsp;case&nbsp;that&nbsp;it's&nbsp;called</DIV>
<DIV>with&nbsp;a&nbsp;pte&nbsp;that&nbsp;has&nbsp;pte_present&nbsp;and&nbsp;clearing&nbsp;it&nbsp;w/proper&nbsp;ordering.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-&nbsp;k</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;arch/powerpc/include/asm/highmem.h&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;+-</DIV>
<DIV>&nbsp;arch/powerpc/include/asm/pgtable-ppc32.h&nbsp;|&nbsp;&nbsp;&nbsp;28&nbsp;+++++++++++++++++++++++-----</DIV>
<DIV>&nbsp;2&nbsp;files&nbsp;changed,&nbsp;24&nbsp;insertions(+),&nbsp;6&nbsp;deletions(-)</DIV>
<DIV>&nbsp;</DIV>
<DIV>diff&nbsp;--git&nbsp;a/arch/powerpc/include/asm/highmem.h&nbsp;b/arch/powerpc/include/asm/highmem.h</DIV>
<DIV>index&nbsp;5d99b64..91c5895&nbsp;100644</DIV>
<DIV>---&nbsp;a/arch/powerpc/include/asm/highmem.h</DIV>
<DIV>+++&nbsp;b/arch/powerpc/include/asm/highmem.h</DIV>
<DIV>@@&nbsp;-84,7&nbsp;+84,7&nbsp;@@&nbsp;static&nbsp;inline&nbsp;void&nbsp;*kmap_atomic_prot(struct&nbsp;page&nbsp;*page,&nbsp;enum&nbsp;km_type&nbsp;type,&nbsp;pgpro</DIV>
<DIV>&nbsp;#ifdef&nbsp;CONFIG_DEBUG_HIGHMEM</DIV>
<DIV>&nbsp; BUG_ON(!pte_none(*(kmap_pte-idx)));</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>- 
set_pte_at(&amp;init_mm,&nbsp;vaddr,&nbsp;kmap_pte-idx,&nbsp;mk_pte(page,&nbsp;prot));</DIV>
<DIV>+ 
__set_pte_at(&amp;init_mm,&nbsp;vaddr,&nbsp;kmap_pte-idx,&nbsp;mk_pte(page,&nbsp;prot));</DIV>
<DIV>&nbsp; flush_tlb_page(NULL,&nbsp;vaddr);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; return&nbsp;(void*)&nbsp;vaddr;</DIV>
<DIV>diff&nbsp;--git&nbsp;a/arch/powerpc/include/asm/pgtable-ppc32.h&nbsp;b/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>index&nbsp;6fe39e3..d1d23b9&nbsp;100644</DIV>
<DIV>---&nbsp;a/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>+++&nbsp;b/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>@@&nbsp;-517,7&nbsp;+517,8&nbsp;@@&nbsp;extern&nbsp;unsigned&nbsp;long&nbsp;bad_call_to_PMD_PAGE_SIZE(void);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#define&nbsp;pte_none(pte) 
((pte_val(pte)&nbsp;&amp;&nbsp;~_PTE_NONE_MASK)&nbsp;==&nbsp;0)</DIV>
<DIV>&nbsp;#define&nbsp;pte_present(pte) 
(pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_PRESENT)</DIV>
<DIV>-#define&nbsp;pte_clear(mm,addr,ptep) 
do&nbsp;{&nbsp;set_pte_at((mm),&nbsp;(addr),&nbsp;(ptep),&nbsp;__pte(0));&nbsp;}&nbsp;while&nbsp;(0)</DIV>
<DIV>+#define&nbsp;pte_clear(mm,&nbsp;addr,&nbsp;ptep)&nbsp;\</DIV>
<DIV>+ 
do&nbsp;{&nbsp;pte_update(ptep,&nbsp;~_PAGE_HASHPTE,&nbsp;0);&nbsp;}&nbsp;while&nbsp;(0)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#define&nbsp;pmd_none(pmd) (!pmd_val(pmd))</DIV>
<DIV>&nbsp;#define pmd_bad(pmd) (pmd_val(pmd)&nbsp;&amp;&nbsp;_PMD_BAD)</DIV>
<DIV>@@&nbsp;-612,9&nbsp;+613,6&nbsp;@@&nbsp;static&nbsp;inline&nbsp;unsigned&nbsp;long&nbsp;pte_update(pte_t&nbsp;*p,</DIV>
<DIV>&nbsp; return&nbsp;old;</DIV>
<DIV>&nbsp;}</DIV>
<DIV>&nbsp;#else&nbsp;/*&nbsp;CONFIG_PTE_64BIT&nbsp;*/</DIV>
<DIV>-/*&nbsp;TODO:&nbsp;Change&nbsp;that&nbsp;to&nbsp;only&nbsp;modify&nbsp;the&nbsp;low&nbsp;word&nbsp;and&nbsp;move&nbsp;set_pte_at()</DIV>
<DIV>-&nbsp;*&nbsp;out&nbsp;of&nbsp;line</DIV>
<DIV>-&nbsp;*/</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;unsigned&nbsp;long&nbsp;long&nbsp;pte_update(pte_t&nbsp;*p,</DIV>
<DIV>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;long&nbsp;clr,</DIV>
<DIV>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;long&nbsp;set)</DIV>
<DIV>@@&nbsp;-652,16&nbsp;+650,36&nbsp;@@&nbsp;static&nbsp;inline&nbsp;unsigned&nbsp;long&nbsp;long&nbsp;pte_update(pte_t&nbsp;*p,</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;On&nbsp;machines&nbsp;which&nbsp;use&nbsp;an&nbsp;MMU&nbsp;hash&nbsp;table&nbsp;we&nbsp;avoid&nbsp;changing&nbsp;the</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;_PAGE_HASHPTE&nbsp;bit.</DIV>
<DIV>&nbsp;&nbsp;*/</DIV>
<DIV>-static&nbsp;inline&nbsp;void&nbsp;set_pte_at(struct&nbsp;mm_struct&nbsp;*mm,&nbsp;unsigned&nbsp;long&nbsp;addr,</DIV>
<DIV>+</DIV>
<DIV>+static&nbsp;inline&nbsp;void&nbsp;__set_pte_at(struct&nbsp;mm_struct&nbsp;*mm,&nbsp;unsigned&nbsp;long&nbsp;addr,</DIV>
<DIV>&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pte_t&nbsp;*ptep,&nbsp;pte_t&nbsp;pte)</DIV>
<DIV>&nbsp;{</DIV>
<DIV>&nbsp;#if&nbsp;_PAGE_HASHPTE&nbsp;!=&nbsp;0</DIV>
<DIV>&nbsp; 
pte_update(ptep,&nbsp;~_PAGE_HASHPTE,&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;~_PAGE_HASHPTE);</DIV>
<DIV>+#elif&nbsp;defined(CONFIG_PTE_64BIT)&nbsp;&amp;&amp;&nbsp;defined(CONFIG_SMP)</DIV>
<DIV>+ __asm__&nbsp;__volatile__("\</DIV>
<DIV>+ stw%U0%X0&nbsp;%2,%0\n\</DIV>
<DIV>+ eieio\n\</DIV>
<DIV>+ stw%U0%X0&nbsp;%L2,%1"</DIV>
<DIV>+ 
:&nbsp;"=m"&nbsp;(*ptep),&nbsp;"=m"&nbsp;(*((unsigned&nbsp;char&nbsp;*)ptep+4))</DIV>
<DIV>+ :&nbsp;"r"&nbsp;(pte)&nbsp;:&nbsp;"memory");</DIV>
<DIV>&nbsp;#else</DIV>
<DIV>&nbsp; *ptep&nbsp;=&nbsp;pte;</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>+static&nbsp;inline&nbsp;void&nbsp;set_pte_at(struct&nbsp;mm_struct&nbsp;*mm,&nbsp;unsigned&nbsp;long&nbsp;addr,</DIV>
<DIV>+ 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pte_t&nbsp;*ptep,&nbsp;pte_t&nbsp;pte)</DIV>
<DIV>+{</DIV>
<DIV>+#if&nbsp;defined(CONFIG_PTE_64BIT)</DIV>
<DIV>+ if&nbsp;(unlikely(pte_present(*ptep)))&nbsp;{</DIV>
<DIV>+ pte_clear(mm,&nbsp;addr,&nbsp;ptep);</DIV>
<DIV>+ smp_wmb();</DIV>
<DIV>+ }</DIV>
<DIV>+#endif</DIV>
<DIV>+ __set_pte_at(mm,&nbsp;addr,&nbsp;ptep,&nbsp;pte);</DIV>
<DIV>+}</DIV>
<DIV>+</DIV>
<DIV>&nbsp;/*</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;2.6&nbsp;calls&nbsp;this&nbsp;without&nbsp;flushing&nbsp;the&nbsp;TLB&nbsp;entry;&nbsp;this&nbsp;is&nbsp;wrong</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;for&nbsp;our&nbsp;hash-based&nbsp;implementation,&nbsp;we&nbsp;fix&nbsp;that&nbsp;up&nbsp;here.</DIV>
<DIV>--&nbsp;</DIV>
<DIV>1.5.5.1</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>Message:&nbsp;2</DIV>
<DIV>Date:&nbsp;Wed,&nbsp;17&nbsp;Sep&nbsp;2008&nbsp;18:00:04&nbsp;-0500</DIV>
<DIV>From:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org &gt;</DIV>
<DIV>Subject:&nbsp;[PATCH&nbsp;v7&nbsp;3/4]&nbsp;powerpc/fsl-booke:&nbsp;Fixup&nbsp;64-bit&nbsp;PTE&nbsp;reading</DIV>
<DIV>for&nbsp;SMP support</DIV>
<DIV>To:&nbsp;linuxppc-dev@ozlabs.org</DIV>
<DIV>Message-ID:</DIV>
<DIV>&lt;1221692405-19880-3-git-send-email-galak@kernel.crashing.org &gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>We&nbsp;need&nbsp;to&nbsp;create&nbsp;a&nbsp;false&nbsp;data&nbsp;dependency&nbsp;to&nbsp;ensure&nbsp;the&nbsp;loads&nbsp;of</DIV>
<DIV>the&nbsp;pte&nbsp;are&nbsp;done&nbsp;in&nbsp;the&nbsp;right&nbsp;order.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Signed-off-by:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org 
&gt;</DIV>
<DIV>---</DIV>
<DIV>&nbsp;arch/powerpc/kernel/head_fsl_booke.S&nbsp;|&nbsp;&nbsp;&nbsp;26&nbsp;+++++++++++++++++++++-----</DIV>
<DIV>&nbsp;1&nbsp;files&nbsp;changed,&nbsp;21&nbsp;insertions(+),&nbsp;5&nbsp;deletions(-)</DIV>
<DIV>&nbsp;</DIV>
<DIV>diff&nbsp;--git&nbsp;a/arch/powerpc/kernel/head_fsl_booke.S&nbsp;b/arch/powerpc/kernel/head_fsl_booke.S</DIV>
<DIV>index&nbsp;3cb52fa..377e0c1&nbsp;100644</DIV>
<DIV>---&nbsp;a/arch/powerpc/kernel/head_fsl_booke.S</DIV>
<DIV>+++&nbsp;b/arch/powerpc/kernel/head_fsl_booke.S</DIV>
<DIV>@@&nbsp;-579,13&nbsp;+579,19&nbsp;@@&nbsp;interrupt_base:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; FIND_PTE</DIV>
<DIV>&nbsp; andc. r13,r13,r11 /*&nbsp;Check&nbsp;permission&nbsp;*/</DIV>
<DIV>- bne 2f /*&nbsp;Bail&nbsp;if&nbsp;permission&nbsp;mismach&nbsp;*/</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#ifdef&nbsp;CONFIG_PTE_64BIT</DIV>
<DIV>- lwz r13,&nbsp;0(r12)</DIV>
<DIV>+#ifdef&nbsp;CONFIG_SMP</DIV>
<DIV>+ subf r10,r11,r12 
/*&nbsp;create&nbsp;false&nbsp;data&nbsp;dep&nbsp;*/</DIV>
<DIV>+ lwzx r13,r11,r10 /*&nbsp;Get&nbsp;upper&nbsp;pte&nbsp;bits&nbsp;*/</DIV>
<DIV>+#else</DIV>
<DIV>+ lwz r13,0(r12) /*&nbsp;Get&nbsp;upper&nbsp;pte&nbsp;bits&nbsp;*/</DIV>
<DIV>+#endif</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>&nbsp;</DIV>
<DIV>- &nbsp;/*&nbsp;Jump&nbsp;to&nbsp;common&nbsp;tlb&nbsp;load&nbsp;*/</DIV>
<DIV>+ bne 2f 
/*&nbsp;Bail&nbsp;if&nbsp;permission/valid&nbsp;mismach&nbsp;*/</DIV>
<DIV>+</DIV>
<DIV>+ /*&nbsp;Jump&nbsp;to&nbsp;common&nbsp;tlb&nbsp;load&nbsp;*/</DIV>
<DIV>&nbsp; b finish_tlb_load</DIV>
<DIV>&nbsp;2:</DIV>
<DIV>&nbsp; 
/*&nbsp;The&nbsp;bailout.&nbsp;&nbsp;Restore&nbsp;registers&nbsp;to&nbsp;pre-exception&nbsp;conditions</DIV>
<DIV>@@&nbsp;-640,10&nbsp;+646,20&nbsp;@@&nbsp;interrupt_base:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; FIND_PTE</DIV>
<DIV>&nbsp; andc. r13,r13,r11 /*&nbsp;Check&nbsp;permission&nbsp;*/</DIV>
<DIV>+</DIV>
<DIV>+#ifdef&nbsp;CONFIG_PTE_64BIT</DIV>
<DIV>+#ifdef&nbsp;CONFIG_SMP</DIV>
<DIV>+ subf r10,r11,r12 
/*&nbsp;create&nbsp;false&nbsp;data&nbsp;dep&nbsp;*/</DIV>
<DIV>+ lwzx r13,r11,r10 /*&nbsp;Get&nbsp;upper&nbsp;pte&nbsp;bits&nbsp;*/</DIV>
<DIV>+#else</DIV>
<DIV>+ lwz r13,0(r12) /*&nbsp;Get&nbsp;upper&nbsp;pte&nbsp;bits&nbsp;*/</DIV>
<DIV>+#endif</DIV>
<DIV>+#endif</DIV>
<DIV>+</DIV>
<DIV>&nbsp; bne 2f 
/*&nbsp;Bail&nbsp;if&nbsp;permission&nbsp;mismach&nbsp;*/</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#ifdef&nbsp;CONFIG_PTE_64BIT</DIV>
<DIV>- lwz r13,&nbsp;0(r12)</DIV>
<DIV>+ lwz r13,0(r12)</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; 
/*&nbsp;Jump&nbsp;to&nbsp;common&nbsp;TLB&nbsp;load&nbsp;point&nbsp;*/</DIV>
<DIV>@@&nbsp;-702,7&nbsp;+718,7&nbsp;@@&nbsp;interrupt_base:</DIV>
<DIV>&nbsp;/*</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;Both&nbsp;the&nbsp;instruction&nbsp;and&nbsp;data&nbsp;TLB&nbsp;miss&nbsp;get&nbsp;to&nbsp;this</DIV>
<DIV>&nbsp;&nbsp;*&nbsp;point&nbsp;to&nbsp;load&nbsp;the&nbsp;TLB.</DIV>
<DIV>-&nbsp;* r10&nbsp;-&nbsp;EA&nbsp;of&nbsp;fault</DIV>
<DIV>+&nbsp;* r10&nbsp;-&nbsp;available&nbsp;to&nbsp;use</DIV>
<DIV>&nbsp;&nbsp;* 
r11&nbsp;-&nbsp;TLB&nbsp;(info&nbsp;from&nbsp;Linux&nbsp;PTE)</DIV>
<DIV>&nbsp;&nbsp;* r12&nbsp;-&nbsp;available&nbsp;to&nbsp;use</DIV>
<DIV>&nbsp;&nbsp;* 
r13&nbsp;-&nbsp;upper&nbsp;bits&nbsp;of&nbsp;PTE&nbsp;(if&nbsp;PTE_64BIT)&nbsp;or&nbsp;available&nbsp;to&nbsp;use</DIV>
<DIV>--&nbsp;</DIV>
<DIV>1.5.5.1</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>Message:&nbsp;3</DIV>
<DIV>Date:&nbsp;Wed,&nbsp;17&nbsp;Sep&nbsp;2008&nbsp;18:00:05&nbsp;-0500</DIV>
<DIV>From:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org &gt;</DIV>
<DIV>Subject:&nbsp;[PATCH&nbsp;v7&nbsp;4/4]&nbsp;powerpc/mm:&nbsp;Implement&nbsp;_PAGE_SPECIAL&nbsp;&amp;</DIV>
<DIV>pte_special() for&nbsp;32-bit</DIV>
<DIV>To:&nbsp;linuxppc-dev@ozlabs.org</DIV>
<DIV>Message-ID:</DIV>
<DIV>&lt;1221692405-19880-4-git-send-email-galak@kernel.crashing.org &gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Implement&nbsp;_PAGE_SPECIAL&nbsp;and&nbsp;pte_special()&nbsp;for&nbsp;32-bit&nbsp;powerpc.&nbsp;This&nbsp;bit&nbsp;will</DIV>
<DIV>be&nbsp;used&nbsp;by&nbsp;the&nbsp;fast&nbsp;get_user_pages()&nbsp;to&nbsp;differenciate&nbsp;PTEs&nbsp;that&nbsp;correspond</DIV>
<DIV>to&nbsp;a&nbsp;valid&nbsp;struct&nbsp;page&nbsp;from&nbsp;special&nbsp;mappings&nbsp;that&nbsp;don't&nbsp;such&nbsp;as&nbsp;IO&nbsp;mappings</DIV>
<DIV>obtained&nbsp;via&nbsp;io_remap_pfn_ranges().</DIV>
<DIV>&nbsp;</DIV>
<DIV>We&nbsp;currently&nbsp;only&nbsp;implement&nbsp;this&nbsp;on&nbsp;sub-arch&nbsp;that&nbsp;support&nbsp;SMP&nbsp;or&nbsp;will&nbsp;so</DIV>
<DIV>in&nbsp;the&nbsp;future&nbsp;(6xx,&nbsp;44x,&nbsp;FSL-BookE)&nbsp;and&nbsp;not&nbsp;(8xx,&nbsp;40x).</DIV>
<DIV>&nbsp;</DIV>
<DIV>Signed-off-by:&nbsp;Kumar&nbsp;Gala&nbsp; &lt;galak@kernel.crashing.org 
&gt;</DIV>
<DIV>Acked-by:&nbsp;Benjamin&nbsp;Herrenschmidt&nbsp; 
&lt;benh@kernel.crashing.org &gt;</DIV>
<DIV>---</DIV>
<DIV>&nbsp;arch/powerpc/include/asm/pgtable-ppc32.h&nbsp;|&nbsp;&nbsp;&nbsp;15&nbsp;+++++++++++++--</DIV>
<DIV>&nbsp;1&nbsp;files&nbsp;changed,&nbsp;13&nbsp;insertions(+),&nbsp;2&nbsp;deletions(-)</DIV>
<DIV>&nbsp;</DIV>
<DIV>diff&nbsp;--git&nbsp;a/arch/powerpc/include/asm/pgtable-ppc32.h&nbsp;b/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>index&nbsp;d1d23b9..e8f31a5&nbsp;100644</DIV>
<DIV>---&nbsp;a/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>+++&nbsp;b/arch/powerpc/include/asm/pgtable-ppc32.h</DIV>
<DIV>@@&nbsp;-261,6&nbsp;+261,7&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_HWEXEC 0x00000004 
/*&nbsp;H:&nbsp;Execute&nbsp;permission&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_ACCESSED 0x00000008 
/*&nbsp;S:&nbsp;Page&nbsp;referenced&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_DIRTY 0x00000010 
/*&nbsp;S:&nbsp;Page&nbsp;dirty&nbsp;*/</DIV>
<DIV>+#define&nbsp;_PAGE_SPECIAL 0x00000020 
/*&nbsp;S:&nbsp;Special&nbsp;page&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_USER 0x00000040 
/*&nbsp;S:&nbsp;User&nbsp;page&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_ENDIAN 0x00000080 
/*&nbsp;H:&nbsp;E&nbsp;bit&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_GUARDED 0x00000100 
/*&nbsp;H:&nbsp;G&nbsp;bit&nbsp;*/</DIV>
<DIV>@@&nbsp;-276,6&nbsp;+277,7&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;/*&nbsp;ERPN&nbsp;in&nbsp;a&nbsp;PTE&nbsp;never&nbsp;gets&nbsp;cleared,&nbsp;ignore&nbsp;it&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PTE_NONE_MASK 0xffffffff00000000ULL</DIV>
<DIV>&nbsp;</DIV>
<DIV>+#define&nbsp;__HAVE_ARCH_PTE_SPECIAL</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#elif&nbsp;defined(CONFIG_FSL_BOOKE)</DIV>
<DIV>&nbsp;/*</DIV>
<DIV>@@&nbsp;-305,6&nbsp;+307,7&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_COHERENT 0x00100 
/*&nbsp;H:&nbsp;M&nbsp;bit&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_NO_CACHE 0x00200 
/*&nbsp;H:&nbsp;I&nbsp;bit&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_WRITETHRU 0x00400 
/*&nbsp;H:&nbsp;W&nbsp;bit&nbsp;*/</DIV>
<DIV>+#define&nbsp;_PAGE_SPECIAL 
0x00800&nbsp;/*&nbsp;S:&nbsp;Special&nbsp;page&nbsp;*/</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#ifdef&nbsp;CONFIG_PTE_64BIT</DIV>
<DIV>&nbsp;/*&nbsp;ERPN&nbsp;in&nbsp;a&nbsp;PTE&nbsp;never&nbsp;gets&nbsp;cleared,&nbsp;ignore&nbsp;it&nbsp;*/</DIV>
<DIV>@@&nbsp;-315,6&nbsp;+318,8&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;#define&nbsp;_PMD_PRESENT_MASK&nbsp;(PAGE_MASK)</DIV>
<DIV>&nbsp;#define&nbsp;_PMD_BAD (~PAGE_MASK)</DIV>
<DIV>&nbsp;</DIV>
<DIV>+#define&nbsp;__HAVE_ARCH_PTE_SPECIAL</DIV>
<DIV>+</DIV>
<DIV>&nbsp;#elif&nbsp;defined(CONFIG_8xx)</DIV>
<DIV>&nbsp;/*&nbsp;Definitions&nbsp;for&nbsp;8xx&nbsp;embedded&nbsp;chips.&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_PRESENT 0x0001 
/*&nbsp;Page&nbsp;is&nbsp;valid&nbsp;*/</DIV>
<DIV>@@&nbsp;-362,6&nbsp;+367,7&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_ACCESSED 0x100 
/*&nbsp;R:&nbsp;page&nbsp;referenced&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_EXEC 0x200 
/*&nbsp;software:&nbsp;i-cache&nbsp;coherency&nbsp;required&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_RW 0x400 
/*&nbsp;software:&nbsp;user&nbsp;write&nbsp;access&nbsp;allowed&nbsp;*/</DIV>
<DIV>+#define&nbsp;_PAGE_SPECIAL 0x800 
/*&nbsp;software:&nbsp;Special&nbsp;page&nbsp;*/</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;#define&nbsp;_PTE_NONE_MASK _PAGE_HASHPTE</DIV>
<DIV>&nbsp;</DIV>
<DIV>@@&nbsp;-372,6&nbsp;+378,8&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;/*&nbsp;Hash&nbsp;table&nbsp;based&nbsp;platforms&nbsp;need&nbsp;atomic&nbsp;updates&nbsp;of&nbsp;the&nbsp;linux&nbsp;PTE&nbsp;*/</DIV>
<DIV>&nbsp;#define&nbsp;PTE_ATOMIC_UPDATES 1</DIV>
<DIV>&nbsp;</DIV>
<DIV>+#define&nbsp;__HAVE_ARCH_PTE_SPECIAL</DIV>
<DIV>+</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;/*</DIV>
<DIV>@@&nbsp;-404,6&nbsp;+412,9&nbsp;@@&nbsp;extern&nbsp;int&nbsp;icache_44x_need_flush;</DIV>
<DIV>&nbsp;#ifndef&nbsp;_PAGE_WRITETHRU</DIV>
<DIV>&nbsp;#define&nbsp;_PAGE_WRITETHRU 0</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>+#ifndef&nbsp;_PAGE_SPECIAL</DIV>
<DIV>+#define&nbsp;_PAGE_SPECIAL 0</DIV>
<DIV>+#endif</DIV>
<DIV>&nbsp;#ifndef&nbsp;_PMD_PRESENT_MASK</DIV>
<DIV>&nbsp;#define&nbsp;_PMD_PRESENT_MASK _PMD_PRESENT</DIV>
<DIV>&nbsp;#endif</DIV>
<DIV>@@&nbsp;-534,7&nbsp;+545,7&nbsp;@@&nbsp;static&nbsp;inline&nbsp;int&nbsp;pte_write(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_RW;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;int&nbsp;pte_dirty(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_DIRTY;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;int&nbsp;pte_young(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_ACCESSED;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;int&nbsp;pte_file(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_FILE;&nbsp;}</DIV>
<DIV>-static&nbsp;inline&nbsp;int&nbsp;pte_special(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;0;&nbsp;}</DIV>
<DIV>+static&nbsp;inline&nbsp;int&nbsp;pte_special(pte_t&nbsp;pte) 
{&nbsp;return&nbsp;pte_val(pte)&nbsp;&amp;&nbsp;_PAGE_SPECIAL;&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;void&nbsp;pte_uncache(pte_t&nbsp;pte)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;pte_val(pte)&nbsp;|=&nbsp;_PAGE_NO_CACHE;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;void&nbsp;pte_cache(pte_t&nbsp;pte)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;pte_val(pte)&nbsp;&amp;=&nbsp;~_PAGE_NO_CACHE;&nbsp;}</DIV>
<DIV>@@&nbsp;-553,7&nbsp;+564,7&nbsp;@@&nbsp;static&nbsp;inline&nbsp;pte_t&nbsp;pte_mkdirty(pte_t&nbsp;pte)&nbsp;{</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;pte_t&nbsp;pte_mkyoung(pte_t&nbsp;pte)&nbsp;{</DIV>
<DIV>&nbsp; 
pte_val(pte)&nbsp;|=&nbsp;_PAGE_ACCESSED;&nbsp;return&nbsp;pte;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;pte_t&nbsp;pte_mkspecial(pte_t&nbsp;pte)&nbsp;{</DIV>
<DIV>- return&nbsp;pte;&nbsp;}</DIV>
<DIV>+ 
pte_val(pte)&nbsp;|=&nbsp;_PAGE_SPECIAL;&nbsp;return&nbsp;pte;&nbsp;}</DIV>
<DIV>&nbsp;static&nbsp;inline&nbsp;unsigned&nbsp;long&nbsp;pte_pgprot(pte_t&nbsp;pte)</DIV>
<DIV>&nbsp;{</DIV>
<DIV>&nbsp; 
return&nbsp;__pgprot(pte_val(pte))&nbsp;&amp;&nbsp;PAGE_PROT_BITS;</DIV>
<DIV>--&nbsp;</DIV>
<DIV>1.5.5.1</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>_______________________________________________</DIV>
<DIV>Linuxppc-dev&nbsp;mailing&nbsp;list</DIV>
<DIV>Linuxppc-dev@ozlabs.org</DIV>
<DIV>https://ozlabs.org/mailman/listinfo/linuxppc-dev</DIV>
<DIV>&nbsp;</DIV>
<DIV>End&nbsp;of&nbsp;Linuxppc-dev&nbsp;Digest,&nbsp;Vol&nbsp;49,&nbsp;Issue&nbsp;89</DIV>
<DIV>********************************************</DIV></FONT></DIV></BODY></HTML>