From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6CC93C2B82 for ; Mon, 29 Jun 2026 06:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782716242; cv=none; b=EncnK8UJfsuchjUg6O/uf3+zmeZpt4KoP59rb/Kq57BW357fkm+0YR3eKD7RH5PVY9vPTVIzIUZ8mjWBn+h+S7jJDAnGd+xfmB8p0PwS3Gmrs9kzHu+yYOVrDR60aC/fBx5u++X2SySZiEIrHpdhQgOPXHNN9NNTAOFYh865oMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782716242; c=relaxed/simple; bh=/SkIgLbuypieCDjz+RCrJV/IMl1sV0FddN4+mIBvQT8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OSFWqcJ97NRw5QY7ekk5JOEMjOtjPCxH5GDvMVsKBtPv5y3Gdta3WiDAiaFRQcUIcUSdNdByGDQ815h4z+1lxtNKyWG0eHwZ3OHwc9LqKDr/ORXustC13TfXUzVFM0G9FzmX76g5Ljns+IB0Bi7Ojuu2x5Kri6kZHWxO6+CIMA8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2FE9F75D0F; Mon, 29 Jun 2026 06:57:19 +0000 (UTC) Authentication-Results: smtp-out2.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D482F779A8; Mon, 29 Jun 2026 06:57:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id DuZvMk4XQmqQQgAAD6G6ig (envelope-from ); Mon, 29 Jun 2026 06:57:18 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Boris Ostrovsky , xen-devel@lists.xenproject.org Subject: [PATCH v4 16/18] x86/msr: Reduce number of low level MSR access helpers Date: Mon, 29 Jun 2026 08:55:42 +0200 Message-ID: <20260629065544.3643253-17-jgross@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260629065544.3643253-1-jgross@suse.com> References: <20260629065544.3643253-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 2FE9F75D0F X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] Some MSR access helpers are redundant now, so remove the no longer needed ones. Signed-off-by: Juergen Gross --- arch/x86/include/asm/msr.h | 15 ++------------- arch/x86/xen/enlighten_pv.c | 4 ++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index b13b4a93673e..74defb414931 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -269,22 +269,11 @@ static __always_inline void native_wrmsrq(u32 msr, u64 val) __wrmsrq(msr, val); } -static inline u64 native_read_msr(u32 msr) -{ - return native_rdmsrq(msr); -} - static inline int native_read_msr_safe(u32 msr, u64 *val) { return __rdmsr(msr, val, EX_TYPE_RDMSR_SAFE) ? -EIO : 0; } -/* Can be uninlined because referenced by paravirt */ -static inline void notrace native_write_msr(u32 msr, u64 val) -{ - native_wrmsrq(msr, val); -} - /* Can be uninlined because referenced by paravirt */ static inline int notrace native_write_msr_safe(u32 msr, u64 val) { @@ -327,7 +316,7 @@ static inline u64 native_read_pmc(int counter) #else static __always_inline u64 read_msr(u32 msr) { - return native_read_msr(msr); + return native_rdmsrq(msr); } static __always_inline int read_msr_safe(u32 msr, u64 *p) @@ -337,7 +326,7 @@ static __always_inline int read_msr_safe(u32 msr, u64 *p) static __always_inline void write_msr(u32 msr, u64 val) { - native_write_msr(msr, val); + native_wrmsrq(msr, val); } static __always_inline int write_msr_safe(u32 msr, u64 val) diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 505a85c3869e..bc572ca49a2c 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1085,7 +1085,7 @@ static u64 xen_do_read_msr(u32 msr, int *err) if (err) *err = native_read_msr_safe(msr, &val); else - val = native_read_msr(msr); + val = native_rdmsrq(msr); switch (msr) { case MSR_IA32_APICBASE: @@ -1144,7 +1144,7 @@ static void xen_do_write_msr(u32 msr, u64 val, int *err) if (err) *err = native_write_msr_safe(msr, val); else - native_write_msr(msr, val); + native_wrmsrq(msr, val); } } -- 2.54.0