Implement a simple library to perform vGIC-v3 setup from a host point of view. This includes creating a vGIC device, setting up distributor and redistributor attributes, and mapping the guest physical addresses. The definition of REDIST_REGION_ATTR_ADDR is taken from aarch64/vgic_init test. Hence, replace the definition by including vgic.h in the test file. Signed-off-by: Raghavendra Rao Ananta <rananta@google.com> Reviewed-by: Ricardo Koller <ricarkol@google.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20211007233439.1826892-14-rananta@google.com
21 lines
508 B
C
21 lines
508 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* ARM Generic Interrupt Controller (GIC) host specific defines
|
|
*/
|
|
|
|
#ifndef SELFTEST_KVM_VGIC_H
|
|
#define SELFTEST_KVM_VGIC_H
|
|
|
|
#include <linux/kvm.h>
|
|
|
|
#define REDIST_REGION_ATTR_ADDR(count, base, flags, index) \
|
|
(((uint64_t)(count) << 52) | \
|
|
((uint64_t)((base) >> 16) << 16) | \
|
|
((uint64_t)(flags) << 12) | \
|
|
index)
|
|
|
|
int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus,
|
|
uint64_t gicd_base_gpa, uint64_t gicr_base_gpa);
|
|
|
|
#endif /* SELFTEST_KVM_VGIC_H */
|