Skip to contentSkip to conversation

disable interrupt for non-LLSC atomic set

PATCH In review Jun Sun 2 participants 4 messages Jan 11, 2002 MIPS

lore
Share & tools
lore

Jun Sun

author
#0 lore raw

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?

http://linux.junsun.net/patches/oss.sgi.com/submitted/020110.disable-intr-for-nollsc-atomic-set.patch

Jun

#1 lore raw
Quoted 3 lines · Jun Sun

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.

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        +
author
#2 lore raw
Quoted 9 lines · Maciej W. Rozycki
Quoted 3 lines · Jun Sun

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.

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

#3 lore raw
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        +