qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: glommer@redhat.com, qemu-devel@nongnu.org,
	Isaku Yamahata <yamahata@valinux.co.jp>,
	alex.williamson@redhat.com, avi@redhat.com,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] Re: [PATCH 5/5] RFC: distinguish warm reset from cold reset.
Date: Mon, 30 Aug 2010 15:10:04 -0500	[thread overview]
Message-ID: <4C7C101C.4060204@codemonkey.ws> (raw)
In-Reply-To: <AANLkTikZJ-eXHnuZKuoFC3U9DgnO3mvF_Vno-N64BPuy@mail.gmail.com>

On 08/30/2010 02:36 PM, Blue Swirl wrote:
> On Mon, Aug 30, 2010 at 7:25 PM, Anthony Liguori<anthony@codemonkey.ws>  wrote:
>    
>> On 08/30/2010 02:16 PM, Blue Swirl wrote:
>>      
>>> On Mon, Aug 30, 2010 at 1:03 PM, Anthony Liguori<anthony@codemonkey.ws>
>>>   wrote:
>>>
>>>        
>>>> On 08/30/2010 03:50 AM, Paolo Bonzini wrote:
>>>>
>>>>          
>>>>> On 08/30/2010 09:49 AM, Isaku Yamahata wrote:
>>>>>
>>>>>            
>>>>>> +/* those two functions are obsoleted by cold/warm reset API. */
>>>>>> [qemu_register_reset/qemu_unregister_reset]
>>>>>>
>>>>>>              
>>>>> Are they?
>>>>>
>>>>>            
>>>> Yes, but introduce more reset functions isn't the right approach.
>>>>
>>>> Reset should be a method of the device tree, not a stand alone function.
>>>>
>>>>          
>>> In theory the reset tree may be very different from device tree. In
>>> practice the reset tree is probably very flat (global reset signal, a
>>> few bus reset signals) so device tree approach may get the same
>>> results.
>>>
>>>        
>> Well the device tree doesn't really have to be a tree :-)
>>      
> True, but is the non-tree still always useful for other things besides
> reset? Again, in theory.
>    

I think non-tree transversal are not the norm.  But I guess my point is, 
being a tree verses a directed graph is really just a state of mind :-)

If we use a visitor pattern and then allow a visitor to redirect the 
recursion, then assuming the nodes have links to other nodes that don't 
fall in the normal tree hierarchy, it should just work.

OTOH, if we really designed it as a graph we would need to keep a 
visited history which generally is a pain in the butt.  I don't want to 
do that but I think what we have now is good enough.

>> My thinking if we need to support custom reset propagation is that we have
>> the current reset() handler return 0 to propagate to children,<  0 on error,
>> and>  0 to not propagate to direct children just as we do with the walkers.
>>
>> In the case of>  0, the device can choose to propagate to any device that it
>> knows about independent of the default walking order.  This makes the device
>> tree a directed graph whereas the transversal path can be arbitrarily
>> custom.
>>      
> I'd rather not have that much knowledge about the reset tree in the devices.
>    

Aren't the devices the precise place where that knowledge should 
reside?  Is the reset tree really every implemented entirely based on 
complex wiring that exists outside of any type of bus topology?

>> The only questions in my mind are, do we truly need this and do we need more
>> than a single type of reset.  We could make this almost arbitrarily
>> complicated if we wanted to but we should try to keep things simply unless
>> there's a compelling reason not to.
>>      
> Fully agreed, I think current model works. But I'm not opposed to a
> more generic approach, like VM events, combining also power control
> with reset. Though events would not help with the disjoint tree
> problem.
>
> With qemu_irq approach, each event would be replaced by a signal type
> with a few instances. The devices would be as simple as now, but
> wiring in the board level would be bloated.
>    

A signal/slot infrastructure would be a better way to express this sort 
of thing because at the wire level, you'll quickly encounter line 
repeaters, muxers, and demuxers.

But I think we're far ahead of ourselves.  I think we'll solve the 
current problem merely by taking the approach in my previous patch and 
simply making something like PCI AER initialization part of the init() 
routine and not part of the reset() routine.

Regards,

Anthony Liguori

  reply	other threads:[~2010-08-30 20:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30  7:49 [Qemu-devel] [PATCH 0/5] RFC: distinguish warm reset from cold reset Isaku Yamahata
2010-08-30  7:49 ` [Qemu-devel] [PATCH 1/5] sysemu.h, vl.c: static'fy qemu_xxx_requested() Isaku Yamahata
2010-08-30  7:49 ` [Qemu-devel] [PATCH 2/5] vl.c: consolidate qemu_xxx_requested() logic Isaku Yamahata
2010-08-30  7:49 ` [Qemu-devel] [PATCH 3/5] vl.c: consolidate qemu_system_xxx_request() logic Isaku Yamahata
2010-08-30  7:49 ` [Qemu-devel] [PATCH 4/5] vl.c: factor out qemu_reguster/unregister_reset() Isaku Yamahata
2010-08-30  7:49 ` [Qemu-devel] [PATCH 5/5] RFC: distinguish warm reset from cold reset Isaku Yamahata
2010-08-30  8:50   ` [Qemu-devel] " Paolo Bonzini
2010-08-30  9:38     ` Isaku Yamahata
2010-08-30  9:31       ` Paolo Bonzini
2010-08-30 13:03     ` Anthony Liguori
2010-08-30 19:16       ` Blue Swirl
2010-08-30 19:25         ` Anthony Liguori
2010-08-30 19:36           ` Blue Swirl
2010-08-30 20:10             ` Anthony Liguori [this message]
2010-08-30 12:59   ` Anthony Liguori
2010-08-31  2:58     ` Isaku Yamahata
2010-08-31 13:08       ` Anthony Liguori
2010-08-31 13:14         ` Gleb Natapov
2010-08-31 13:20           ` Anthony Liguori
2010-08-31 13:21             ` Gleb Natapov
2010-08-31 13:26               ` Anthony Liguori
2010-08-31 13:29                 ` Avi Kivity
2010-08-31 13:34                   ` Anthony Liguori
2010-08-31 13:46                     ` Avi Kivity
2010-08-31 13:58                       ` Anthony Liguori
2010-08-31 14:03                         ` Gleb Natapov
2010-08-31 14:03                         ` Avi Kivity
2010-08-31 15:00                           ` Anthony Liguori
2010-08-31 16:04                             ` Avi Kivity
2010-08-31 13:35                   ` Gleb Natapov
2010-08-30  7:59 ` [Qemu-devel] Re: [PATCH 0/5] " Avi Kivity
2010-08-30  8:35   ` Isaku Yamahata
2010-08-30 11:19     ` Gleb Natapov
2010-08-30 13:05       ` Anthony Liguori
2010-08-30 13:15         ` Gleb Natapov
2010-08-30 19:07       ` Blue Swirl
2010-08-31  5:26         ` Gleb Natapov
2010-08-30 13:04     ` Glauber Costa

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=4C7C101C.4060204@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=glommer@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yamahata@valinux.co.jp \
    /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).