From patchwork Sat Feb 11 19:07:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13137193 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 3E1A6C61DA4 for ; Sat, 11 Feb 2023 19:09:06 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rSs7zOmN0sbCMmVuUL3z0tW3FV/5Cd12dDDlRMayYOM=; b=YZVAJn4lGUQc5F Th8KHRhNxmf3P2gxXY0I47+su3PLyEm15z8oVdp6+gyeBrHqnwpaKAQR9uzavErZQuvbh912gyCVv +pbM/rot1ol8sMk4ZdMSThP9MXz4548bsM6PzUI5kI/WVfXHKa7FtWVy2/67g4CCqfn4wcnkAQCn3 UYE9anBjfS6S/kUwBuXHanKvLL0NH0eDIv1y3ZUZoCXT5/QqiA/uOTZS565d+RutusiLyhvthajL3 zH9i0not3gShjplPBwC7CIEkziVFdmAliHBI2XsiOegXS8M1sOsUGJ1Getgmmr4Xp8F+Cn+wBmQs2 cA1SoLqJBxFfAo1cnX+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQvEB-00A8vx-HN; Sat, 11 Feb 2023 19:08:03 +0000 Received: from out-120.mta0.migadu.com ([2001:41d0:1004:224b::78]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQvE7-00A8un-Og for linux-arm-kernel@lists.infradead.org; Sat, 11 Feb 2023 19:08:01 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676142471; 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=766mrZzi9sUN8wUut4UfkASE1CblQP7qLoaZc+hbkSQ=; b=orIj2ZjLDRmk89H+pmowuTKeI9mErG0+7/RmDmNBtGGq6BrP/QMV1O/GGM7yxFVWIwLsw+ ZZL+Bxs8VrKIwKOA0ujepp12fGGwurQ8xtc6Tsc8HFH9qH1ClKJiYCQkPtMH7DpHsjmCUL HUzbG2VwU2AyLj3qvzSwxP8ptzYgNxM= From: Oliver Upton To: Marc Zyngier Cc: James Morse , Suzuki K Poulose , kvmarm@lists.linux.dev, Zenghui Yu , linux-arm-kernel@lists.infradead.org, Christoffer Dall , Ganapatrao Kulkarni , Russell King , Andre Przywara , Alexandru Elisei , Oliver Upton Subject: [PATCH] KVM: arm64: nv: Use reg_to_encoding() to get sysreg ID Date: Sat, 11 Feb 2023 19:07:42 +0000 Message-Id: <20230211190742.49843-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230211_110800_614581_333E4A17 X-CRM114-Status: UNSURE ( 7.49 ) X-CRM114-Notice: Please train this message. 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 Avoid open-coding and just use the helper to encode the ID from the sysreg table entry. No functional change intended. Signed-off-by: Oliver Upton Acked-by: Marc Zyngier --- Applies to github.com/oupton/linux kvm-arm64/nv-prefix arch/arm64/kvm/nested.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index f7ec27c27a4f..315354d27978 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -26,8 +26,7 @@ void access_nested_id_reg(struct kvm_vcpu *v, struct sys_reg_params *p, const struct sys_reg_desc *r) { - u32 id = sys_reg((u32)r->Op0, (u32)r->Op1, - (u32)r->CRn, (u32)r->CRm, (u32)r->Op2); + u32 id = reg_to_encoding(r); u64 val, tmp; val = p->regval;