qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] in a device or CPU instance init/realize, can I rely on


From: Peter Maydell
Subject: Re: [Qemu-devel] in a device or CPU instance init/realize, can I rely on something having the BQL or equivalent?
Date: Thu, 7 Dec 2017 17:13:10 +0000

On 7 December 2017 at 17:07, Eduardo Habkost <address@hidden> wrote:
> On Thu, Dec 07, 2017 at 04:53:59PM +0000, Peter Maydell wrote:
>> On 7 December 2017 at 16:48, Igor Mammedov <address@hidden> wrote:
>> > On Thu, 7 Dec 2017 16:05:50 +0000
>> > Peter Maydell <address@hidden> wrote:
>> >
>> >> Hi; I'm currently writing '-cpu max' support for ARM. For that I'd
>> >> like to be able to do the "probe host kernel for its supported feature
>> >> set" in the CPU object's instance-init function, but I'd like to do
>
> I don't think instance_init is appropriate for that, as
> object_free(object_new(t)) must be always safe to call and free
> of side-effects for all types.  Wouldn't it work if you do that
> on realize?

I think we need the information before realize, but I'll double
check. In any case the probe is safe to call and free of side-effects.
(If it fails we can stash a flag that we didn't manage to probe, which
realize can check.)

>> Right, that was my question -- are we guaranteed that anything
>> that calls object_new(cpu) does it with a lock?
>
> object_new() itself doesn't seem to be thread-safe (see
> type_initialize()), so I'm pretty sure there shouldn't be any
> object_new() calls in QEMU without the BQL being held.

Cool.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]