All of lore.kernel.org
 help / color / mirror / Atom feed
* arm64 cache policy setting
@ 2022-03-16  2:32 JeongHwan Kim
  2022-03-16  9:01 ` Chan Kim
  0 siblings, 1 reply; 2+ messages in thread
From: JeongHwan Kim @ 2022-03-16  2:32 UTC (permalink / raw)
  To: kernelnewbies

Hi, everyone


In Kernel version 5.16, ARM mmu routine, I can find "cachepolicy" kernel 
parameter to change cache policy.

But, I cannot find it in ARM64 source code.

Is there any method for setting cache policy in ARM64?


Thanks in advance.

J.Hwan Kim


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

* RE: arm64 cache policy setting
  2022-03-16  2:32 arm64 cache policy setting JeongHwan Kim
@ 2022-03-16  9:01 ` Chan Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Chan Kim @ 2022-03-16  9:01 UTC (permalink / raw)
  To: 'JeongHwan Kim', kernelnewbies


Hello, JeongHwan,
I'm relatively new to arm64 but there is MAIR (memory attribute indirection
register) which contains bytes holding cacheability, shareability and
protection information and the actual page table contains the 'index' for
the byte in this MAIR. 
For example in linux-5.10-0 which I'm seeing now, in pgattr_change_is_safe
function (to check if changing attribute is safe?), there is this code.

/*
     * Changing the memory type between Normal and Normal-Tagged is safe
     * since Tagged is considered a permission attribute from the
     * mismatched attribute aliases perspective.
     */
    if (((old & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL) ||
         (old & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL_TAGGED)) &&
        ((new & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL) ||
         (new & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL_TAGGED)))
        mask |= PTE_ATTRINDX_MASK;
it uses these index operation and actual cache policies are defined by the
MT_NORMAL (memory type normal) etc.
Hope this answers your question.

Chan
> -----Original Message-----
> From: JeongHwan Kim <frog007.kernel.kr@gmail.com>
> Sent: Wednesday, March 16, 2022 11:32 AM
> To: kernelnewbies@kernelnewbies.org
> Subject: arm64 cache policy setting
> 
> Hi, everyone
> 
> 
> In Kernel version 5.16, ARM mmu routine, I can find "cachepolicy" kernel
> parameter to change cache policy.
> 
> But, I cannot find it in ARM64 source code.
> 
> Is there any method for setting cache policy in ARM64?
> 
> 
> Thanks in advance.
> 
> J.Hwan Kim
> 
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

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

end of thread, other threads:[~2022-03-16  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  2:32 arm64 cache policy setting JeongHwan Kim
2022-03-16  9:01 ` Chan Kim

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.