From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 C45B3375F7B for ; Mon, 8 Jun 2026 05:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780895918; cv=none; b=rrQC2u0r5OBG9ldfjFA1CSXJl6oZNsIIWTS7UcunegyAh0fmRIp0VB44N6YBDiIwSwF50npxzuLbCpZOXNxEgJ9iRxhQPHtpS5xuOtwbggFm7HRAvaAXnBfFowLmve3itZodeuM53iGsuIZNfyLH9LdeThGU2CdBqc3o9wvuDZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780895918; c=relaxed/simple; bh=B/KcIFMWrdhg/VB03gRlPpGo0B9gJX566roIN1KeooE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bSlBmL/kkO16OY7rJuVbI4v7+5ucdYsiVzD7SX2FFhu9erkpIxIYss/ZLqUbpV8UxImxK0J/mnervSfm3AXPGJY5r8U+rRqh6qBBVc8Hh9mByVciITxvdvXNe1LRS2cDgi3D9TKa/PyxqbUJ0t14LecNF8TGnMXpzN1u/KHxaiY= 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; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=XIH2OMhW; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=XIH2OMhW; arc=none smtp.client-ip=195.135.223.130 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="XIH2OMhW"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="XIH2OMhW" 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-out1.suse.de (Postfix) with ESMTPS id D283F6B5CC; Mon, 8 Jun 2026 05:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1780895914; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KCUBy3GSzsd5t54nnTpSFQDrLqsOyT/rv5ybXn7sIwQ=; b=XIH2OMhWCjEvG2d/r7uHKjniyuUpONPeyGcWjMJcxVsX739VZFoR3wVW37JSaalBuvoqiF igmt0KfyiZXlNEkHGD+9hOoo0V1F0jII18gcHsQ1xFXpaXumg0nRdDjbKmCuOdHGUI+nyo HLCrgjo+sPEoH8ikbbfRcgarE+Jpau0= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=XIH2OMhW DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1780895914; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KCUBy3GSzsd5t54nnTpSFQDrLqsOyT/rv5ybXn7sIwQ=; b=XIH2OMhWCjEvG2d/r7uHKjniyuUpONPeyGcWjMJcxVsX739VZFoR3wVW37JSaalBuvoqiF igmt0KfyiZXlNEkHGD+9hOoo0V1F0jII18gcHsQ1xFXpaXumg0nRdDjbKmCuOdHGUI+nyo HLCrgjo+sPEoH8ikbbfRcgarE+Jpau0= 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 A02AA779A7; Mon, 8 Jun 2026 05:18:34 +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 EFnuJapQJmqudQAAD6G6ig (envelope-from ); Mon, 08 Jun 2026 05:18:34 +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" Subject: [PATCH v3 09/11] x86/msr: Remove rdmsr_safe_on_cpu() Date: Mon, 8 Jun 2026 07:17:39 +0200 Message-ID: <20260608051741.3207435-10-jgross@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260608051741.3207435-1-jgross@suse.com> References: <20260608051741.3207435-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-Spam-Flag: NO X-Rspamd-Action: no action X-Spam-Level: X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.com:+]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; R_RATELIMIT(0.00)[to_ip_from(RLkdkdrsxe9hqhhs5ask8616i6)]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid,intel.com:email] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: D283F6B5CC X-Spam-Score: -3.01 rdmsr_safe_on_cpu() has no users left. Delete it. Signed-off-by: Juergen Gross Reviewed-by: Dave Hansen --- V2: - delete rdmsr_safe_on_cpu() instead of rdmsrq_safe_on_cpu() (Ingo Molnar) --- arch/x86/include/asm/msr.h | 6 ------ arch/x86/lib/msr-smp.c | 24 ------------------------ 2 files changed, 30 deletions(-) diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 0205643c1ece..b0bf1a761a40 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h @@ -260,7 +260,6 @@ int rdmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 *q); int wrmsrq_on_cpu(unsigned int cpu, u32 msr_no, u64 q); void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *msrs); void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr __percpu *msrs); -int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); int rdmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q); int wrmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 q); @@ -287,11 +286,6 @@ static inline void wrmsr_on_cpus(const struct cpumask *m, u32 msr_no, { wrmsrq_on_cpu(0, msr_no, raw_cpu_read(msrs->q)); } -static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, - u32 *l, u32 *h) -{ - return rdmsr_safe(msr_no, l, h); -} static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) { return wrmsr_safe(msr_no, l, h); diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c index f3c75b681603..f58e0bab0be0 100644 --- a/arch/x86/lib/msr-smp.c +++ b/arch/x86/lib/msr-smp.c @@ -132,30 +132,6 @@ static void __wrmsr_safe_on_cpu(void *info) rv->err = wrmsr_safe(rv->msr_no, rv->reg.l, rv->reg.h); } -int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) -{ - struct msr_info_completion rv; - call_single_data_t csd; - int err; - - INIT_CSD(&csd, __rdmsr_safe_on_cpu, &rv); - - memset(&rv, 0, sizeof(rv)); - init_completion(&rv.done); - rv.msr.msr_no = msr_no; - - err = smp_call_function_single_async(cpu, &csd); - if (!err) { - wait_for_completion(&rv.done); - err = rv.msr.err; - } - *l = rv.msr.reg.l; - *h = rv.msr.reg.h; - - return err; -} -EXPORT_SYMBOL(rdmsr_safe_on_cpu); - int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) { int err; -- 2.54.0