I have in the code reading of clear-on-read register (mapped to memory, not part of the CPU) in place that may be interrupted, but the interrupt will always return to the same context.
I was thinking that if the CPU pipeline reads the clear-on-read register, but before executing the instruction the CPU will be interrupted, when it will return it will re-read the clear-on-read register which is now cleared due to the previous read that was interrupted.
Is this scenario is valid? if yes, how it should be handled?