From patchwork Thu Aug 25 05:08:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 12954206 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 58485C04AA5 for ; Thu, 25 Aug 2022 05:12:25 +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=AjVnJsGRmi46J0DwAM+Tja24HIfTjVYNFLI9TWYdKvQ=; b=uFy8P1ak9reyabQJGOl6Rewc68 DpN18Ul+nI/odC2EFCYtBhV5WfDD9nNkF+eFFnEBQQK7RtT6QsuEgrwKNdeaA7LEmldgSKeMu7j+Y mU++Xvuw7yV4mYjG8N628PXEfHX89TeCzsuoiuGCknvWNO9/BzzY60zWZN23ZtODdWZLrA75KNVzb X3JeQFH0DgZf0lykSsBneWYPLMXcgJ6ydG2X1YAe+nVoyOaHSqmJA0Zm1TBNCCK8EcVt9GChoEBQt PHZAznYOGAPC37gmTRDwL3x7iuE4WbWWksaU4TEFb5U+/TKh72kg54m72F/iNlfXNPtxz/QGNx6Qw bXFSmBwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR59D-007EN0-4a; Thu, 25 Aug 2022 05:11:19 +0000 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR58I-007DZO-NY for linux-arm-kernel@lists.infradead.org; Thu, 25 Aug 2022 05:10:24 +0000 Received: by mail-pj1-x104a.google.com with SMTP id oo12-20020a17090b1c8c00b001faa0b549caso2275738pjb.0 for ; Wed, 24 Aug 2022 22:10:19 -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=pEzlhIhHkJ9oe9us+Ap6efv2GvV7LuN1d5BuceK5HtQ=; b=GDyPQuvB4CGkscQbFZesosca0zjSklRpbtqexkueZNX0/pQlIx18BczSNbJOP6N52r VK0YZIjzcrbwa8JnR5p94cA3vM3FOALNsiaDpTwkEQ5sYP8zR2+ZCDGSbAHtV1d2ntKO 1nscFoy1pN1GJ/KqunnMWBDzX60HpvGeV1ZFpeTg2j/LI9cFvBStu4bK+XXveF0y/P93 iIpNZOY8Cm/V3G+MHqg8np+I0RwEFmMV9x4YMP+uyhlRuqHaRf87tYe6/Jaha/2Nqe24 hjZfCUriCXxAGqR5uLeTWRpq8z3vDgesV9E3/ACXNMNELEY5hwkQ7ZH9wBrfCwDKEHHR b/+w== 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=pEzlhIhHkJ9oe9us+Ap6efv2GvV7LuN1d5BuceK5HtQ=; b=wf4/NYbeHF4uBF/vESzvOXFMIlPPfIYTZkcoaTmR//isioyopLCm1iVfE+lipzMOdY V6lIyOaDIPvxvUDogzTtNGZVJFBlJFvM8cJFkUK8aLPvQbamSegz+MHcVqDvPzkr62uj eZ+pKWR9Q3YiQl0yQyIb+8qaA0EcEWLT0QZr22Mig7MOHydoEWZcZ4XdLFC7Yog3cIBK nSVIN+B4tySMZLrhzizvJ84nUC82dLMANusasMJU7mO5aTGnuj4FpTGv7rNWG1jtNgpe Kq0QuJktiZjJbjmz0kIZm4TvE4FnEznBy3k5/ww6mlrLBsf8SzbJZPpE7w54SFyulP+U GjQQ== X-Gm-Message-State: ACgBeo1Dj84viPcFeUBsKd1b8pbyfOGvWtkYvnY2D/k0xH3xmcYbwdaK Rg/yW2hkrl8ApjxtyvFhDUznMULyfH8= X-Google-Smtp-Source: AA6agR4QwGnPgJc9EXrJlzOPJDZW1awp7QnK0mmHC+92n4anJ3Yqks2hO/x4pF1tFVBJVUjLL44mvc2Kwdg= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a17:90a:de96:b0:1fa:e427:e18e with SMTP id n22-20020a17090ade9600b001fae427e18emr12097875pjv.116.1661404218605; Wed, 24 Aug 2022 22:10:18 -0700 (PDT) Date: Wed, 24 Aug 2022 22:08:42 -0700 In-Reply-To: <20220825050846.3418868-1-reijiw@google.com> Message-Id: <20220825050846.3418868-6-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 5/9] KVM: arm64: selftests: Have debug_version() use cpuid_get_ufield() helper 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_785459_81A2D8A8 X-CRM114-Status: GOOD ( 11.06 ) 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 use cpuid_get_ufield() to extract DebugVer field from the AA64DFR0_EL1 register value. Signed-off-by: Reiji Watanabe --- tools/testing/selftests/kvm/aarch64/debug-exceptions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/aarch64/debug-exceptions.c b/tools/testing/selftests/kvm/aarch64/debug-exceptions.c index 713c7240b680..17b17359ac41 100644 --- a/tools/testing/selftests/kvm/aarch64/debug-exceptions.c +++ b/tools/testing/selftests/kvm/aarch64/debug-exceptions.c @@ -320,7 +320,7 @@ static int debug_version(struct kvm_vcpu *vcpu) uint64_t id_aa64dfr0; vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(SYS_ID_AA64DFR0_EL1), &id_aa64dfr0); - return id_aa64dfr0 & 0xf; + return cpuid_get_ufield(id_aa64dfr0, ID_AA64DFR0_DEBUGVER_SHIFT); } int main(int argc, char *argv[])