qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 2/2] target/lm32: hold BQL in gdbstub
Date: Mon, 21 May 2018 17:49:31 +0200	[thread overview]
Message-ID: <7bf9b59e7e457efc1a117597ab8d4aae@walle.cc> (raw)
In-Reply-To: <CAFEAcA-Q6c7Z49uxup1HdyaEvWt+er_B8eYcJn0UYDiXShz1eQ@mail.gmail.com>

Am 2018-05-21 14:25, schrieb Peter Maydell:
> On 21 May 2018 at 13:21, Michael Walle <michael@walle.cc> wrote:
>> Changing the IP/IM registers may cause interrupts, so hold the BQL.
>> 
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Michael Walle <michael@walle.cc>
>> ---
>>  target/lm32/gdbstub.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/target/lm32/gdbstub.c b/target/lm32/gdbstub.c
>> index cf929dd392..dac9418a2b 100644
>> --- a/target/lm32/gdbstub.c
>> +++ b/target/lm32/gdbstub.c
>> @@ -18,6 +18,7 @@
>>   * License along with this library; if not, see 
>> <http://www.gnu.org/licenses/>.
>>   */
>>  #include "qemu/osdep.h"
>> +#include "qemu/main-loop.h"
>>  #include "qemu-common.h"
>>  #include "cpu.h"
>>  #include "exec/gdbstub.h"
>> @@ -82,10 +83,14 @@ int lm32_cpu_gdb_write_register(CPUState *cs, 
>> uint8_t *mem_buf, int n)
>>              env->ie = tmp;
>>              break;
>>          case 37:
>> +            qemu_mutex_lock_iothread();
>>              lm32_pic_set_im(env->pic_state, tmp);
>> +            qemu_mutex_unlock_iothread();
>>              break;
>>          case 38:
>> +            qemu_mutex_lock_iothread();
>>              lm32_pic_set_ip(env->pic_state, tmp);
>> +            qemu_mutex_unlock_iothread();
>>              break;
>>          }
>>      }
> 
> Are you sure this is necessary? I would have expected the gdbstub to
> be operating under the qemu lock anyway.


You're right. The gdbstub is already holding the lock. So i'll drop this 
and send the pull request right now.

-michael

      parent reply	other threads:[~2018-05-21 15:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 12:20 [Qemu-devel] [PATCH v2 0/2] BQL patches for the lm32 target Michael Walle
2018-05-21 12:20 ` [Qemu-devel] [PATCH v2 1/2] lm32: take BQL before writing IP/IM register Michael Walle
2018-05-21 12:21 ` [Qemu-devel] [PATCH v2 2/2] target/lm32: hold BQL in gdbstub Michael Walle
2018-05-21 12:25   ` Peter Maydell
2018-05-21 12:29     ` Peter Maydell
2018-05-21 15:49     ` Michael Walle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bf9b59e7e457efc1a117597ab8d4aae@walle.cc \
    --to=michael@walle.cc \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).