[PATCH] D153865: [LoongArch] Add back SDNPSideEffect properties to CSR and IOCSR read ops

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 06:40:42 PDT 2023


xen0n added a comment.

In D153865#4452333 <https://reviews.llvm.org/D153865#4452333>, @xen0n wrote:

> In D153865#4452321 <https://reviews.llvm.org/D153865#4452321>, @SixWeining wrote:
>
>> Interesting. Does cpucfg have the same issue?
>
> In theory CPUCFG data could be altered by writing to certain model-specific CSRs, but I don't think it's worthwhile to make it volatile too, because no kernel should be doing that under the hood (at most do this once before starting even PID1; in fact no known LoongArch OSes do this).

Another reason why changing CPUCFG is effectively never done: the MCSRs are entirely undocumented (the only existence being in the kernel sources and semantics only narrowly and anecdotally dispersed), thus unreliable to depend on.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153865/new/

https://reviews.llvm.org/D153865



More information about the llvm-commits mailing list