Received: by 10.213.65.68 with SMTP id h4csp198266imn; Wed, 28 Mar 2018 01:39:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+SQBFPFmXDnyNdPGwiR7Lm9JLMV+3c8hqKkS7GNUC3qjj1zPXtAXfdsLbZhLVP2Hgk/Bpi X-Received: by 10.99.49.74 with SMTP id x71mr1899734pgx.160.1522226396290; Wed, 28 Mar 2018 01:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522226396; cv=none; d=google.com; s=arc-20160816; b=gE7f4uHW1ypUHRMpTB1BNSj3ZnelZRw6sa1NPJMAA1WmFuViL6k3BOCwC0mfEw4goR DjsMfY7DbQrY9t6gSBQY4qOnXqFa/ImA8VxbQRtSqOlZLHPg0aw1pOnigj3f94EPeCCp bB0SXo3rrK04efSiR4jknCSG+gazMewCY3NV8SKK4z0r9qlKwXf2GUfPL2uPh8XzPo4w NG+YTOPkhQzAbQ00icFq7AOy/WobGAOlug8I+uNKEiMdg2zyBL9Vfz47Mu+uIu1wXihg gs00yRAERkgu7LKy0U6FyBQDd4f6kimiubRDbMBF1dIf3UTzKp9QLDEWc2FJ5PN7Hz3O ryNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=B0vF2OykIYSOC3aqiAbCow0gO8vKYeMbDE9zyNSWf6M=; b=kaI0XSp3a22uqzMqIEw1Msxaelv7IvrPNfiNEz3BbIZ0H/mgYQhHbq1g0az0E6xK43 6PDO7ESOYzENJQQD3tQoFovqIe5bcnA7JdJuAOXyLuD0NYPhNUAXg9gbr6xh8hUWrISo G0BHiu1eAKdSZNfUiVL1GqaILbCqcKamki/HyvWJ5FNGjA33tE9fxjrtujv0CR1w+m2g PS9lXrazfk4IhuR3G9pei/7llnVUoJTDdVwUi0Vh95MjajcMPpgQ69/75QJ2ZO84N450 dNkMEoHviJFaS5fHlm7DZY6ccjdVsCqYxo2B/zSc1jO9tJ55zy/lBZAeF8rwUBNPWuR/ 8t6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si2119276pgv.10.2018.03.28.01.39.41; Wed, 28 Mar 2018 01:39:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540AbeC1Iit (ORCPT + 99 others); Wed, 28 Mar 2018 04:38:49 -0400 Received: from terminus.zytor.com ([198.137.202.136]:34623 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbeC1Iir (ORCPT ); Wed, 28 Mar 2018 04:38:47 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2S8c8nw989664; Wed, 28 Mar 2018 01:38:08 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2S8c6cX989661; Wed, 28 Mar 2018 01:38:06 -0700 Date: Wed, 28 Mar 2018 01:38:06 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Eric Dumazet Message-ID: Cc: mingo@kernel.org, fengguang.wu@intel.com, bp@alien8.de, linux-kernel@vger.kernel.org, hpa@zytor.com, edumazet@google.com, eric.dumazet@gmail.com, tglx@linutronix.de Reply-To: hpa@zytor.com, edumazet@google.com, tglx@linutronix.de, eric.dumazet@gmail.com, fengguang.wu@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, bp@alien8.de In-Reply-To: <20180328032233.153055-1-edumazet@google.com> References: <20180328032233.153055-1-edumazet@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cleanups] x86/msr: Make rdmsrl_safe_on_cpu() scheduling safe as well Git-Commit-ID: 9b9a51354cae933f5640b5bb73bbcd32f989122f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9b9a51354cae933f5640b5bb73bbcd32f989122f Gitweb: https://git.kernel.org/tip/9b9a51354cae933f5640b5bb73bbcd32f989122f Author: Eric Dumazet AuthorDate: Tue, 27 Mar 2018 20:22:33 -0700 Committer: Thomas Gleixner CommitDate: Wed, 28 Mar 2018 10:34:13 +0200 x86/msr: Make rdmsrl_safe_on_cpu() scheduling safe as well When changing rdmsr_safe_on_cpu() to schedule, it was missed that __rdmsr_safe_on_cpu() was also used by rdmsrl_safe_on_cpu() Make rdmsrl_safe_on_cpu() a wrapper instead of copy/pasting the code which was added for the completion handling. Fixes: 07cde313b2d2 ("x86/msr: Allow rdmsr_safe_on_cpu() to schedule") Reported-by: kbuild test robot Signed-off-by: Eric Dumazet Signed-off-by: Thomas Gleixner Cc: Borislav Petkov Cc: Eric Dumazet Cc: "H. Peter Anvin" Link: https://lkml.kernel.org/r/20180328032233.153055-1-edumazet@google.com --- arch/x86/lib/msr-smp.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c index 761ba062afda..fee8b9c0520c 100644 --- a/arch/x86/lib/msr-smp.c +++ b/arch/x86/lib/msr-smp.c @@ -225,16 +225,13 @@ EXPORT_SYMBOL(wrmsrl_safe_on_cpu); int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) { + u32 low, high; int err; - struct msr_info rv; - memset(&rv, 0, sizeof(rv)); + err = rdmsr_safe_on_cpu(cpu, msr_no, &low, &high); + *q = (u64)high << 32 | low; - rv.msr_no = msr_no; - err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1); - *q = rv.reg.q; - - return err ? err : rv.err; + return err; } EXPORT_SYMBOL(rdmsrl_safe_on_cpu);