disable interrupt for non-LLSC atomic set
PATCH 1/1 disable interrupt for non-LLSC atomic set
The current MIPS_ATOMIC set code for no-LLSC case does a load and store with interrupt open. This is potentially dangerous as an interrupt could happen in-between and cause the value changed inside the interrupt handler. Therefore the load/store is not atomic anymore.
Does the following patch look good to fix that?
Jun
Quoted 3 lines · Jun Sun
The current
MIPS_ATOMICset code for no-LLSC case does a load and store with interrupt open. This is potentially dangerous as an interrupt could happen in-between and cause the value changed inside the interrupt handler.
No need to -- no sane interrupt handler will ever access a user's atomic
variable.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 9 lines · Maciej W. Rozycki
Quoted 3 lines · Jun Sun
The current
MIPS_ATOMICset code for no-LLSC case does a load and store with interrupt open. This is potentially dangerous as an interrupt could happen in-between and cause the value changed inside the interrupt handler.No need to -- no sane interrupt handler will ever access a user's atomic
variable.
OK, I have to reveal the secret desire :-). I have a patch that makes MIPS kernel preemptible, and that unprotected operation becomes very volunerable with the preemptible patch.
Jun
Quoted 6 lines · Jun Sun
Quoted 2 lines
No need to -- no sane interrupt handler will ever access a user's atomic
variable.OK, I have to reveal the secret desire :-). I have a patch that makes MIPS kernel preemptible, and that unprotected operation becomes very volunerable with the preemptible patch.
I see. But why not to keep the MIPS_ATOMIC update together with the
patch then? It doesn't look like such a patch is going into the official kernel anytime soon.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +