From nobody Wed Dec 17 08:56:10 2025 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 6506D25A2BE; Mon, 12 May 2025 08:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747039594; cv=none; b=cmmXtHNrNl8oc3FpnM+rkAqzrId8S0rfB9NyC/qDG91cMNJ/dbLAF1PgLzHQ0C9h/rFcMV22uAoiBaRlzshlhjXG73u0AGv4GTiuFmm/WwqOFRjzh4hmL1V/I767nAOoaTUb4ud+0xkSDdD4U3GaGoGmIXTWGX9IU4h7KqRQAC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747039594; c=relaxed/simple; bh=PkHHRi91TsmNgeDiiqGzH6MLxD+zfbPOyGJVIBdp9bU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tVcNq3EiLv4rnXHFbBrmEpqxr+HaW5DFO1+wM8sHkraSy3oJrMrGr7yBxZ5BZql4XutFC/r/LdAQ7aAKb8mT63/F+QTegFH20yNF9rPDVYryE9cbB5tcSUguziXCpYlEePnklelab6Rybo5JzZoIeTWBZMD3yvHyDoj5Z5i9eaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=VcTDFlAM; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="VcTDFlAM" Received: from terminus.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3:0:0:0:136]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 54C8jqc51586901 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 May 2025 01:46:00 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 54C8jqc51586901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025042001; t=1747039561; bh=irTR9cBZ/bUuJJE/VFD2XvoxgAwJuCqUqRaQbxDTnhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VcTDFlAMSO7tiJedpeu3nDD6gS5DKigxV5zB3FuQKYZuCYrH0Lnq6AyaDavtFxQ+5 ivDulsoeXhp5fga7oMz3GqsLoQUCH7YHtAGOBPydV4CeUV1qfkYmG4WfTZ17vkHC8X RH3QbWUsZGXrV8DJbo7Rs8XEeCcGNJQYuntOy9EF5GEngLsIAzmYPxRn2BDdyqkMbx w3IxvetoI01oDeyxtBGKYR7xymh7giIgJSqj4+DupWNwLFA0keD5peqp4UGQ3ZbuxD Id5FCpC5mxUpyYR4tLAS4sui06LZxoaL6E9/ixZj6OIz3pKprWQZgCloVU3I3ImoLP o3GbZYpLKgr/g== From: "Xin Li (Intel)" To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, jgross@suse.com, boris.ostrovsky@oracle.com, rafael@kernel.org, lenb@kernel.org Subject: [PATCH v1 1/3] x86/msr: Remove a superfluous inclusion of Date: Mon, 12 May 2025 01:45:50 -0700 Message-ID: <20250512084552.1586883-2-xin@zytor.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512084552.1586883-1-xin@zytor.com> References: <20250512084552.1586883-1-xin@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The following commit: efef7f184f2e ("x86/msr: Add explicit includes of ") added a superfluous inclusion of to drivers/acpi/processor_throttling.c. Remove it. Signed-off-by: Xin Li (Intel) --- drivers/acpi/processor_throttling.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_t= hrottling.c index ecd7fe256153..d1541a386fbc 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -21,7 +21,6 @@ #include #include #include -#include #ifdef CONFIG_X86 #include #endif --=20 2.49.0 From nobody Wed Dec 17 08:56:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=zytor.com ARC-Seal: i=1; a=rsa-sha256; t=1747039617; cv=none; d=zohomail.com; s=zohoarc; b=jeE2JtizrLHDzXkqlCPE0J1Hzo0rxvMJxOmwGa7w+hEOif5ZsnmgNZdr9kBd5hk5AonYRQG1yGB9aY/IuR9kp0v5453bwCjYbBEVLYElyQjeUvGX+XS94jRWlxFM0ciIntTx4Lrfzmfbu6q7ydaLRkAqJg3PjCzNyOq6LkH8S2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747039617; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r60JlXTos4KUiP7BNV4Mubm1J2LcZX1eO8iTOKbeekU=; b=A9fGUrswWD64ad+0bJ/s638AZn1+8V4iv86w4hvCVGycFm4WydULMoTwJJ9SHxym/ImzisOCOf0ZCy5gEAtKLSnuvQq2aphWsF1/SdQ/j75sLaMorFsKeA/p+i6O8LFVTx/cXHEKVBSJHyjkqqD0O8Ujw0UFTUBuiMTjprunbsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747039617881182.59005863599702; Mon, 12 May 2025 01:46:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.980965.1367377 (Exim 4.92) (envelope-from ) id 1uEOo9-0004GM-Ay; Mon, 12 May 2025 08:46:45 +0000 Received: by outflank-mailman (output) from mailman id 980965.1367377; Mon, 12 May 2025 08:46:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEOo9-0004GF-6x; Mon, 12 May 2025 08:46:45 +0000 Received: by outflank-mailman (input) for mailman id 980965; Mon, 12 May 2025 08:46:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uEOo7-0003Qj-Fz for xen-devel@lists.xenproject.org; Mon, 12 May 2025 08:46:43 +0000 Received: from mail.zytor.com (terminus.zytor.com [2607:7c80:54:3::136]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 970f45be-2f0d-11f0-9ffb-bf95429c2676; Mon, 12 May 2025 10:46:28 +0200 (CEST) Received: from terminus.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3:0:0:0:136]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 54C8jqc61586901 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 May 2025 01:46:01 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 970f45be-2f0d-11f0-9ffb-bf95429c2676 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 54C8jqc61586901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025042001; t=1747039562; bh=r60JlXTos4KUiP7BNV4Mubm1J2LcZX1eO8iTOKbeekU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bmWYvnwxTU0pVJW4u5KvyhR8cTc1ILbP2oLLV6/74QxSidvlgisrmNIxqhqDAWxKZ TfRpxdQFxnaY6yhrR7m4LAqjzS1vvDMK3xmikiuu/o0qUX54thQc2j1Gjq2HQ4VNwr rQKjxAF2qcQOahokDI2/tvLM1hf8YVHZ+abqqiF51/1wliz8hXeqPJdAFOMveLB42B DSKDUbp1sv3q/sTl5Z8xcEzVErSlNqGYT1F1PLCScIypX4jxPqjgttEGM9q3tH7Gdv i3o5hUvLakD4MvXrM6mRnnF2KzfqtpiDMAQ8pAj28Y0O3oXTU0l3ue3PDx/tGmMrY1 Snn6b8NY550AQ== From: "Xin Li (Intel)" To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, jgross@suse.com, boris.ostrovsky@oracle.com, rafael@kernel.org, lenb@kernel.org Subject: [PATCH v1 2/3] x86/xen/msr: Fix uninitialized symbol 'err' Date: Mon, 12 May 2025 01:45:51 -0700 Message-ID: <20250512084552.1586883-3-xin@zytor.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512084552.1586883-1-xin@zytor.com> References: <20250512084552.1586883-1-xin@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @zytor.com) X-ZM-MESSAGEID: 1747039619155019000 Content-Type: text/plain; charset="utf-8" xen_read_msr_safe() currently passes an uninitialized argument err to xen_do_read_msr(). But as xen_do_read_msr() may not set the argument, xen_read_msr_safe() could return err with an unpredictable value. To ensure correctness, initialize err to 0 (representing success) in xen_read_msr_safe(). Because xen_read_msr_safe() is essentially a wrapper of xen_do_read_msr(), the latter should be responsible for initializing the value of *err to 0. Thus initialize *err to 0 in xen_do_read_msr(). Fixes: 502ad6e5a619 ("x86/msr: Change the function type of native_read_msr_= safe()") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/xen-devel/aBxNI_Q0-MhtBSZG@stanley.mountain/ Signed-off-by: Xin Li (Intel) --- arch/x86/xen/enlighten_pv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 3be38350f044..01f1d441347e 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1091,6 +1091,9 @@ static u64 xen_do_read_msr(u32 msr, int *err) { u64 val =3D 0; /* Avoid uninitialized value for safe variant. */ =20 + if (err) + *err =3D 0; + if (pmu_msr_chk_emulated(msr, &val, true)) return val; =20 @@ -1162,7 +1165,7 @@ static void xen_do_write_msr(u32 msr, u64 val, int *e= rr) =20 static int xen_read_msr_safe(u32 msr, u64 *val) { - int err; + int err =3D 0; =20 *val =3D xen_do_read_msr(msr, &err); return err; --=20 2.49.0 From nobody Wed Dec 17 08:56:10 2025 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 27E3225A2B7; Mon, 12 May 2025 08:46:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747039594; cv=none; b=ScEwW81rbfPQkeRo59ucZbU8bCGQ0Arwtft45+yI5n/zQyGK+0F1cRCk6+LnUbtRCrLFKbsOZXL49RUxgjyBimdrhRNWMyk9IgWRN4+TPbICdnbP2nmc8LJ3EJnleIiFE77aawIYezS9Ep9l/MGwnU2F8/8HRud/tQpzfpLSLJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747039594; c=relaxed/simple; bh=mNrvlVy7n4m/KddWEReBiHCLsCEcSbh6FGrWwUy2B7w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EB7lqTBT6zPV3OBihutujlR925lz3Lg/WAOOYyOOQUcAFvc/Jk35tL+rl6vvjFhpH2jmLjld0syXIp6oxpgoh/qnZqMT9KnG0xwzmBZFy8kekqyeX48iHhnwcxk4uyd5NVA2AS6nt0gXL1INaTgeDyCNqevGF09m0yceq6tNQC4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=Wqu4jU+G; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="Wqu4jU+G" Received: from terminus.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3:0:0:0:136]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 54C8jqc71586901 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 May 2025 01:46:02 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 54C8jqc71586901 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025042001; t=1747039563; bh=SJyp7okD30HInZ1fgTptAjmwrX1aqps8vhA1kdAJWhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wqu4jU+G5jmxtcMoxZU7xxTMdvYR6zp4VYJGyttTpRKojR4aUWkuBntnRPy95mMNP TdZY/WjcOubxB+VWkDSGvR2bQ2PxqfaD5oWLx5oeN+NwmwkfwQIUZulba428YPa6+d a4AmbXGRcZ1fxkw8DveEBEf6vdK9sioL+MwfJHOFQAN6ndlCoGnFJkOa79chbmM/8k 1WrQiT23ytcFJl83Qmf/PRSdkQRCO12iTFRgpvQMjzhTN1Kupv6cOH9+fDYRg2byiA tWnUdW/sgtBWnr7GH/hZQsLfWNgCHqZh3Zuo+gLz+y09m/2TX32FcNb1vZHCeyNmv1 7DFsocyxduIZw== From: "Xin Li (Intel)" To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, jgross@suse.com, boris.ostrovsky@oracle.com, rafael@kernel.org, lenb@kernel.org Subject: [PATCH v1 3/3] x86/msr: Convert a native_wrmsr() use to native_wrmsrq() Date: Mon, 12 May 2025 01:45:52 -0700 Message-ID: <20250512084552.1586883-4-xin@zytor.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512084552.1586883-1-xin@zytor.com> References: <20250512084552.1586883-1-xin@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Convert a native_wrmsr() use to native_wrmsrq() to zap meaningless type conversions when a u64 MSR value is splitted into two u32. Signed-off-by: Xin Li (Intel) --- arch/x86/coco/sev/core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c index ff82151f7718..b3ce6fc8b62d 100644 --- a/arch/x86/coco/sev/core.c +++ b/arch/x86/coco/sev/core.c @@ -282,12 +282,7 @@ static inline u64 sev_es_rd_ghcb_msr(void) =20 static __always_inline void sev_es_wr_ghcb_msr(u64 val) { - u32 low, high; - - low =3D (u32)(val); - high =3D (u32)(val >> 32); - - native_wrmsr(MSR_AMD64_SEV_ES_GHCB, low, high); + native_wrmsrq(MSR_AMD64_SEV_ES_GHCB, val); } =20 static int vc_fetch_insn_kernel(struct es_em_ctxt *ctxt, --=20 2.49.0