From patchwork Thu Aug 25 05:08:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 12954205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88FA8C04AA5 for ; Thu, 25 Aug 2022 05:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=K1EPcmVoOZr6QU2OTt+0kZeLhPYdhShk7Kpu+a/4aro=; b=EGDqt/653fM3HLuW//ugSHZsAc c9GJeqJcFSppJQy6NATlHOo5aG6iin9lEBulnbtZlZRi+SUxWuZY8BMdlUPK3vZ3jxCmoazI7Srve CoF48R2i3RNK1gK3t9C8Y3Tp6UrHwM0O4WzQK53cP9B2yvJM9dc+pA09RFGrvcPgjZfNtf6HPgwwW X7Gu4ZKmW2QGgegMWiVwZuxhBIi7ZtC6DU8T0n+128BWykH1mhro+nO9ZIAMHAY6fzWWUr2r+A0lo 6OKXcBLvxi2a3qIQC9HZYN3qeXRi0XUo1ci6bjBj9QhBTZxlMER/UYmEApT0jkEKydwM9bRihldK+ Y+6/kz9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR58x-007E7e-UP; Thu, 25 Aug 2022 05:11:04 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR58I-007DWU-2k for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2022 05:10:23 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-335420c7bfeso326534977b3.16 for ; Wed, 24 Aug 2022 22:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc; bh=EmnP6URNfHv6I0nbxGmg1XJ0KHdi317moIKFVeeAsc8=; b=odzh+413GPIsjI66IJBEHSOJ1TAozjY8/5h10hAgbwXYR+m8+Bq098asyIJO31M6XX FG6XQOp4j4ukN2HsJ06YJmmH7orlAaws2A+dvnD8GzU49lsEM59llnl7vYysAlJjgJkB Z9sSIQCG/bNvPvmJkwVn3TuSSS3HX7RGRbtoLkCPKctFswbbcSHV14tjLpeVjQWTS/3U 74fuO1j9abX4bH4TwtyH1divYl7Kc0o51RcxSyPowqEfdSqwcMMuUC8p7UUGhR3wso3K bgUqyEQlUfxjPBGEj9/3GzXGK/Y/DNJHWiAHHQS6DuztTtwkFMrAa/O5D1XFFaAaC9wU XO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc; bh=EmnP6URNfHv6I0nbxGmg1XJ0KHdi317moIKFVeeAsc8=; b=Y3XNboGufFJoJdBISzX4G69Rw6D23EUUR6h+UE63kqleT7SWyypdMgmaOQlvi4pWN5 UREg0Mkk7LHofHEROW+i1YMlFjs7ekmPLxNQg59jG/uFTmZKmx5Mw76rS2eP3SaCpGHl MhKxqAXjCFZVgpXdrZztZJCKxtSBZFOESTWrYfNkTODMKZqQIKkjJRIudCTxUjv3H1uu yYfKI4dQ3G/oqTLAfuhtTxKZS3ugMwpeUet2idsBLQeEZLZfkZ5BjDSMHg6D+dYjcNwb sizpBllRmO/pHuWMQm6e5929c3BQG3MgJXrzMy/skrR0slk8ndGr9AFYxhfS7/emmWeS a0pg== X-Gm-Message-State: ACgBeo0MuHvvBfDQ2mE0h5aN/EdPYf80JAvvQPCe13tgmTBPcpndG4is zZtkeSmuiPUmulLFlzPJqzsQHWPI6qM= X-Google-Smtp-Source: AA6agR4ONormzDuDs7YpdVMH6kwTbayc6AXSuIT5cwIOH9liK5R8puxixgYLfHyko+rG1K4Ic3X2+t6qTmc= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a5b:dd2:0:b0:695:7965:1747 with SMTP id t18-20020a5b0dd2000000b0069579651747mr1981297ybr.415.1661404221149; Wed, 24 Aug 2022 22:10:21 -0700 (PDT) Date: Wed, 24 Aug 2022 22:08:43 -0700 In-Reply-To: <20220825050846.3418868-1-reijiw@google.com> Message-Id: <20220825050846.3418868-7-reijiw@google.com> Mime-Version: 1.0 References: <20220825050846.3418868-1-reijiw@google.com> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog Subject: [PATCH 6/9] KVM: arm64: selftests: Change debug_version() to take ID_AA64DFR0_EL1 From: Reiji Watanabe To: Marc Zyngier , kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Andrew Jones , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata , Reiji Watanabe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220824_221022_169868_0FB88912 X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Change debug_version() to take the ID_AA64DFR0_EL1 value instead of vcpu as an argument, and change its callsite to read ID_AA64DFR0_EL1 (and pass it to debug_version()). Subsequent patches will reuse the register value in the callsite. Signed-off-by: Reiji Watanabe --- tools/testing/selftests/kvm/aarch64/debug-exceptions.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/aarch64/debug-exceptions.c b/tools/testing/selftests/kvm/aarch64/debug-exceptions.c index 17b17359ac41..ab8860e3a9fa 100644 --- a/tools/testing/selftests/kvm/aarch64/debug-exceptions.c +++ b/tools/testing/selftests/kvm/aarch64/debug-exceptions.c @@ -315,11 +315,8 @@ static void guest_svc_handler(struct ex_regs *regs) svc_addr = regs->pc; } -static int debug_version(struct kvm_vcpu *vcpu) +static int debug_version(uint64_t id_aa64dfr0) { - uint64_t id_aa64dfr0; - - vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &id_aa64dfr0); return cpuid_get_ufield(id_aa64dfr0, ID_AA64DFR0_DEBUGVER_SHIFT); } @@ -329,6 +326,7 @@ int main(int argc, char *argv[]) struct kvm_vm *vm; struct ucall uc; int stage; + uint64_t aa64dfr0; vm = vm_create_with_one_vcpu(&vcpu, guest_code); ucall_init(vm, NULL); @@ -336,7 +334,8 @@ int main(int argc, char *argv[]) vm_init_descriptor_tables(vm); vcpu_init_descriptor_tables(vcpu); - __TEST_REQUIRE(debug_version(vcpu) >= 6, + vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &aa64dfr0); + __TEST_REQUIRE(debug_version(aa64dfr0) >= 6, "Armv8 debug architecture not supported."); vm_install_sync_handler(vm, VECTOR_SYNC_CURRENT,