From patchwork Mon Aug 19 05:59:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Chen X-Patchwork-Id: 13767941 Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com [136.143.188.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F094171CD for ; Mon, 19 Aug 2024 05:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724047203; cv=pass; b=RmlInYIbDFIpO1ZMtsa2dwY2wGFJ8BsVuucbaBsFM47HYqGlGi7b8TBcMpzjqlm9zWCy9yiSnKhNIMM4JNi8zg6nJb3j/smLyGC4621pMip+YbRJAGeyPTotcJ3NY+EUzxNQuAZr3r4B8Xhz726XUGZ9nzWHwifew7rEaUrBwwM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724047203; c=relaxed/simple; bh=4ejzT6e53MucdWs+qFl2gyfsASnPywS+mjTcq68/G7k=; h=Date:Message-ID:From:To:Subject:MIME-Version:Content-Type; b=XmIXdOSmPTajKesZvU2FWH+UlvF/aldGAdwrUnn0LAHTkL1LTnpfLDNS6yfiYZbrlVix7xiQyR9IojSkuK365P1GXbIyOyvF3GYH5aUq8KVJuruHaN9+c6rCepSK40kQt/AyJ1AT07JJr5s0h6qSHtyjmGGEeqimsCl6RfQSJdU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=dA2CPl+h; arc=pass smtp.client-ip=136.143.188.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="dA2CPl+h" ARC-Seal: i=1; a=rsa-sha256; t=1724047180; cv=none; d=zohomail.com; s=zohoarc; b=X7qvGq8RnnKzM1CiYhRPUTQXGjkd1delkIo++dBwYn/mbWjQroz+U/hXvNa95f/st9RzvRg4YCKMwE9VIhlWpBfPei4WDpvXsWAWfYl97qmHREVCx9tQw6fACTLRQ60v6L0KX0A5lGLKnNOxUnoyVfp+KyUiLI0EH0olHtCP1fI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724047180; h=Content-Type:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Isl0Eo7nePSAEExZ7KyQFLazzTlcCbZ8bgjRhjQcQuU=; b=C3f03omIKRRnTA1VYtHmxprrsyVuJ0Uv+xXRVgHCp2KUBqNbiHhgYxhJ8wvqvs/DXKNtR00rJmvxvxAt0N71LdS9fXEJi3XsSsFggjT3ayJ/E9hjfxtSQw9lZUi+Mb3ckuLhwiggg6fXMWnckjUNrK9b0NGP0MnGbBY8Oq7Vnfc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1724047180; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:Message-ID:From:From:To:To:Subject:Subject:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=Isl0Eo7nePSAEExZ7KyQFLazzTlcCbZ8bgjRhjQcQuU=; b=dA2CPl+hBOPbVPGiuopTrQ4dA1Us3G4QJNDORwvKWL5+0rZ8FEQHbFZRp6rziHVo O6yhbZW/HWlIg7iZLhPRZ5DPCA5K3Kg6TODLFe+yakTjaL2ZjzZEasctJ1JNAMqFIII N6H7lSqasSTwWpLXSOLjpXcUIPBFyyN10bZP/ylM= Received: by mx.zohomail.com with SMTPS id 1724047179542690.9790731350549; Sun, 18 Aug 2024 22:59:39 -0700 (PDT) Date: Mon, 19 Aug 2024 13:59:27 +0800 Message-ID: <87zfp96ojk.wl-me@linux.beauty> From: Li Chen To: kvm@vger.kernel.org, Sean Christopherson , Paolo Bonzini , Thomas Gleixner Subject: [PATCH] KVM: x86: Use this_cpu_ptr() in kvm_user_return_msr_cpu_online User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?iso-8859-4?q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-ZohoMailClient: External From: Li Chen Use this_cpu_ptr() instead of open coding the equivalent in kvm_user_return_msr_cpu_online. Signed-off-by: Li Chen --- arch/x86/kvm/x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 70219e4069874..ffdf251bfef5b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -413,8 +413,7 @@ EXPORT_SYMBOL_GPL(kvm_find_user_return_msr); static void kvm_user_return_msr_cpu_online(void) { - unsigned int cpu = smp_processor_id(); - struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu); + struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs); u64 value; int i;