[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rtc: placing RTC memory region outside BQL
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] rtc: placing RTC memory region outside BQL |
Date: |
Tue, 6 Feb 2018 09:49:17 +0000 |
On 6 February 2018 at 08:24, Gonglei (Arei) <address@hidden> wrote:
> So, taking BQL is necessary, and what we can do is trying our best to narrow
> down the process of locking ? For example, do the following wrapping:
>
> static void rtc_rasie_irq(RTCState *s)
> {
> qemu_mutex_lock_iothread();
> qemu_irq_raise(s->irq);
> qemu_mutex_unlock_iothread();
> }
>
> static void rtc_lower_irq(RTCState *s)
> {
> qemu_mutex_lock_iothread();
> qemu_irq_lower(s->irq);
> qemu_mutex_unlock_iothread();
> }
If you do that you'll also need to be careful about not calling
those functions from contexts where you already hold the iothread
mutex (eg timer callbacks), since you can't lock a mutex you
already have locked.
thanks
-- PMM