From patchwork Thu Jul 27 09:07:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13329834 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 ABFA0C0015E for ; Thu, 27 Jul 2023 09:08:38 +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=zGPZm3kejSrPcMRqtKC5SqvhbLPMUYAo5FpGnj26gt4=; b=uPhWgRng4l4pUm ZnMCJ2edqa4J0TlsWJBkNP8eQHUUvAY5AEM6z3KClIzrPc4EMQRaNncC36j/Vd9kVng1l0/khQr5X 9/dhEDTvzOkXgSYWdzgitdTTNlAHtTv225YK3Io2zPgY2+xNeCHdpEuEDbMK0Ox4V5fvxuSwc/M9h rFU3Zp7mpTQUlEeAkhOrpWkGjLfhOEBW3m+K39nHvKrBOCMhjYl6UBbhxiJUqjRZXJuMSzxg2AWef 3VyGgPWycJ7wPXnVPlsNebyP0esCYeMxqSCIe8GJG54z0eqJIG1ZgACcyhnsSOEzbQetYwYoykX8+ cT55Faclc054n57nx/Yg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOwyi-00Cmf2-03; Thu, 27 Jul 2023 09:08:12 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOwyf-00CmeM-1T for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 09:08:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690448886; 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=HerRwxLkSMzYwKdGiBkPfrNJD4PElAmEIiMvsjTuYlk=; b=QDkkRNOtYUF6nuOf4pUdz7H/ck9/BEJWkAlS0k5b0xobxj+32/HiOJWg4t4q5xFjupPV47 y2V9DhIsgcJ9bwLmjYm0SzQNl/YFgb/P36ifzFCaOsMwgZIQo7NIKvUBJns/jIsd4R2slF 1G4X7CVPYx7tVdMKcfJQO8bjC4hpXaQ= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652--b9woubmPsS2O4joqyqgAQ-1; Thu, 27 Jul 2023 05:07:59 -0400 X-MC-Unique: -b9woubmPsS2O4joqyqgAQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BDBF3C11CC9; Thu, 27 Jul 2023 09:07:58 +0000 (UTC) Received: from virt-mtcollins-01.lab.eng.rdu2.redhat.com (virt-mtcollins-01.lab.eng.rdu2.redhat.com [10.8.1.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00FDC2166B25; Thu, 27 Jul 2023 09:07:57 +0000 (UTC) From: Shaoqin Huang To: kvmarm@lists.linux.dev Cc: Shaoqin Huang , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] KVM: arm64: Use the known cpu id instead of smp_processor_id() Date: Thu, 27 Jul 2023 05:07:54 -0400 Message-Id: <20230727090754.1900310-1-shahuang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_020809_585914_8B715B5A X-CRM114-Status: GOOD ( 14.08 ) 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 In kvm_arch_vcpu_load(), it has the parameter cpu which is the value of smp_processor_id(), so no need to get it again. Simply replace it. Signed-off-by: Shaoqin Huang --- arch/arm64/kvm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index c2c14059f6a8..2e5d8f4b902b 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -457,7 +457,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) vcpu_ptrauth_disable(vcpu); kvm_arch_vcpu_load_debug_state_flags(vcpu); - if (!cpumask_test_cpu(smp_processor_id(), vcpu->kvm->arch.supported_cpus)) + if (!cpumask_test_cpu(cpu, vcpu->kvm->arch.supported_cpus)) vcpu_set_on_unsupported_cpu(vcpu); }