Skip to content

Commit a754605

Browse files
Marc Zyngierchazy
authored andcommitted
KVM: arm/arm64: GICv4: Enable VLPI support
All it takes is the has_v4 flag to be set in gic_kvm_info as well as "kvm-arm.vgic_v4_enable=1" being passed on the command line for GICv4 to be enabled in KVM. Acked-by: Christoffer Dall <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Christoffer Dall <[email protected]>
1 parent d3d83f7 commit a754605

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,10 @@
18811881
[KVM,ARM] Trap guest accesses to GICv3 common
18821882
system registers
18831883

1884+
kvm-arm.vgic_v4_enable=
1885+
[KVM,ARM] Allow use of GICv4 for direct injection of
1886+
LPIs.
1887+
18841888
kvm-intel.ept= [KVM,Intel] Disable extended page tables
18851889
(virtualized MMU) support on capable Intel chips.
18861890
Default is 1 (enabled)

virt/kvm/arm/vgic/vgic-v3.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
static bool group0_trap;
2525
static bool group1_trap;
2626
static bool common_trap;
27+
static bool gicv4_enable;
2728

2829
void vgic_v3_set_underflow(struct kvm_vcpu *vcpu)
2930
{
@@ -461,6 +462,12 @@ static int __init early_common_trap_cfg(char *buf)
461462
}
462463
early_param("kvm-arm.vgic_v3_common_trap", early_common_trap_cfg);
463464

465+
static int __init early_gicv4_enable(char *buf)
466+
{
467+
return strtobool(buf, &gicv4_enable);
468+
}
469+
early_param("kvm-arm.vgic_v4_enable", early_gicv4_enable);
470+
464471
/**
465472
* vgic_v3_probe - probe for a GICv3 compatible interrupt controller in DT
466473
* @node: pointer to the DT node
@@ -480,6 +487,13 @@ int vgic_v3_probe(const struct gic_kvm_info *info)
480487
kvm_vgic_global_state.can_emulate_gicv2 = false;
481488
kvm_vgic_global_state.ich_vtr_el2 = ich_vtr_el2;
482489

490+
/* GICv4 support? */
491+
if (info->has_v4) {
492+
kvm_vgic_global_state.has_gicv4 = gicv4_enable;
493+
kvm_info("GICv4 support %sabled\n",
494+
gicv4_enable ? "en" : "dis");
495+
}
496+
483497
if (!info->vcpu.start) {
484498
kvm_info("GICv3: no GICV resource entry\n");
485499
kvm_vgic_global_state.vcpu_base = 0;

0 commit comments

Comments
 (0)