On 5/15/20 2:25 PM, Peter Maydell wrote: >> You also need to call arm_rebuild_hflags() after modifying CPSR_E >> otherwise the change doesn't take effect. > > Hmm. I was expecting cpsr_write() to take care of that if we > updated a cpsr flag that was in the hflags, but it looks like > the rebuild_hflags() is in the HELPER() wrapper but not in > cpsr_write() itself. Richard, does anything go wrong if > cpsr_write() proper does the hflags rebuild ?
We wind up rebuilding hflags multiple times, is all. Most of the time we call cpsr_write we also do something else that also requires a rebuild. So we do it once after all updates. We could probably rearrange code such that the cpsr_write is last, and then sink the rebuild. But I don't know if that's clearer, hiding the side effect. r~