qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Jan Kiszka <jan.kiszka@web.de>, qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 4/4] i8254: convert to qdev
Date: Sun, 6 Mar 2011 23:15:56 +0200	[thread overview]
Message-ID: <AANLkTik=jPjQApKTH99ZCcRfyg-E7=RQTv0xW2X3JWxW@mail.gmail.com> (raw)
In-Reply-To: <4D73F272.50105@codemonkey.ws>

On Sun, Mar 6, 2011 at 10:45 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 03/06/2011 12:06 PM, Jan Kiszka wrote:
>>>
>>> In the system we model, the PIT is part of the PIIX3.  The right way to
>>> model it is as a DeviceState that's no_user=1 and created as part of the
>>> initialized of PIIX3 (for the PC at least).
>>>
>>> LPC is still an expansion bus and it's primarily used for discrete
>>> components like a TPM.  For components that are all part of a Super I/O
>>> chip, there really just isn't a bus in the middle.
>>>
>>
>> There surely is some bus (or even multiple), just not external an one.
>>
>
> It almost doesn't matter.  It would look like:
>
> I8254 is-a DeviceState
>
> SuperIO has-a I8254
>
> And the has-a relationship might be some custom bus mechanism (even if it's
> purely a VHDL or software concept).
>
> But in terms of modelling, we make I8254 a DeviceState because we don't care
> what bus it sits on.

Southbridge (+Super I/O) provides an ISA bus, partially internal and
external (LPC). i8254 is one of those devices, so calling it an
ISADevice is not completely wrong.

>> Most of the currently ISA-attached devices are chipset internal.
>
> Yeah, and making them ISA devices was the wrong thing to do.  This is all
> going to have to be redone in the not too distant future.

I don't think the recent discussion about device models was very
conclusive. Maybe patches would clarify.

> An is-a relationship only makes sense when the device is naturally
> represented as the parent object.
>
>>  They
>> belong to the PIIX3, so they need to be attached to some bus that is
>> owned by this device. If that is its ISA bus or a separate one for
>> internal devices - really, this looks like an academic discussion to me.
>>
>
> It's far from academic as this is user-visible and visible via the command
> line.

Currently the device tree looks like this (extracted from 'info qtree' output):
bus: main-system-bus
  type System
  dev: i440FX-pcihost, id ""
    irq 0
    bus: pci.0
      type PCI
      dev: PIIX3, id ""
        class ISA bridge, addr 00:01.0, pci id 8086:7000 (sub 1af4:1100)
        bus: isa.0
          type ISA
          dev: isa-pit, id ""
            dev-prop: irq = 0
            dev-prop: iobase = 0x40

I don't think this is completely wrong. 'isa-pit' device is in fact
part of PIIX3 and that is not visible. The tree should probably
reflect that somehow (for example, name the device PIIX3-isa-pit).

  reply	other threads:[~2011-03-06 21:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 21:10 [Qemu-devel] [PATCH 4/4] i8254: convert to qdev Blue Swirl
2011-03-06 15:10 ` [Qemu-devel] " Jan Kiszka
2011-03-06 15:35   ` Blue Swirl
2011-03-06 15:39     ` Jan Kiszka
2011-03-06 16:06       ` Blue Swirl
2011-03-06 16:08         ` Jan Kiszka
2011-03-06 16:31 ` [Qemu-devel] " Anthony Liguori
2011-03-06 16:47   ` Blue Swirl
2011-03-06 17:35     ` Blue Swirl
2011-03-06 17:47     ` Anthony Liguori
2011-03-06 18:06       ` [Qemu-devel] " Jan Kiszka
2011-03-06 20:45         ` Anthony Liguori
2011-03-06 21:15           ` Blue Swirl [this message]
2011-03-06 21:18           ` Jan Kiszka
2011-03-07  0:32             ` Anthony Liguori
2011-03-07  7:58               ` Jan Kiszka
2011-03-07 14:57                 ` Anthony Liguori
2011-03-07 15:46                   ` Jan Kiszka

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='AANLkTik=jPjQApKTH99ZCcRfyg-E7=RQTv0xW2X3JWxW@mail.gmail.com' \
    --to=blauwirbel@gmail.com \
    --cc=anthony@codemonkey.ws \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    /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).