qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Shannon Zhao <shannon.zhaosl@gmail.com>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] ARM: GIC: error out early when creating VGICv2 failed
Date: Thu, 17 Jan 2019 19:36:54 +0000	[thread overview]
Message-ID: <CAFEAcA8w-JSvCcU70W63Yr_L0ZS44H26LPrPn4TgL=rW+2FULQ@mail.gmail.com> (raw)
In-Reply-To: <20190117030917.18844-1-shannon.zhaosl@gmail.com>

On Thu, 17 Jan 2019 at 03:09, Shannon Zhao <shannon.zhaosl@gmail.com> wrote:
>
> Currently if creating a gicv2 VM on the platform without
> VGICv2 support, it failed in kvm_arm_pmu_set_irq while
> trying to set the interrupt number for PMU with below
> error message.
> KVM_SET_DEVICE_ATTR failed: Invalid argument
>
> This error log is a little confused. Also it should error
> out in kvm_arm_gic_realize early.
>
> Signed-off-by: Shannon Zhao <shannon.zhaosl@gmail.com>
> ---
>  hw/intc/arm_gic_kvm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
> index a611e8e..b4f2133 100644
> --- a/hw/intc/arm_gic_kvm.c
> +++ b/hw/intc/arm_gic_kvm.c
> @@ -554,8 +554,9 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
>                                KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true,
>                                &error_abort);
>          }
> -    } else if (ret != -ENODEV && ret != -ENOTSUP) {
> -        error_setg_errno(errp, -ret, "error creating in-kernel VGIC");
> +    } else if (ret != -ENOTSUP) {
> +        error_setg_errno(errp, -ret, "error creating in-kernel VGIC, maybe "
> +                                     "vGICv2 not support on this platform");
>          return;
>      }

Shouldn't we be able to tell specifically whether the
vGICv2 is not supported on this platform, without
having to emit an error message that says "we got
some error, maybe it was that there's no vGICv2
support but maybe it was something else" ?

It's not clear to me what the various
possible kvm_create_device returns are. We have
I guess several cases:
 * new device control API supported, vGICv2 supported:
   return >= 0
 * new device control API not supported at all (ie
   old host kernel version): return some error, which one?
 * new device control API supported, but vGICv2 not
   supported: return some error, which one?
 * new device control API supported, vGICv2 supported,
   but something unlikely went wrong in the kernel:
   return any other error

What are the errnos for the middle two cases, and can
we end up with userspace code that can distinguish
these four cases rather than merging some of them
together?

thanks
-- PMM

      parent reply	other threads:[~2019-01-17 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17  3:09 [Qemu-devel] [PATCH] ARM: GIC: error out early when creating VGICv2 failed Shannon Zhao
2019-01-17  9:25 ` Andrew Jones
2019-01-17 19:36 ` Peter Maydell [this message]

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='CAFEAcA8w-JSvCcU70W63Yr_L0ZS44H26LPrPn4TgL=rW+2FULQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@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 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).