All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: Pavel Fedin <p.fedin@samsung.com>, qemu-devel@nongnu.org
Cc: Shlomo Pongratz <shlomopongratz@gmail.com>,
	Ashok Kumar <ashoks@broadcom.com>
Subject: Re: [Qemu-devel] [PATCH RFC 3/4] First bits of vGICv3 support:
Date: Mon, 25 May 2015 16:07:26 +0200	[thread overview]
Message-ID: <55632C9E.2010903@linaro.org> (raw)
In-Reply-To: <748b8cfaf57df1e78bd5ea325943d6cb55a6668c.1432291291.git.p.fedin@samsung.com>

On 05/22/2015 12:58 PM, Pavel Fedin wrote:
> - Make use of kernel_irqchip_type in kvm_arch_irqchip_create()
> - Instantiate "kvm-arm-gicv3" class (not implemented yet) for GICv3 with KVM acceleration
I think this patch file should rather be the last one of the series.
> 
> Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
> ---
>  hw/arm/virt.c        | 6 ++----
>  include/sysemu/kvm.h | 3 ++-
>  kvm-all.c            | 2 +-
>  stubs/kvm.c          | 2 +-
>  target-arm/kvm.c     | 8 ++++++--
>  5 files changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 15724b2..1e42e59 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -400,11 +400,9 @@ static uint32_t create_gic(const VirtBoardInfo *vbi, qemu_irq *pic, int type)
>      int i;
>  
>      if (type == KVM_DEV_TYPE_ARM_VGIC_V3) {
> -        gictype = "arm_gicv3";
> -    } else if (kvm_irqchip_in_kernel()) {
> -        gictype = "kvm-arm-gic";
> +        gictype = kvm_irqchip_in_kernel() ? "kvm-arm-gicv3" : "arm_gicv3";
>      } else {
> -        gictype = "arm_gic";
> +        gictype = kvm_irqchip_in_kernel() ? "kvm-arm-gic" : "arm_gic";
>      }
>  
>      gicdev = qdev_create(NULL, gictype);
> diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
> index 4878959..5d90257 100644
> --- a/include/sysemu/kvm.h
> +++ b/include/sysemu/kvm.h
> @@ -424,6 +424,7 @@ void kvm_init_irq_routing(KVMState *s);
>  /**
>   * kvm_arch_irqchip_create:
>   * @KVMState: The KVMState pointer
> + * @type: irqchip type, architecture-specific
>   *
>   * Allow architectures to create an in-kernel irq chip themselves.
>   *
> @@ -431,7 +432,7 @@ void kvm_init_irq_routing(KVMState *s);
>   *            0: irq chip was not created
>   *          > 0: irq chip was created
>   */
> -int kvm_arch_irqchip_create(KVMState *s);
> +int kvm_arch_irqchip_create(KVMState *s, int type);
>  
>  /**
>   * kvm_set_one_reg - set a register value in KVM via KVM_SET_ONE_REG ioctl
> diff --git a/kvm-all.c b/kvm-all.c
> index 17a3771..22e2621 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1393,7 +1393,7 @@ static int kvm_irqchip_create(MachineState *machine, KVMState *s)
>  
>      /* First probe and see if there's a arch-specific hook to create the
>       * in-kernel irqchip for us */
> -    ret = kvm_arch_irqchip_create(s);
> +    ret = kvm_arch_irqchip_create(s, machine->kernel_irqchip_type);
>      if (ret < 0) {
>          return ret;
>      } else if (ret == 0) {
> diff --git a/stubs/kvm.c b/stubs/kvm.c
> index e7c60b6..a8505ff 100644
> --- a/stubs/kvm.c
> +++ b/stubs/kvm.c
> @@ -1,7 +1,7 @@
>  #include "qemu-common.h"
>  #include "sysemu/kvm.h"
>  
> -int kvm_arch_irqchip_create(KVMState *s)
> +int kvm_arch_irqchip_create(KVMState *s, int type)
>  {
>      return 0;
>  }
> diff --git a/target-arm/kvm.c b/target-arm/kvm.c
> index 16abbf1..65794cf 100644
> --- a/target-arm/kvm.c
> +++ b/target-arm/kvm.c
> @@ -579,7 +579,7 @@ void kvm_arch_init_irq_routing(KVMState *s)
>  {
>  }
>  
> -int kvm_arch_irqchip_create(KVMState *s)
> +int kvm_arch_irqchip_create(KVMState *s, int type)
>  {
>      int ret;
>  
> @@ -587,11 +587,15 @@ int kvm_arch_irqchip_create(KVMState *s)
>       * let the device do this when it initializes itself, otherwise we
>       * fall back to the old API */
>  
> -    ret = kvm_create_device(s, KVM_DEV_TYPE_ARM_VGIC_V2, true);
> +    ret = kvm_create_device(s, type, true);
>      if (ret == 0) {
>          return 1;
>      }
>  
> +    /* Fallback will create VGIC v2 */
the comment should be above return 0;
> +    if (type != KVM_DEV_TYPE_ARM_VGIC_V2) {
> +        return ret;
> +    }
>      return 0;
>  }
>  
> 

  reply	other threads:[~2015-05-25 14:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 10:58 [Qemu-devel] [PATCH RFC 0/4] vGICv3 support Pavel Fedin
2015-05-22 10:58 ` [Qemu-devel] [PATCH RFC 1/4] Add virt-v3 machine that uses GIC-500 Pavel Fedin
2015-05-25 14:07   ` Eric Auger
2015-05-25 14:51     ` Pavel Fedin
2015-07-01 10:11   ` Christoffer Dall
2015-05-22 10:58 ` [Qemu-devel] [PATCH RFC 2/4] Set kernel_irqchip_type for other ARM boards which use GIC Pavel Fedin
2015-05-25 14:07   ` Eric Auger
2015-05-25 14:43     ` Pavel Fedin
2015-07-01 10:11   ` Christoffer Dall
2015-05-22 10:58 ` [Qemu-devel] [PATCH RFC 3/4] First bits of vGICv3 support: Pavel Fedin
2015-05-25 14:07   ` Eric Auger [this message]
2015-07-01 10:13   ` Christoffer Dall
2015-05-22 10:58 ` [Qemu-devel] [PATCH RFC 4/4] Initial implementation of vGICv3 Pavel Fedin
2015-05-22 15:17   ` Eric Auger
2015-05-22 16:57     ` Pavel Fedin
2015-07-01 10:19       ` Christoffer Dall
2015-07-01 10:21 ` [Qemu-devel] [PATCH RFC 0/4] vGICv3 support Christoffer Dall
2015-07-01 10:26   ` Daniel P. Berrange
2015-07-01 11:14   ` Pavel Fedin
2015-07-01 11:28     ` Christoffer Dall
2015-07-01 12:31       ` Pavel Fedin

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=55632C9E.2010903@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=ashoks@broadcom.com \
    --cc=p.fedin@samsung.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shlomopongratz@gmail.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.