Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7446283imu; Mon, 3 Dec 2018 13:05:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VMTQDJ8IRnlrjPtauDFnygWgxFAiFMmj0gH0NlEDIpyaXAwEk2eH3uVpPmUc/7fUP9mt5F X-Received: by 2002:a17:902:28aa:: with SMTP id f39mr16054061plb.297.1543871129363; Mon, 03 Dec 2018 13:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543871129; cv=none; d=google.com; s=arc-20160816; b=Ua6fOl+G1Yub+kFAjsEjy8JZ5Oi2O2ESF0R0nzv7ig1wLzwXQqHXlDK8QhKBRrHcxl JtU6ix33cFX+p/VcBm/EjD2Ux9AL3YC0D1QO/IjguBFMz3eilmsZp5+ZlfeUz1sMZVcL sRFRLP+IXq7MhxcszmekcPfjBmx1mHSl8D9HBajwrB7sBHtM6Bz5reSIrJtYK1/A5cpm 5sGBFk34aluRRLZ0wFnsmskE0liQDqplzh5/Aw8SJBLvnhOgFhG4iiI6AJHx7YEDawxW LLO2qOmQ6zhjGQfv07BjB9f2BfgnFGcZLBhQb3ZH+ephQflAP6ppaUQS1Yl9zZrUaQvQ 2GxA== 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; bh=8WvxSZ4HffiFgs8aSBq/Sgab42FuauDIvG1Lrf/AvGo=; b=kR6jLBbJAJ8rj4J8Ga/OkAwCeggXCRVVv8HYJZiq93s1Fsa0+cZkvS7gN9ygYeEQ2O URdZ1kbIUhdmZrBOfBftGVpqE1qj2GjFh7TKOkTsLWYMiipItbL4JgpmmlCqo6YS1Rib 53UmvQaA4lNyf5JJuBfcbSRhSx8/UidWG+homiDCr6vWEU19blAIs+NZEUpHRk2395Fr m1GR5QelNijSzHZ+/ksnb/oFF6uom1ronCh01Z4t5htHbe7IsbcNrdTmocFoS8/CBiDo rDdgMdUWIVXZqpupjirEA+/xwNaJDGiDZ4lDDsUFt1hP3HoB6cgv4ybC3hewoU/HQhLu txGQ== 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 p5si13172343pga.352.2018.12.03.13.05.13; Mon, 03 Dec 2018 13:05:29 -0800 (PST) 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 S1726089AbeLCVEf (ORCPT + 99 others); Mon, 3 Dec 2018 16:04:35 -0500 Received: from terminus.zytor.com ([198.137.202.136]:50411 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbeLCVEe (ORCPT ); Mon, 3 Dec 2018 16:04:34 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wB3L3Ea3594664 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 3 Dec 2018 13:03:14 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wB3L3E1C594661; Mon, 3 Dec 2018 13:03:14 -0800 Date: Mon, 3 Dec 2018 13:03:14 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Sebastian Andrzej Siewior Message-ID: Cc: jannh@google.com, hpa@zytor.com, bigeasy@linutronix.de, x86@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@redhat.com, bp@suse.de, riel@surriel.com, dave.hansen@linux.intel.com, mingo@kernel.org, Jason@zx2c4.com, rkrcmar@redhat.com, kvm@vger.kernel.org, luto@kernel.org, pbonzini@redhat.com Reply-To: jannh@google.com, hpa@zytor.com, bigeasy@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@suse.de, riel@surriel.com, dave.hansen@linux.intel.com, mingo@kernel.org, Jason@zx2c4.com, luto@kernel.org, rkrcmar@redhat.com, kvm@vger.kernel.org, pbonzini@redhat.com In-Reply-To: <20181128222035.2996-6-bigeasy@linutronix.de> References: <20181128222035.2996-6-bigeasy@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/fpu: Add might_fault() to user_insn() Git-Commit-ID: 6637401c35b2f327a35d27f44bda05e327f2f017 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=-0.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: 6637401c35b2f327a35d27f44bda05e327f2f017 Gitweb: https://git.kernel.org/tip/6637401c35b2f327a35d27f44bda05e327f2f017 Author: Sebastian Andrzej Siewior AuthorDate: Wed, 28 Nov 2018 23:20:11 +0100 Committer: Borislav Petkov CommitDate: Mon, 3 Dec 2018 19:15:32 +0100 x86/fpu: Add might_fault() to user_insn() Every user of user_insn() passes an user memory pointer to this macro. Add might_fault() to user_insn() so we can spot users which are using this macro in sections where page faulting is not allowed. [ bp: Space it out to make it more visible. ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Borislav Petkov Reviewed-by: Rik van Riel Cc: "H. Peter Anvin" Cc: "Jason A. Donenfeld" Cc: Andy Lutomirski Cc: Dave Hansen Cc: Ingo Molnar Cc: Jann Horn Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: kvm ML Cc: x86-ml Link: https://lkml.kernel.org/r/20181128222035.2996-6-bigeasy@linutronix.de --- arch/x86/include/asm/fpu/internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 69dcdf195b61..fa2c93cb42a2 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -106,6 +106,9 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu); #define user_insn(insn, output, input...) \ ({ \ int err; \ + \ + might_fault(); \ + \ asm volatile(ASM_STAC "\n" \ "1:" #insn "\n\t" \ "2: " ASM_CLAC "\n" \