From: Sasha Levin <levinsasha928@gmail.com>
To: Will Deacon <will.deacon@arm.com>
Cc: kvm@vger.kernel.org, penberg@kernel.org, marc.zyngier@arm.com,
c.dall@virtualopensystems.com, matt.evans@arm.com,
peter.maydell@linaro.org
Subject: Re: [RFC PATCH 08/16] kvm tools: add generic device registration mechanism
Date: Mon, 12 Nov 2012 23:29:33 -0500 [thread overview]
Message-ID: <50A1CCAD.2080001@gmail.com> (raw)
In-Reply-To: <1352721450-11340-9-git-send-email-will.deacon@arm.com>
On 11/12/2012 06:57 AM, Will Deacon wrote:
> PCI devices are currently registered into the pci_devices array via the
> pci__register function, which can then be indexed later by architecture
> code to construct device tree nodes. For MMIO devices, there is no such
> utility.
>
> Rather than invent a similar mechanism for MMIO, this patch creates a
> global device registration mechanism, which allows the device type to be
> specified when registered or indexing a device. Current users of the pci
> registration code are migrated to the new infrastructure and virtio MMIO
> devices are registered at init time.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
> tools/kvm/Makefile | 1 +
> tools/kvm/devices.c | 24 +++++++++++++++++++++
> tools/kvm/hw/pci-shmem.c | 8 ++++++-
> tools/kvm/hw/vesa.c | 8 ++++++-
> tools/kvm/include/kvm/devices.h | 21 ++++++++++++++++++
> tools/kvm/include/kvm/pci.h | 2 -
> tools/kvm/include/kvm/virtio-mmio.h | 1 +
> tools/kvm/include/kvm/virtio-pci.h | 2 +
> tools/kvm/pci.c | 40 ++++++++++++----------------------
> tools/kvm/powerpc/irq.c | 3 +-
> tools/kvm/powerpc/spapr_pci.c | 2 +-
> tools/kvm/virtio/mmio.c | 7 ++++++
> tools/kvm/virtio/pci.c | 7 +++++-
> 13 files changed, 93 insertions(+), 33 deletions(-)
> create mode 100644 tools/kvm/devices.c
> create mode 100644 tools/kvm/include/kvm/devices.h
>
> diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
> index c105de1..5da416f 100644
> --- a/tools/kvm/Makefile
> +++ b/tools/kvm/Makefile
> @@ -50,6 +50,7 @@ OBJS += builtin-run.o
> OBJS += builtin-setup.o
> OBJS += builtin-stop.o
> OBJS += builtin-version.o
> +OBJS += devices.o
> OBJS += disk/core.o
> OBJS += framebuffer.o
> OBJS += guest_compat.o
> diff --git a/tools/kvm/devices.c b/tools/kvm/devices.c
> new file mode 100644
> index 0000000..f9666b9
> --- /dev/null
> +++ b/tools/kvm/devices.c
> @@ -0,0 +1,24 @@
> +#include "kvm/devices.h"
> +#include "kvm/kvm.h"
> +
> +#include <linux/err.h>
> +
> +static struct device_header *devices[KVM_MAX_DEVICES];
Does it really have a hard limit at KVM_MAX_DEVICES? Or can we turn it into
something more dynamic (list/tree/whatever)?
Thanks,
Sasha
next prev parent reply other threads:[~2012-11-13 4:29 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 11:57 [RFC PATCH 00/16] kvm tools: add support for ARMv7 processors Will Deacon
2012-11-12 11:57 ` [RFC PATCH 01/16] kvm tools: include arch uapi/asm directories in include path Will Deacon
2012-11-12 11:57 ` [RFC PATCH 02/16] kvm tools: only enable LTO if supported by GCC Will Deacon
2012-11-12 11:57 ` [RFC PATCH 03/16] kvm tools: avoid linking dynamically against libbfd Will Deacon
2012-11-12 11:57 ` [RFC PATCH 04/16] kvm tools: specify compiler by name when overriding make default Will Deacon
2012-11-12 11:57 ` [RFC PATCH 05/16] kvm tools: don't bother including linux/compiler.h Will Deacon
2012-11-13 7:26 ` Pekka Enberg
2012-11-16 10:06 ` Will Deacon
2012-11-16 22:01 ` Pekka Enberg
2012-11-19 10:33 ` Will Deacon
2012-11-19 11:42 ` Pekka Enberg
2012-11-12 11:57 ` [RFC PATCH 06/16] kvm tools: don't pass -Wcast-align to the compiler Will Deacon
2012-11-12 11:57 ` [RFC PATCH 07/16] kvm tools: die if init_list__init returns failure Will Deacon
2012-11-12 11:57 ` [RFC PATCH 08/16] kvm tools: add generic device registration mechanism Will Deacon
2012-11-13 4:29 ` Sasha Levin [this message]
2012-11-13 10:24 ` Will Deacon
2012-11-12 11:57 ` [RFC PATCH 09/16] kvm tools: make _FDT macro usable by other architectures Will Deacon
2012-11-12 11:57 ` [RFC PATCH 10/16] kvm tools: virtio-mmio: use subsys_id instead of pci device ID Will Deacon
2012-11-12 11:57 ` [RFC PATCH 11/16] kvm tools: virtio: add dummy set_size_vq implementations Will Deacon
2012-11-12 11:57 ` [RFC PATCH 12/16] kvm tools: allow arch to specify default virtio transport Will Deacon
2012-11-12 11:57 ` [RFC PATCH 13/16] kvm tools: keep track of registered memory banks in struct kvm Will Deacon
2012-11-13 4:37 ` Sasha Levin
2012-11-13 12:16 ` Will Deacon
2012-11-13 16:09 ` Sasha Levin
2012-11-13 16:21 ` Will Deacon
2012-11-20 17:15 ` Will Deacon
2012-11-20 21:01 ` Sasha Levin
2012-11-12 11:57 ` [RFC PATCH 14/16] kvm tools: teach guest_flat_to_host about memory banks starting above 0 Will Deacon
2012-11-13 4:47 ` Sasha Levin
2012-11-12 11:57 ` [RFC PATCH 15/16] kvm tools: provide a mechanism for translating host to guest addresses Will Deacon
2012-11-12 11:57 ` [RFC PATCH 16/16] kvm tools: add support for ARMv7 processors Will Deacon
2012-11-13 7:39 ` Pekka Enberg
2012-11-13 10:21 ` Matt Evans
2012-11-13 10:28 ` Pekka Enberg
2012-11-13 18:34 ` Will Deacon
2012-11-12 12:18 ` [RFC PATCH 00/16] " Christoffer Dall
2012-11-12 12:27 ` Will Deacon
2012-11-12 12:52 ` Christoffer Dall
2012-11-12 22:40 ` Christoffer Dall
2012-11-13 10:27 ` Will Deacon
2012-11-13 7:37 ` Pekka Enberg
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=50A1CCAD.2080001@gmail.com \
--to=levinsasha928@gmail.com \
--cc=c.dall@virtualopensystems.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=matt.evans@arm.com \
--cc=penberg@kernel.org \
--cc=peter.maydell@linaro.org \
--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).