[v2] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA
Commit Message
The GIC[D,R]_BASE_GPA has been defined in multiple files with the same
value, define it in one place to make the code clean.
Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
---
v1->v2:
- Clean up the vpmu_counter_access.c.
---
tools/testing/selftests/kvm/aarch64/arch_timer.c | 3 ---
tools/testing/selftests/kvm/aarch64/vgic_irq.c | 3 ---
tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c | 3 ---
tools/testing/selftests/kvm/dirty_log_perf_test.c | 3 ---
tools/testing/selftests/kvm/include/aarch64/vgic.h | 3 +++
5 files changed, 3 insertions(+), 12 deletions(-)
Comments
On Wed, Nov 15, 2023 at 10:34:48AM -0500, Shaoqin Huang wrote:
> The GIC[D,R]_BASE_GPA has been defined in multiple files with the same
> value, define it in one place to make the code clean.
>
> Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
Colton already posted a fix for this as part of his selftests series
https://lore.kernel.org/kvmarm/20231103192915.2209393-2-coltonlewis@google.com/
On 11/15/23 23:41, Oliver Upton wrote:
> On Wed, Nov 15, 2023 at 10:34:48AM -0500, Shaoqin Huang wrote:
>> The GIC[D,R]_BASE_GPA has been defined in multiple files with the same
>> value, define it in one place to make the code clean.
>>
>> Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
>
> Colton already posted a fix for this as part of his selftests series
>
> https://lore.kernel.org/kvmarm/20231103192915.2209393-2-coltonlewis@google.com/
>
I see. Thanks for notification.
@@ -59,9 +59,6 @@ static struct test_args test_args = {
#define msecs_to_usecs(msec) ((msec) * 1000LL)
-#define GICD_BASE_GPA 0x8000000ULL
-#define GICR_BASE_GPA 0x80A0000ULL
-
enum guest_stage {
GUEST_STAGE_VTIMER_CVAL = 1,
GUEST_STAGE_VTIMER_TVAL,
@@ -19,9 +19,6 @@
#include "gic_v3.h"
#include "vgic.h"
-#define GICD_BASE_GPA 0x08000000ULL
-#define GICR_BASE_GPA 0x080A0000ULL
-
/*
* Stores the user specified args; it's passed to the guest and to every test
* function.
@@ -421,9 +421,6 @@ static void guest_code(uint64_t expected_pmcr_n)
GUEST_DONE();
}
-#define GICD_BASE_GPA 0x8000000ULL
-#define GICR_BASE_GPA 0x80A0000ULL
-
/* Create a VM that has one vCPU with PMUv3 configured. */
static void create_vpmu_vm(void *guest_code)
{
@@ -22,9 +22,6 @@
#ifdef __aarch64__
#include "aarch64/vgic.h"
-#define GICD_BASE_GPA 0x8000000ULL
-#define GICR_BASE_GPA 0x80A0000ULL
-
static int gic_fd;
static void arch_setup_vm(struct kvm_vm *vm, unsigned int nr_vcpus)
@@ -33,4 +33,7 @@ void kvm_irq_write_isactiver(int gic_fd, uint32_t intid, struct kvm_vcpu *vcpu);
#define KVM_IRQCHIP_NUM_PINS (1020 - 32)
+#define GICD_BASE_GPA 0x08000000ULL
+#define GICR_BASE_GPA 0x080A0000ULL
+
#endif // SELFTEST_KVM_VGIC_H