]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: KVM: Allow creating the VGIC after VCPUs
authorChristoffer Dall <christoffer.dall@linaro.org>
Mon, 23 Sep 2013 21:55:55 +0000 (14:55 -0700)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Apr 2015 09:15:00 +0000 (11:15 +0200)
commit69a023a70ac77b581f11f12ea61d065fc3bf79fc
treee652ca90e4eb8350863aeb262bc30ceea7361062
parentf3ad05f6c31a18c83d46d234a32769f151c46593
ARM: KVM: Allow creating the VGIC after VCPUs

commit e1ba0207a1b3714bb3f000e506285ae5123cdfa7 upstream.

Rework the VGIC initialization slightly to allow initialization of the
vgic cpu-specific state even if the irqchip (the VGIC) hasn't been
created by user space yet.  This is safe, because the vgic data
structures are already allocated when the CPU is allocated if VGIC
support is compiled into the kernel.  Further, the init process does not
depend on any other information and the sacrifice is a slight
performance degradation for creating VMs in the no-VGIC case.

The reason is that the new device control API doesn't mandate creating
the VGIC before creating the VCPU and it is unreasonable to require user
space to create the VGIC before creating the VCPUs.

At the same time move the irqchip_in_kernel check out of
kvm_vcpu_first_run_init and into the init function to make the per-vcpu
and global init functions symmetric and add comments on the exported
functions making it a bit easier to understand the init flow by only
looking at vgic.c.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm/kvm/arm.c
virt/kvm/arm/vgic.c