Skip to content

Smc opt support more store - #179

Merged
luzeng87 merged 3 commits into
lat-opensource:masterfrom
NiuGenen:smc-opt-support-more-store
Dec 5, 2025
Merged

luzeng87 merged 3 commits into
lat-opensource:masterfrom
NiuGenen:smc-opt-support-more-store

Conversation

@NiuGenen

@NiuGenen NiuGenen commented Dec 4, 2025

Copy link
Copy Markdown
Contributor
  • 增加 smc 解释执行更多指令的支持
  • 对原子指令的 sc.w/d/q 的解释执行无法保证原子性,回退到清空整个页的策略
  • 对其他更多尚未支持的指令,避免程序直接 abort 退出,增加打印信息并有简单统计

#177

The SMC code-first optimization is enabled by default. But not all store inst
are supported to be interpreted after smc.

This patch supports some more store inst (stptr, fst, vxst) to be interpreted
in smc strategy. To avoid abort, when the store is unsupport or sc.w/d/q,
the strategy on this page will fallback to the original write-first way,
which means all TB on this page will be invalidated to make this page writable
and return back to execute the original store inst.

A simple profiling work is performed for this fallback case.  If this case
occurs too much, some info will be printed to indicate futher optimization.

Signed-off-by: NiuGenen <[email protected]>
The fst can not be interpreted directly since the signal context does
not contains the FTOP in loongarch old world.

A special glue code is used to interpret the fst inst. But it only
works when the memory accress does not across host page boundary.
If it across the host page boundary, fallback to original write-first
strategy, which invalidates all TB on this page to make it writable
and return back to the original fst inst. Since it across the
host page boundary, all TB on these two host pages will be invalidated.

Signed-off-by: NiuGenen <[email protected]>
avoid refering null pointer

Signed-off-by: NiuGenen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants