Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2675992rdb; Wed, 15 Nov 2023 07:35:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJx4Qo/Hpp+epoH5IonJdSaFWSZy87xP8/IZh5xDtXKHJ9vRGTCzBCuktflj1KnCw3/Cgr X-Received: by 2002:a05:6a00:8997:b0:6c3:3cb0:d85 with SMTP id hx23-20020a056a00899700b006c33cb00d85mr7502639pfb.0.1700062529578; Wed, 15 Nov 2023 07:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700062529; cv=none; d=google.com; s=arc-20160816; b=HNPV0yADM7uGRrCZ/v7rpJJkpOw3qx1eyVRQimOxMthm/CyjoRLxfnCHBzVU1SQ7P7 IXHlEbrYIun1VCM7pLLOwz66Tnvosp0CfF130jqFrB3+RuDhCvzY3WpN0IHnK+Y7nN71 2FPhfO6DLeR2sBBUbBfuHi8jgjwlr1P8wglVezwJ7Sgk3QhnwJVWVCr2Fv3D6EdnRTcg Odd8blE2PvR8Vdl5Pap2N3DW2T+4i9NMiv5rEFuw/kbEMdg4COTnZQtmde60zb6eMJxJ AFg35ql0J7RFH6tqp0WMYmIFD3BDFqmP++AxrevhXrxy9Ede/8PobN6QrYbx1mdL5jvZ fKAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AcyB6Agx9sfZRibieWrvHauKN3lxIyqP/C2CN7o4mVs=; fh=Bv23+ttCug3rT/y/Z3tqN8zMCg7MVePwKyNaHa8qq6I=; b=pNdFstVdnLJ34yCwWu2uGrt9vlTYLR8A44QPBSMi9SMF/vIps64N8C7cSDodmaFZ8F UJIS1Lru2ePzZdBaIh76Rq77steIrnaNBZsJnP/94J+E9BubD7VDFV3gNzER40IiMzwb tSGS/E2jEpkgFybx3nQEoBxo243vVLnljFWZ6/eodqg8ZhupQpr+YHGX+FdY15P2j2uE TmLeFB8jOk8/lOWmGkOBl2NVS7g/Kq4RPSWzGXT5+gRGvqJp7SLoDyLRk5cdSb3K2JTs gz5YxeoxFRnOKzWpmPgnw7MfXtFALi4C4T2/PaifMhtCcsAE7qgJVvn0VU65kKtNdpPo WYag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iyKuU+ld; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bd33-20020a056a0027a100b006a77343b0d1si10232388pfb.272.2023.11.15.07.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 07:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iyKuU+ld; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CE0B48116E7D; Wed, 15 Nov 2023 07:35:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229768AbjKOPfG (ORCPT + 99 others); Wed, 15 Nov 2023 10:35:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjKOPfF (ORCPT ); Wed, 15 Nov 2023 10:35:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 125C2C2 for ; Wed, 15 Nov 2023 07:35:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700062501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=AcyB6Agx9sfZRibieWrvHauKN3lxIyqP/C2CN7o4mVs=; b=iyKuU+ldlpOmsxcp3CKBxCNHX8L7JPZ34qSrcG8f4dkUvxVodNEMH+eRbjoz2CLK0JAiq0 iIJjywcWblPaAt9ipnHa9KR+IE11gCMPcf86PY25lk6rpPGj/VRRtYJKgOTxmBMTDF4gno 2y1KKtu/wBGnIHqAXGRQ9s3uhrbkDG4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-TXhdF6mIOaqIWZFHTguonA-1; Wed, 15 Nov 2023 10:34:56 -0500 X-MC-Unique: TXhdF6mIOaqIWZFHTguonA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C81193C000AA; Wed, 15 Nov 2023 15:34:54 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 979B32166B27; Wed, 15 Nov 2023 15:34:54 +0000 (UTC) From: Shaoqin Huang To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Shaoqin Huang , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] KVM: arm64: selftests: Clean up the GIC[D,R]_BASE_GPA Date: Wed, 15 Nov 2023 10:34:48 -0500 Message-Id: <20231115153449.17815-1-shahuang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 07:35:13 -0800 (PST) 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 --- 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(-) diff --git a/tools/testing/selftests/kvm/aarch64/arch_timer.c b/tools/testing/selftests/kvm/aarch64/arch_timer.c index 274b8465b42a..818854007bfd 100644 --- a/tools/testing/selftests/kvm/aarch64/arch_timer.c +++ b/tools/testing/selftests/kvm/aarch64/arch_timer.c @@ -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, diff --git a/tools/testing/selftests/kvm/aarch64/vgic_irq.c b/tools/testing/selftests/kvm/aarch64/vgic_irq.c index 2e64b4856e38..a48aff110fb6 100644 --- a/tools/testing/selftests/kvm/aarch64/vgic_irq.c +++ b/tools/testing/selftests/kvm/aarch64/vgic_irq.c @@ -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. diff --git a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c index 5ea78986e665..325a8ead0660 100644 --- a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c +++ b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c @@ -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) { diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c index d374dbcf9a53..4971e8f77a0a 100644 --- a/tools/testing/selftests/kvm/dirty_log_perf_test.c +++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c @@ -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) diff --git a/tools/testing/selftests/kvm/include/aarch64/vgic.h b/tools/testing/selftests/kvm/include/aarch64/vgic.h index 0ac6f05c63f9..9dbb342fd808 100644 --- a/tools/testing/selftests/kvm/include/aarch64/vgic.h +++ b/tools/testing/selftests/kvm/include/aarch64/vgic.h @@ -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 -- 2.40.1