# Re: \[PATCH V2 04/68\] powerpc/mm: Use big endian page table for book3s 64

- From: Aneesh Kumar K.V \<hidden\>
- Date: 2016-05-30 14:48:30 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2016/05/9490155
- Thread: https://ratatoskr.run/linuxppc-dev/2016/04/9489240/t/2.md

```text
Benjamin Herrenschmidt [ref] writes:

> On Mon, 2016-05-30 at 14:12 +0530, Aneesh Kumar K.V wrote:
>> =C2=A0/* Encode and de-code a swap entry */
>> @@ -516,10 +533,12 @@ static inline pte_t pte_swp_mksoft_dirty(pte_t
>> pte)
>> =C2=A0{
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return __pte(pte_val(pte=
) | _PAGE_SWP_SOFT_DIRTY);
>> =C2=A0}
>
> These kind of setters (and mkspecial etc...) could also just OR
> the byteswapped constant to the raw PTE..
>

We seems to be doing the right thing w.r.t setters


static inline pte_t pte_mkdirty(pte_t pte)
{
        return __pte(pte_val(pte) | _PAGE_DIRTY | _PAGE_SOFT_DIRTY);
     9d8:       ff ff 40 39     li      r10,-1
     9dc:       04 00 4a 79     rldicr  r10,r10,0,0
     9e0:       78 53 2a 7d     or      r10,r9,r10
}

-aneesh
```
