diff options
author | Eric Auger <eric.auger@linaro.org> | 2014-12-15 12:43:33 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-01-11 08:12:15 -0500 |
commit | 065c0034823b513d3ca95760a2ad1765e3ef629c (patch) | |
tree | 59cfc086b96c7b1c933121738d83014e2d47a290 /virt/kvm | |
parent | 66b030e48af68fd4c22d343908bc057207a0a31e (diff) |
KVM: arm/arm64: vgic: add init entry to VGIC KVM device
Since the advent of VGIC dynamic initialization, this latter is
initialized quite late on the first vcpu run or "on-demand", when
injecting an IRQ or when the guest sets its registers.
This initialization could be initiated explicitly much earlier
by the users-space, as soon as it has provided the requested
dimensioning parameters.
This patch adds a new entry to the VGIC KVM device that allows
the user to manually request the VGIC init:
- a new KVM_DEV_ARM_VGIC_GRP_CTRL group is introduced.
- Its first attribute is KVM_DEV_ARM_VGIC_CTRL_INIT
The rationale behind introducing a group is to be able to add other
controls later on, if needed.
Signed-off-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/arm/vgic.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index b8d57e86cfdc..c84f53dfcd62 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -2302,7 +2302,14 @@ static int vgic_set_attr(struct kvm_device *dev, struct kvm_device_attr *attr) | |||
2302 | 2302 | ||
2303 | return ret; | 2303 | return ret; |
2304 | } | 2304 | } |
2305 | 2305 | case KVM_DEV_ARM_VGIC_GRP_CTRL: { | |
2306 | switch (attr->attr) { | ||
2307 | case KVM_DEV_ARM_VGIC_CTRL_INIT: | ||
2308 | r = vgic_init(dev->kvm); | ||
2309 | return r; | ||
2310 | } | ||
2311 | break; | ||
2312 | } | ||
2306 | } | 2313 | } |
2307 | 2314 | ||
2308 | return -ENXIO; | 2315 | return -ENXIO; |
@@ -2381,6 +2388,11 @@ static int vgic_has_attr(struct kvm_device *dev, struct kvm_device_attr *attr) | |||
2381 | return vgic_has_attr_regs(vgic_cpu_ranges, offset); | 2388 | return vgic_has_attr_regs(vgic_cpu_ranges, offset); |
2382 | case KVM_DEV_ARM_VGIC_GRP_NR_IRQS: | 2389 | case KVM_DEV_ARM_VGIC_GRP_NR_IRQS: |
2383 | return 0; | 2390 | return 0; |
2391 | case KVM_DEV_ARM_VGIC_GRP_CTRL: | ||
2392 | switch (attr->attr) { | ||
2393 | case KVM_DEV_ARM_VGIC_CTRL_INIT: | ||
2394 | return 0; | ||
2395 | } | ||
2384 | } | 2396 | } |
2385 | return -ENXIO; | 2397 | return -ENXIO; |
2386 | } | 2398 | } |