All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Roman Kagan <rkagan@virtuozzo.com>,
	Markus Armbruster <armbru@redhat.com>,
	Evgeny Yakovlev <eyakovlev@virtuozzo.com>,
	Alexander Graf <agraf@suse.de>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>
Subject: Re: [Qemu-devel] vmbus bridge: machine property or device?
Date: Thu, 13 Apr 2017 17:58:51 +0100	[thread overview]
Message-ID: <CAFEAcA_VQGDXmMmcTdzwb-UA4sVF1jeXfnXyUBNnZU2E4jdUPw@mail.gmail.com> (raw)
In-Reply-To: <20170413164457.GX32646@thinpad.lan.raisama.net>

On 13 April 2017 at 17:44, Eduardo Habkost <ehabkost@redhat.com> wrote:
> On Thu, Apr 13, 2017 at 06:15:34PM +0300, Roman Kagan wrote:
>> Can you (or anybody else) please help me decide if I need
>> TYPE_SYS_BUS_DEVICE?  Logically the VMBus bridge is "attached directly
>> to the main system bus" as written at the top of include/hw/sysbus.h.
>
> I think that documentation was written before we supported
> bus-less devices.

The major question to ask to determine whether you need to be
a sysbus device is how does the guest interact with this thing?
In particular, does it have memory mapped registers (and is it
not part of some other more specific interface like a PCI device) ?

> I'm not sure about the consequences of simply connecting IRQs
> inside ->realize() without using the sysbus *_irq helpers. I hope
> others can clarify this.

Connecting what IRQs to what? If your device has an IRQ
then it isn't the device's job to connect it up -- it is
the job of the machine model, because only the machine
model knows what the IRQ controller is, whether the IRQ
needs to be advertised via ACPI or device tree, and so on.
You can do that without sysbus though, by using the core
DeviceState's qdev_init_gpio_* APIs. (NB that if you do
this then you're by necessity not a device creatable
with -device, since the board code has to wire you up.)

If you're not using sysbus then watch out for reset:
all sysbus devices get automatically reset on QEMU
system reset; if you're directly using the DeviceState
baseclass then you have to arrange reset for yourself
somehow.

thanks
-- PMM

  reply	other threads:[~2017-04-13 16:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 20:58 [Qemu-devel] vmbus bridge: machine property or device? Roman Kagan
2017-04-12 15:18 ` Markus Armbruster
2017-04-12 20:07   ` Eduardo Habkost
2017-04-13 15:15     ` Roman Kagan
2017-04-13 16:44       ` Eduardo Habkost
2017-04-13 16:58         ` Peter Maydell [this message]
2017-04-13 18:15           ` Eduardo Habkost
2017-04-13 21:57             ` Peter Maydell
2017-04-13 21:10           ` Roman Kagan
2017-04-13 17:04         ` Roman Kagan
2017-04-13 14:08   ` Roman Kagan

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=CAFEAcA_VQGDXmMmcTdzwb-UA4sVF1jeXfnXyUBNnZU2E4jdUPw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=ehabkost@redhat.com \
    --cc=eyakovlev@virtuozzo.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkagan@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.