Message ID | 20180109170113.20768-1-michael@walle.cc |
---|---|
State | New |
Headers | show |
Series | lm32: take BQL before writing IP/IM register | expand |
Hi Peter, do you apply this patch? Or do I have to send a pull request? -michael Am 2018-01-09 18:01, schrieb Michael Walle: > Writing to these registers may raise an interrupt request. Actually, > this prevents the milkymist board from starting. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Michael Walle <michael@walle.cc> > --- > target/lm32/op_helper.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c > index 30f670eee8..a766a1ece4 100644 > --- a/target/lm32/op_helper.c > +++ b/target/lm32/op_helper.c > @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t > dc) > > void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) > { > + qemu_mutex_lock_iothread(); > lm32_pic_set_im(env->pic_state, im); > + qemu_mutex_unlock_iothread(); > } > > void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) > { > + qemu_mutex_lock_iothread(); > lm32_pic_set_ip(env->pic_state, im); > + qemu_mutex_unlock_iothread(); > } > > void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)
On 02/01/2018 06:09 AM, Michael Walle wrote: > > Hi Peter, > > do you apply this patch? Or do I have to send a pull request? Cc'ing Paolo. > > -michael > > Am 2018-01-09 18:01, schrieb Michael Walle: >> Writing to these registers may raise an interrupt request. Actually, >> this prevents the milkymist board from starting. >> >> Cc: qemu-stable@nongnu.org >> Signed-off-by: Michael Walle <michael@walle.cc> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> >> --- >> target/lm32/op_helper.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c >> index 30f670eee8..a766a1ece4 100644 >> --- a/target/lm32/op_helper.c >> +++ b/target/lm32/op_helper.c >> @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t >> dc) >> >> void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) >> { >> + qemu_mutex_lock_iothread(); >> lm32_pic_set_im(env->pic_state, im); >> + qemu_mutex_unlock_iothread(); >> } >> >> void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) >> { >> + qemu_mutex_lock_iothread(); >> lm32_pic_set_ip(env->pic_state, im); >> + qemu_mutex_unlock_iothread(); >> } >> >> void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx) >
Michael Walle <michael@walle.cc> writes: > Writing to these registers may raise an interrupt request. Actually, > this prevents the milkymist board from starting. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> > --- > target/lm32/op_helper.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c > index 30f670eee8..a766a1ece4 100644 > --- a/target/lm32/op_helper.c > +++ b/target/lm32/op_helper.c > @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc) > > void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) > { > + qemu_mutex_lock_iothread(); > lm32_pic_set_im(env->pic_state, im); > + qemu_mutex_unlock_iothread(); > } > > void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) > { > + qemu_mutex_lock_iothread(); > lm32_pic_set_ip(env->pic_state, im); > + qemu_mutex_unlock_iothread(); > } > > void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx) -- Alex Bennée
On 09/05/2018 21:45, Philippe Mathieu-Daudé wrote: > On 02/01/2018 06:09 AM, Michael Walle wrote: >> >> Hi Peter, >> >> do you apply this patch? Or do I have to send a pull request? > > Cc'ing Paolo. Please send a pull request. Paolo >> >> -michael >> >> Am 2018-01-09 18:01, schrieb Michael Walle: >>> Writing to these registers may raise an interrupt request. Actually, >>> this prevents the milkymist board from starting. >>> >>> Cc: qemu-stable@nongnu.org >>> Signed-off-by: Michael Walle <michael@walle.cc> > > Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > >>> --- >>> target/lm32/op_helper.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c >>> index 30f670eee8..a766a1ece4 100644 >>> --- a/target/lm32/op_helper.c >>> +++ b/target/lm32/op_helper.c >>> @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t >>> dc) >>> >>> void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) >>> { >>> + qemu_mutex_lock_iothread(); >>> lm32_pic_set_im(env->pic_state, im); >>> + qemu_mutex_unlock_iothread(); >>> } >>> >>> void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) >>> { >>> + qemu_mutex_lock_iothread(); >>> lm32_pic_set_ip(env->pic_state, im); >>> + qemu_mutex_unlock_iothread(); >>> } >>> >>> void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx) >>
diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c index 30f670eee8..a766a1ece4 100644 --- a/target/lm32/op_helper.c +++ b/target/lm32/op_helper.c @@ -102,12 +102,16 @@ void HELPER(wcsr_dc)(CPULM32State *env, uint32_t dc) void HELPER(wcsr_im)(CPULM32State *env, uint32_t im) { + qemu_mutex_lock_iothread(); lm32_pic_set_im(env->pic_state, im); + qemu_mutex_unlock_iothread(); } void HELPER(wcsr_ip)(CPULM32State *env, uint32_t im) { + qemu_mutex_lock_iothread(); lm32_pic_set_ip(env->pic_state, im); + qemu_mutex_unlock_iothread(); } void HELPER(wcsr_jtx)(CPULM32State *env, uint32_t jtx)
Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Walle <michael@walle.cc> --- target/lm32/op_helper.c | 4 ++++ 1 file changed, 4 insertions(+)