On 1 February 2018 at 14:23, Paolo Bonzini <pbonz...@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)
>> 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 ?