From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 15/20] arm/arm64: KVM: add virtual GICv3 distributor emulation
Date: Mon, 12 Jan 2015 18:08:16 +0100 [thread overview]
Message-ID: <20150112170816.GK3868@cbox> (raw)
In-Reply-To: <54B39A8B.1010505@arm.com>
On Mon, Jan 12, 2015 at 09:57:31AM +0000, Andre Przywara wrote:
[...]
> >> +static int vgic_v3_map_resources(struct kvm *kvm,
> >> + const struct vgic_params *params)
> >> +{
> >> + int ret = 0;
> >> + struct vgic_dist *dist = &kvm->arch.vgic;
> >> +
> >> + if (!irqchip_in_kernel(kvm))
> >> + return 0;
> >> +
> >> + mutex_lock(&kvm->lock);
> >> +
> >> + if (vgic_ready(kvm))
> >> + goto out;
> >> +
> >> + if (IS_VGIC_ADDR_UNDEF(dist->vgic_dist_base) ||
> >> + IS_VGIC_ADDR_UNDEF(dist->vgic_redist_base)) {
> >> + kvm_err("Need to set vgic distributor addresses first\n");
> >> + return -ENXIO;
> >
> > you're not returning to userspace iwth a mutex held...
>
> Good catch. Will fix that.
>
> >> + }
> >> +
> >> + /*
> >> + * Initialize the vgic if this hasn't already been done on demand by
> >> + * accessing the vgic state from userspace.
> >> + */
> >> + ret = vgic_init(kvm);
> >> + if (ret) {
> >> + kvm_err("Unable to allocate maps\n");
> >> + goto out;
> >> + }
> >
> > I don't think we should allow automatic vgic_init from userspace
> > anymore, but require userspace to manually initialize the vgic when
> > using a GICv3.
> >
> > In fact, I think we need to change all the places that do the on-demand
> > vgic init to error out somehow, if you're using anything else than a
> > gicv2.
>
> Ah yes, I think we didn't discuss this before. I know that the intention
> was to make the explicit vgic init mandatory for GICv3, but to me it
> looks like we need extra code to support this, so I refrained from
> adding that right now.
> Why do we require the vgic init call in the first place? Is that just to
> make this whole VGIC init sequence more clearer and get rid of the
> cumbersome automatic init's all over the place? So basically to fix a
> design decision that we cannot undo anymore for vGICv2?
>
Yes, the auto-init keeps breaking on us and it's generally quite messy.
If you introduce that functionality for GICv3 as well, it becomes ABI
that we need to maintain forever, so I'd like that we address it now.
One option is to rename all the auto vgic_init calls to vgic_init_auto
and check if a GICv2 was created in there and error out in that case,
that should make the changes in connection with this series a simple
mechanical patch.
-Christoffer
next prev parent reply other threads:[~2015-01-12 17:08 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 11:54 [PATCH v6 00/20] KVM GICv3 emulation Andre Przywara
2015-01-09 11:54 ` [PATCH v6 01/20] arm/arm64: KVM: rework MPIDR assignment and add accessors Andre Przywara
2015-01-09 11:54 ` [PATCH v6 02/20] arm/arm64: KVM: pass down user space provided GIC type into vGIC code Andre Przywara
2015-01-09 11:54 ` [PATCH v6 03/20] arm/arm64: KVM: refactor vgic_handle_mmio() function Andre Przywara
2015-01-09 11:54 ` [PATCH v6 04/20] arm/arm64: KVM: wrap 64 bit MMIO accesses with two 32 bit ones Andre Przywara
2015-01-09 11:54 ` [PATCH v6 05/20] arm/arm64: KVM: introduce per-VM ops Andre Przywara
2015-01-11 14:58 ` Christoffer Dall
2015-01-09 11:54 ` [PATCH v6 06/20] arm/arm64: KVM: move kvm_register_device_ops() into vGIC probing Andre Przywara
2015-01-09 11:54 ` [PATCH v6 07/20] arm/arm64: KVM: dont rely on a valid GICH base address Andre Przywara
2015-01-09 11:54 ` [PATCH v6 08/20] arm/arm64: KVM: make the maximum number of vCPUs a per-VM value Andre Przywara
2015-01-11 14:58 ` Christoffer Dall
2015-01-12 9:34 ` Andre Przywara
2015-01-09 11:54 ` [PATCH v6 09/20] arm/arm64: KVM: make the value of ICC_SRE_EL1 a per-VM variable Andre Przywara
2015-01-09 11:54 ` [PATCH v6 10/20] arm/arm64: KVM: refactor MMIO accessors Andre Przywara
2015-01-09 11:54 ` [PATCH v6 11/20] arm/arm64: KVM: refactor/wrap vgic_set/get_attr() Andre Przywara
2015-01-09 11:54 ` [PATCH v6 12/20] arm/arm64: KVM: add vgic.h header file Andre Przywara
2015-01-09 11:54 ` [PATCH v6 13/20] arm/arm64: KVM: split GICv2 specific emulation code from vgic.c Andre Przywara
2015-01-09 11:54 ` [PATCH v6 14/20] arm/arm64: KVM: add opaque private pointer to MMIO data Andre Przywara
2015-01-09 11:54 ` [PATCH v6 15/20] arm/arm64: KVM: add virtual GICv3 distributor emulation Andre Przywara
2015-01-11 15:15 ` Christoffer Dall
2015-01-12 9:57 ` Andre Przywara
2015-01-12 17:08 ` Christoffer Dall [this message]
2015-01-09 11:54 ` [PATCH v6 16/20] arm64: GICv3: introduce symbolic names for GICv3 ICC_SGI1R_EL1 fields Andre Przywara
2015-01-09 11:54 ` [PATCH v6 17/20] arm64: KVM: add SGI generation register emulation Andre Przywara
2015-01-09 11:54 ` [PATCH v6 18/20] KVM: introduce kvm_check_device_type() Andre Przywara
2015-01-09 12:33 ` Christoffer Dall
2015-01-09 13:42 ` Andre Przywara
2015-01-11 15:22 ` Christoffer Dall
2015-01-12 12:33 ` Andre Przywara
2015-01-12 17:11 ` Christoffer Dall
2015-01-14 12:33 ` Andre Przywara
2015-01-09 11:54 ` [PATCH v6 19/20] arm/arm64: KVM: enable kernel side of GICv3 emulation Andre Przywara
2015-01-11 15:32 ` Christoffer Dall
2015-01-09 11:54 ` [PATCH v6 20/20] arm/arm64: KVM: allow userland to request a virtual GICv3 Andre Przywara
2015-01-11 15:35 ` Christoffer Dall
2015-01-13 16:25 ` [PATCH v6 00/20] KVM GICv3 emulation Tomasz Nowicki
2015-01-14 0:04 ` Andre Przywara
2015-01-14 8:50 ` Tomasz Nowicki
2015-01-14 8:51 ` Eric Auger
2015-01-14 10:48 ` 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=20150112170816.GK3868@cbox \
--to=christoffer.dall@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).