From patchwork Thu Oct 20 05:41:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 13012634 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 B27A3C4332F for ; Thu, 20 Oct 2022 05:45:04 +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:Message-ID: References:Mime-Version: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=CwFrpKJ3rpDEmTGkM1Z2lOvhYn4/k/jHRkLHL5T4IsU=; b=ikYDOrChiPx2KvPtyE6Nqr6kI6 Sjsv2RY2aMClXZbQijum5PGoaqNmKe6A5TRBx/ifcCUGre3d2dSKiQX3S/+NtXK5ZR75ApHwi5V1X 7+m2KEfvhCzwXPx5PFmRqs+0x6rlK8Oj9qiDZ22yIB5mrp9dyuQFOdL0KAqCKNOxGpjFP63Bvw2ji jT1FjvGaDS9a0WQxz8hNwGNhj5JMt8LSqWu5dAEYs4h7rJWs+OGXIVdsvOkwyT7n+J0VXQOEWMbf0 7jJe55W3h7HHaGhlUe13Jyo+kDp3AA/K9hvFSk0CXhXdJjJ+pPECJwTDjrHqAy8O9ODFcovGeK+H/ 96vPEuxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olOLT-00AWAS-QY; Thu, 20 Oct 2022 05:43:57 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olOL6-00AVTq-7O for linux-arm-kernel@lists.infradead.org; Thu, 20 Oct 2022 05:43:33 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id e8-20020a5b0cc8000000b006bca0fa3ab6so18179767ybr.0 for ; Wed, 19 Oct 2022 22:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=VB1jPPUEjrX48I4GSjyuQn7W+BcJBZ1KSoLIzPYJb4c=; b=ZBvzHWXEg5+0LfNox4fGQHvZCGExRABrADPgKQ0uJAT3GS2bcwXVcPUHDokKK0oD8e rBfcnafeNZELKVFMbhHowJDe7++TZWn9+acFfzRzNTYOvkyUYvbGXQueYUS7+V7xHqjc pASv4I9AmarKpMizQUqSSMGE+PrD1DktzRC0sEF4OWpoRrGdgBAo3uvOROA8AlwjqjE0 bxaJb3Vla6LFM5hsDsBAYwGA5biTNljRB4SUgd2nJUMnSSiio4kL7inDOrpqnyBxmh5O 0tPO6YMpMe3QmY5eX0aMQCl+cXZNO+TWL4qwf6QJ270u6kIT3RQormWGvj9KrJgD9jYd Rfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VB1jPPUEjrX48I4GSjyuQn7W+BcJBZ1KSoLIzPYJb4c=; b=4D2KhonWni0w2qz7l2+vVHrlw49EncAsDOuvLoMWcxnB/oy2Me26pd03neYTKas/Ia viO9LKRAOGTm/Mj4wPy9NK7IR5DqD5KF06HWkzYPCxcW3pcuEXO3U3vdvTvl0hau862f t71anWRvD9HZsPT3toeZdRgkc45c8ewRgU0KdwYcEUPN548MrjHiWU78VABlkjdlAWYl NKgvOzl7le4alYzwwIAatFe1lCf9Xn47oGGXjZxYWB9Kh5GM3mkwjKU/jJk2ICSowoBg YUml4DiNzUsrGE14JmIVEKkc3jmbekCte5BBgV/oVaf0UEGI9+ndOj4mAr6K1lhpJypb gGbQ== X-Gm-Message-State: ACrzQf0FIsiep6MZNMYZAXlDW4DY1e2srKongKrmZSvIiDwK/qhhOeJn f3R/PH5izigKsZtWSSA0swLTESphQls= X-Google-Smtp-Source: AMsMyM4QU19wSO5ZMBNGHX43y4ZfNhPpdLhf7KWE0/041MMlzko8xOXHq23D3L2kQwLsCPfLQLR/LWK3xuY= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a25:a4ea:0:b0:6c0:2f38:431d with SMTP id g97-20020a25a4ea000000b006c02f38431dmr10273171ybi.276.1666244610630; Wed, 19 Oct 2022 22:43:30 -0700 (PDT) Date: Wed, 19 Oct 2022 22:41:59 -0700 In-Reply-To: <20221020054202.2119018-1-reijiw@google.com> Mime-Version: 1.0 References: <20221020054202.2119018-1-reijiw@google.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog Message-ID: <20221020054202.2119018-7-reijiw@google.com> Subject: [PATCH v2 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-20221019_224332_295689_A4FFA74E X-CRM114-Status: GOOD ( 11.10 ) 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. No functional change intended. 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 040e4d7f8755..72ec9bb16682 100644 --- a/tools/testing/selftests/kvm/aarch64/debug-exceptions.c +++ b/tools/testing/selftests/kvm/aarch64/debug-exceptions.c @@ -337,11 +337,8 @@ static void guest_code_ss(int test_cnt) GUEST_DONE(); } -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 FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_DEBUGVER), id_aa64dfr0); } @@ -466,9 +463,11 @@ int main(int argc, char *argv[]) struct kvm_vm *vm; int opt; int ss_iteration = 10000; + uint64_t aa64dfr0; vm = vm_create_with_one_vcpu(&vcpu, guest_code); - __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."); kvm_vm_free(vm);