From mboxrd@z Thu Jan 1 00:00:00 1970 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 5B447C04FD1 for ; Wed, 20 Sep 2023 18:18:31 +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:References:In-Reply-To: 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: List-Owner; bh=RNiBk/OVS7xThB9mLwTRwsxUgdEheFz2OO7dCchnKYE=; b=h++NatWlf1oOtR 7bqjI7x0L+oVQi+OOZTBFh3PuRf9sy36/Sga5PkJNhEKW9f9wWAe82H5JrkYJNr+DhgM62fuDEcDj SWIVpgCjnTKIvQYcJcHVN60LLB5vtomv72JkSC0gHIfJqPGjN8x8Q5L+y7saVUFWogPiKinYC64wc AtACEgCmt2+S1Rxw8/ytxRbUNdwWI1c9ykekGkVlFF/9SgpyANxd20QU8RQatCBDNkpcEjLJznTS8 7xpJ1sM4ev1nSaS8Jqcs6uT2p6NSWU6hxp3zIOVdRsciYpA8PbhoFX1nLBEgA7m+l0IM49aSAQSNR hYImVKv5m07mH3hYHfQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qj1lz-003pw6-23; Wed, 20 Sep 2023 18:18:03 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qj1ld-003pm7-1X for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 18:17:43 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA50F61DC3; Wed, 20 Sep 2023 18:17:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58901C433CB; Wed, 20 Sep 2023 18:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695233860; bh=ijvGBAz5yih+UJKYR6wIB6uZZ5gAmojLiq5qjhsaJ30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dLBY7lzlyZujkilR4lH+Vm4HqM3NrZvNmJFKX+JFdl6CllmZicezELNijrJRPzA6l XcHqxWkox9ihCqltg5nkOBotyzZfB3ynrdGp2DPrqaa7G1OpyfkAFc4+BybZD7vkQE a9IS8re6YrM5eGDJW3262+W9VwQ9Q5TIIfmrjTYm9+o29R/1HoIYsVTXDW8uT5K9mt oLgutExXoCGWmccV+8EQZ5N3Adu/xWnmlyUvqipXVeHp/6RZ21BswUz7N63cd9Vb89 k+2SSVkTWqcNT3ZvMa8rtS0jjVd1eHqlrSe5PXPvbcOhaeii//90rXGi50Y+Q5zcsd W4nVj3zm/0fDA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qj1la-00Ejx0-Dh; Wed, 20 Sep 2023 19:17:38 +0100 From: Marc Zyngier To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Joey Gouly , Shameerali Kolothum Thodi , Xu Zhao , Eric Auger Subject: [PATCH v2 07/11] KVM: arm64: Simplify kvm_vcpu_get_mpidr_aff() Date: Wed, 20 Sep 2023 19:17:27 +0100 Message-Id: <20230920181731.2232453-8-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230920181731.2232453-1-maz@kernel.org> References: <20230920181731.2232453-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, joey.gouly@arm.com, shameerali.kolothum.thodi@huawei.com, zhaoxu.35@bytedance.com, eric.auger@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_111741_560552_151FAE0B X-CRM114-Status: GOOD ( 13.98 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By definition, MPIDR_EL1 cannot be modified by the guest. This means it is pointless to check whether this is loaded on the CPU. Simplify the kvm_vcpu_get_mpidr_aff() helper to directly access the in-memory value. Reviewed-by: Joey Gouly Tested-by: Joey Gouly Tested-by: Shameer Kolothum Signed-off-by: Marc Zyngier --- arch/arm64/include/asm/kvm_emulate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 3d6725ff0bf6..b66ef77cf49e 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -465,7 +465,7 @@ static inline bool kvm_is_write_fault(struct kvm_vcpu *vcpu) static inline unsigned long kvm_vcpu_get_mpidr_aff(struct kvm_vcpu *vcpu) { - return vcpu_read_sys_reg(vcpu, MPIDR_EL1) & MPIDR_HWID_BITMASK; + return __vcpu_sys_reg(vcpu, MPIDR_EL1) & MPIDR_HWID_BITMASK; } static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu) -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel