public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: "penberg@kernel.org" <penberg@kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree
Date: Thu, 11 Dec 2014 17:15:30 +0000	[thread overview]
Message-ID: <20141211171530.GM6067@arm.com> (raw)
In-Reply-To: <1418315435-20342-3-git-send-email-andre.przywara@arm.com>

On Thu, Dec 11, 2014 at 04:30:33PM +0000, Andre Przywara wrote:
> Currently we describe every interrupt for each device in the FDT
> as being edge triggered.
> Add a parameter to the irq property generation to allow devices to
> specify their interrupts as level triggered if needed.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  tools/kvm/arm/fdt.c            |    6 +++---
>  tools/kvm/hw/serial.c          |    5 +++--
>  tools/kvm/include/kvm/ioport.h |    4 +++-
>  tools/kvm/ioport.c             |    6 ++++--
>  tools/kvm/virtio/mmio.c        |    5 +++--
>  5 files changed, 16 insertions(+), 10 deletions(-)

[...]

> @@ -71,7 +72,8 @@ static void generate_ioport_fdt_node(void *fdt,
>  static void generate_ioport_fdt_node(void *fdt,
>  				     struct device_header *dev_hdr,
>  				     void (*generate_irq_prop)(void *fdt,
> -							       u8 irq))
> +							       u8 irq,
> +							       u32 irq_type))
>  {
>  	die("Unable to generate device tree nodes without libfdt\n");
>  }
> diff --git a/tools/kvm/virtio/mmio.c b/tools/kvm/virtio/mmio.c
> index 3a2bd62..28b0651 100644
> --- a/tools/kvm/virtio/mmio.c
> +++ b/tools/kvm/virtio/mmio.c
> @@ -233,7 +233,8 @@ static void virtio_mmio_mmio_callback(struct kvm_cpu *vcpu,
>  static void generate_virtio_mmio_fdt_node(void *fdt,
>  					  struct device_header *dev_hdr,
>  					  void (*generate_irq_prop)(void *fdt,
> -								    u8 irq))
> +								    u8 irq,
> +								    u32 type))
>  {
>  	char dev_name[DEVICE_NAME_MAX_LEN];
>  	struct virtio_mmio *vmmio = container_of(dev_hdr,
> @@ -250,7 +251,7 @@ static void generate_virtio_mmio_fdt_node(void *fdt,
>  	_FDT(fdt_begin_node(fdt, dev_name));
>  	_FDT(fdt_property_string(fdt, "compatible", "virtio,mmio"));
>  	_FDT(fdt_property(fdt, "reg", reg_prop, sizeof(reg_prop)));
> -	generate_irq_prop(fdt, vmmio->irq);
> +	generate_irq_prop(fdt, vmmio->irq, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI);

This is a GIC-specific #define in arch-agnostic code. I think we should have
a new enum type for describing edge and level interrupts, then just use
that instead.

Will

  reply	other threads:[~2014-12-11 17:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 16:30 [PATCH 0/4] kvmtool: ARM: fixing initrd, serial IRQs and bzImage message Andre Przywara
2014-12-11 16:30 ` [PATCH 1/4] kvmtool: ARM: fix initrd functionality Andre Przywara
2014-12-11 16:30 ` [PATCH 2/4] kvmtool: ARM: allow level interrupts in device tree Andre Przywara
2014-12-11 17:15   ` Will Deacon [this message]
2014-12-12 15:19     ` Andre Przywara
2014-12-11 16:30 ` [PATCH 3/4] kvmtool: ARM: advertise 8250 IRQs as level-triggered Andre Przywara
2014-12-11 16:30 ` [PATCH 4/4] kvmtool: remove warning about bzImage on non-x86 architectures Andre Przywara

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=20141211171530.GM6067@arm.com \
    --to=will.deacon@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=penberg@kernel.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