Skip to content

Commit 63d423a

Browse files
author
Marc Zyngier
committed
KVM: arm64: Switch to table-driven FGU configuration
Defining the FGU behaviour is extremely tedious. It relies on matching each set of bits from FGT registers with am architectural feature, and adding them to the FGU list if the corresponding feature isn't advertised to the guest. It is however relatively easy to dump most of that information from the architecture JSON description, and use that to control the FGU bits. Let's introduce a new set of tables descripbing the mapping between FGT bits and features. Most of the time, this is only a lookup in an idreg field, with a few more complex exceptions. While this is obviously many more lines in a new file, this is mostly generated, and is pretty easy to maintain. Reviewed-by: Joey Gouly <joey.gouly@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 397411c commit 63d423a

File tree

4 files changed

+596
-70
lines changed

4 files changed

+596
-70
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,4 +1610,6 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val);
16101610
#define kvm_has_s1poe(k) \
16111611
(kvm_has_feat((k), ID_AA64MMFR3_EL1, S1POE, IMP))
16121612

1613+
void compute_fgu(struct kvm *kvm, enum fgt_group_id fgt);
1614+
16131615
#endif /* __ARM64_KVM_HOST_H__ */

arch/arm64/kvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CFLAGS_sys_regs.o += -Wno-override-init
1414
CFLAGS_handle_exit.o += -Wno-override-init
1515

1616
kvm-y += arm.o mmu.o mmio.o psci.o hypercalls.o pvtime.o \
17-
inject_fault.o va_layout.o handle_exit.o \
17+
inject_fault.o va_layout.o handle_exit.o config.o \
1818
guest.o debug.o reset.o sys_regs.o stacktrace.o \
1919
vgic-sys-reg-v3.o fpsimd.o pkvm.o \
2020
arch_timer.o trng.o vmid.o emulate-nested.o nested.o at.o \

0 commit comments

Comments
 (0)