From: Alexander Graf <agraf@suse.de>
To: Eric Auger <eric.auger@linaro.org>,
eric.auger@st.com, christoffer.dall@linaro.org,
qemu-devel@nongnu.org, pbonzini@redhat.com,
kim.phillips@freescale.com, a.rigo@virtualopensystems.com,
manish.jaggi@caviumnetworks.com, joel.schopp@amd.com
Cc: peter.maydell@linaro.org, patches@linaro.org,
will.deacon@arm.com, stuart.yoder@freescale.com,
Bharat.Bhushan@freescale.com, alex.williamson@redhat.com,
a.motakis@virtualopensystems.com, kvmarm@lists.cs.columbia.edu
Subject: Re: [Qemu-devel] [PATCH v7 10/16] hw/vfio: calxeda xgmac device
Date: Wed, 05 Nov 2014 11:26:06 +0100 [thread overview]
Message-ID: <5459FB3E.1070107@suse.de> (raw)
In-Reply-To: <1414764350-5140-11-git-send-email-eric.auger@linaro.org>
On 31.10.14 15:05, Eric Auger wrote:
> The platform device class has become abstract. The device can be be
> instantiated on command line using such option.
>
> -device vfio-calxeda-xgmac,host="fff51000.ethernet"
>
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>
> ---
>
> v5 -> v6
> - back again following Alex Graf advises
> - fix a bug related to compat override
>
> v4 -> v5:
> removed since device tree was moved to hw/arm/dyn_sysbus_devtree.c
>
> v4: creation for device tree specialization
> ---
> hw/vfio/Makefile.objs | 1 +
> hw/vfio/calxeda_xgmac.c | 54 ++++++++++++++++++++++++++++++++++++
> include/hw/vfio/vfio-calxeda-xgmac.h | 41 +++++++++++++++++++++++++++
> 3 files changed, 96 insertions(+)
> create mode 100644 hw/vfio/calxeda_xgmac.c
> create mode 100644 include/hw/vfio/vfio-calxeda-xgmac.h
>
> diff --git a/hw/vfio/Makefile.objs b/hw/vfio/Makefile.objs
> index c5c76fe..913ab14 100644
> --- a/hw/vfio/Makefile.objs
> +++ b/hw/vfio/Makefile.objs
> @@ -2,4 +2,5 @@ ifeq ($(CONFIG_LINUX), y)
> obj-$(CONFIG_SOFTMMU) += common.o
> obj-$(CONFIG_PCI) += pci.o
> obj-$(CONFIG_SOFTMMU) += platform.o
> +obj-$(CONFIG_SOFTMMU) += calxeda_xgmac.o
> endif
> diff --git a/hw/vfio/calxeda_xgmac.c b/hw/vfio/calxeda_xgmac.c
> new file mode 100644
> index 0000000..199e076
> --- /dev/null
> +++ b/hw/vfio/calxeda_xgmac.c
> @@ -0,0 +1,54 @@
> +/*
> + * calxeda xgmac example VFIO device
> + *
> + * Copyright Linaro Limited, 2014
> + *
> + * Authors:
> + * Eric Auger <eric.auger@linaro.org>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2. See
> + * the COPYING file in the top-level directory.
> + *
> + */
> +
> +#include "hw/vfio/vfio-calxeda-xgmac.h"
> +
> +static void calxeda_xgmac_realize(DeviceState *dev, Error **errp)
> +{
> + VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev);
> + VFIOCalxedaXgmacDeviceClass *k = VFIO_CALXEDA_XGMAC_DEVICE_GET_CLASS(dev);
> +
> + vdev->compat = g_strdup("calxeda,hb-xgmac");
> +
> + k->parent_realize(dev, errp);
Since MMIO and IRQ line exposure happens in the parent, I would like to
see a comment here explaining the semantics of each region here. That
way users at least have the chance to figure out what each MMIO number
and IRQ number mean.
Also, since this device will probably get used as example code for
others, I'd like to make sure we set a proper precedence, even if it's
"trivial" in this case.
Alex
next prev parent reply other threads:[~2014-11-05 10:26 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 14:05 [Qemu-devel] [PATCH v7 00/16] KVM platform device passthrough Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 01/16] vfio: move hw/misc/vfio.c to hw/vfio/pci.c Move vfio.h into include/hw/vfio Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 02/16] hw/vfio/pci: Rename VFIODevice into VFIOPCIDevice Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 03/16] hw/vfio/pci: introduce VFIODevice Eric Auger
2014-11-05 17:35 ` Alex Williamson
2014-11-06 8:38 ` Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 04/16] hw/vfio/pci: Introduce VFIORegion Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 05/16] hw/vfio/pci: split vfio_get_device Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 06/16] hw/vfio/pci: rename group_list into vfio_group_list Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 07/16] hw/vfio/pci: use name field in format strings Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 08/16] hw/vfio: create common module Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 09/16] hw/vfio/platform: add vfio-platform support Eric Auger
2014-11-05 10:29 ` Alexander Graf
2014-11-05 12:03 ` Eric Auger
2014-11-05 13:05 ` Alexander Graf
2014-11-26 9:45 ` Eric Auger
2014-11-26 10:24 ` Alexander Graf
2014-11-26 10:48 ` Eric Auger
2014-11-26 11:20 ` Alexander Graf
2014-11-26 14:46 ` Eric Auger
2014-11-27 14:05 ` Eric Auger
2014-11-27 14:35 ` Alexander Graf
2014-11-27 15:14 ` Eric Auger
2014-11-27 15:28 ` Alexander Graf
2014-11-27 15:55 ` Alexander Graf
2014-11-27 17:13 ` Eric Auger
2014-11-27 17:24 ` Alexander Graf
2014-11-27 17:34 ` Eric Auger
2014-11-27 17:51 ` Alexander Graf
2014-11-27 17:54 ` Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 10/16] hw/vfio: calxeda xgmac device Eric Auger
2014-11-05 10:26 ` Alexander Graf [this message]
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 11/16] hw/arm/virt: add support for VFIO devices Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 12/16] hw/arm/sysbus-fdt: enable vfio-calxeda-xgmac dynamic instantiation Eric Auger
2014-11-05 10:59 ` Alexander Graf
2014-11-05 12:31 ` Eric Auger
2014-11-05 22:23 ` Alexander Graf
2014-11-06 8:57 ` Eric Auger
2014-11-06 12:34 ` Alexander Graf
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 13/16] hw/vfio/platform: Add irqfd support Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 14/16] linux-headers: Update KVM headers from linux-next tag ToBeFilled Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 15/16] hw/vfio/common: vfio_kvm_device_fd moved in the common header Eric Auger
2014-10-31 14:05 ` [Qemu-devel] [PATCH v7 16/16] hw/vfio/platform: add forwarded irq support Eric Auger
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=5459FB3E.1070107@suse.de \
--to=agraf@suse.de \
--cc=Bharat.Bhushan@freescale.com \
--cc=a.motakis@virtualopensystems.com \
--cc=a.rigo@virtualopensystems.com \
--cc=alex.williamson@redhat.com \
--cc=christoffer.dall@linaro.org \
--cc=eric.auger@linaro.org \
--cc=eric.auger@st.com \
--cc=joel.schopp@amd.com \
--cc=kim.phillips@freescale.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=manish.jaggi@caviumnetworks.com \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stuart.yoder@freescale.com \
--cc=will.deacon@arm.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 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).