path: root/include
diff options
authorshameer <shamiali2008@gmail.com>2017-05-20 19:45:10 +0100
committerGraeme Gregory <graeme.gregory@linaro.org>2017-06-06 10:00:44 +0100
commit37edf0f0978a06e825a1ef449183adf79d12deca (patch)
tree60fd3384814c8b615d90f44906834ebbd5e3b188 /include
parent0d2d2a67c95fd4304dd00b935a6695131e9ab12b (diff)
KVM:arm/arm64: HiSilicon GIC quirk for kvm CPU stall issue
KVM uses virt-phys interrupt map feature while forwarding the timer interrupt to Guest (ICH_LR HW bit=1). At present GIC on HiSilicon platforms(D02/D03) has issues with this feature and causes CPU stall. This patch uses non mapped timer irq inject into the Guest. When Guest deactivates the timer irq, a maintenance EOI irq is generated and KVM handles the deactivation on phys distributor. Signed-off-by: shameer <shamiali2008@gmail.com> Remove dts and change matching to HIP05/HIP06 Disable pr_warn("Unexpected interrupt %d on vcpu %p\n", irq, vcpu); There is a bug in D03 board that doesn't always clear interrupt, but this doesn't impact the functionality, so disable the warning. Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Diffstat (limited to 'include')
2 files changed, 7 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index ef718586321c..7d9af5cc00a1 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -77,6 +77,11 @@ struct vgic_global {
extern struct vgic_global kvm_vgic_global_state;
+/*HiSilicon quirk: vtimer irqmap not supported*/
+extern struct static_key_false hisi_vtimer_quirk_enabled;
+#define needs_hisi_vtimer_quirk() \
+ static_branch_unlikely(&hisi_vtimer_quirk_enabled)
#define VGIC_V2_MAX_LRS (1 << 6)
#define VGIC_V3_MAX_LRS 16
#define VGIC_V3_LR_INDEX(lr) (VGIC_V3_MAX_LRS - 1 - lr)
diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h
index c647b0547bcd..964f672854d9 100644
--- a/include/linux/irqchip/arm-gic-common.h
+++ b/include/linux/irqchip/arm-gic-common.h
@@ -27,6 +27,8 @@ struct gic_kvm_info {
unsigned int maint_irq;
/* Virtual control interface */
struct resource vctrl;
+ /* HiSilicon GIC quirk: virtual timer irq map not supported */
+ bool hisi_vtimer_quirk;
const struct gic_kvm_info *gic_get_kvm_info(void);