All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"Huangweidong (C)" <weidong.huang@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] rtc: placing RTC memory region outside BQL
Date: Sun, 4 Feb 2018 18:02:02 +0000	[thread overview]
Message-ID: <CAFEAcA_6wg6aS_g0mGcNyjC57BVoU+pxdaRU3buM5J6b3XNW-Q@mail.gmail.com> (raw)
In-Reply-To: <d2f644da-e6c8-da3a-55e4-13ae69c44fc4@redhat.com>

On 1 February 2018 at 14:23, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 01/02/2018 08:47, Gonglei wrote:
>> diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
>> index 35a05a6..d9d99c5 100644
>> --- a/hw/timer/mc146818rtc.c
>> +++ b/hw/timer/mc146818rtc.c
>> @@ -986,6 +986,7 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
>>      qemu_register_suspend_notifier(&s->suspend_notifier);
>>
>>      memory_region_init_io(&s->io, OBJECT(s), &cmos_ops, s, "rtc", 2);
>> +    memory_region_clear_global_locking(&s->io);
>>      isa_register_ioport(isadev, &s->io, base);
>>
>>      qdev_set_legacy_instance_id(dev, base, 3);
>>
>
> This is not enough, you need to add a new lock or something like that.
> Otherwise two vCPUs can access the RTC together and make a mess.

Do you also need to do something to take the global lock before
raising the outbound IRQ line (since it might be connected to a device
that does need the global lock), or am I confused ?

thanks
-- PMM

  parent reply	other threads:[~2018-02-04 18:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 13:47 [Qemu-devel] [PATCH] rtc: placing RTC memory region outside BQL Gonglei
2018-02-01 14:23 ` Paolo Bonzini
2018-02-04  6:20   ` Gonglei (Arei)
2018-02-04 18:02   ` Peter Maydell [this message]
2018-02-05 14:04     ` Paolo Bonzini
2018-02-06  8:24       ` Gonglei (Arei)
2018-02-06  9:49         ` Peter Maydell
2018-02-06 13:05           ` Gonglei (Arei)
2018-02-01 13:51 Gonglei

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=CAFEAcA_6wg6aS_g0mGcNyjC57BVoU+pxdaRU3buM5J6b3XNW-Q@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weidong.huang@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.