qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RESEND PATCH v8 2/4] hw: add a wrapper for registering


From: Igor Mammedov
Subject: Re: [Qemu-devel] [RESEND PATCH v8 2/4] hw: add a wrapper for registering reset handler
Date: Fri, 26 Jun 2015 11:19:41 +0200

On Thu, 25 Jun 2015 19:28:51 +0200
Andreas Färber <address@hidden> wrote:

> Am 25.06.2015 um 19:00 schrieb Paolo Bonzini:
> > On 25/06/2015 04:17, Zhu Guihua wrote:
> >> Add a wrapper to specify reset order when registering reset handler,
> >> instead of non-obvious initiazation code ordering.
> >>
> >> Signed-off-by: Zhu Guihua <address@hidden>
> > 
> > I'm sorry, this is not really acceptable.  The initialization code
> > ordering is good because it should be okay to run reset handlers in the
> > same order as code is run.  If there are dependencies between reset
> > handlers, a random integer is not a maintainable way to maintain them.
> > 
> > Instead, you should have a single reset handler that calls the reset
> > handlers in the right order; for example a qdev bus such as icc_bus
> > always resets children before parents.
> > 
> > Are you sure that you want to remove the icc_bus?... What are you
> > gaining exactly by doing so?
> 
> From my view we would be gaining by making the APIC an integral part
> (child<>) of the CPU in a follow-up step (there's a TODO to make things
> link<>s).
That's one of the reasons, I've asked to get rid of icc-bus.

Another reason is to move default APIC MMIO mapping to CPU from board
and handle region remapping from CPU itself as it's supposed to be if CPU
would program another APIC base.

Paolo,
would following change be acceptable:

x86_cpu_realize() {
   if (tcg) {
      memory_region_add_subregion_overlap(cpu->as, apic->mr)
   } else {
      if (map_once)
          memory_region_add_subregion_overlap(get_system_memory(), apic->mr)
   }
}
still a hack but a localized to CPU

> 
> But either way the CPU's existing reset handler should be able to handle
> CPU/APIC interdependencies just fine, somehow. Which is what Eduardo
> said on v6 and v7. (Another alternative he raised was a machine init
> notifier, but I see no code for that after its mention on v7?)
> 
> Cheers,
> Andreas
> 




reply via email to

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