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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A94B7C04FE7 for ; Wed, 20 Sep 2023 18:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbjITSRu (ORCPT ); Wed, 20 Sep 2023 14:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjITSRq (ORCPT ); Wed, 20 Sep 2023 14:17:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AC2DCA for ; Wed, 20 Sep 2023 11:17:41 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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