Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1737961imu; Wed, 28 Nov 2018 14:22:08 -0800 (PST) X-Google-Smtp-Source: AJdET5c5KaYn5cR7XXA3IzqI30Rqa6gIF3EkWkJauU8tQ5sFutTWRFc8SgD+UtNauHS5vd/alMFc X-Received: by 2002:a63:e247:: with SMTP id y7mr33264482pgj.84.1543443728682; Wed, 28 Nov 2018 14:22:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443728; cv=none; d=google.com; s=arc-20160816; b=MMKRvMVHkbO12MhJFVsH+awfWam+XkjrxntrzytkHLYxz23KrPqmqiZX2BNKRYHth0 DB23hg/yOBv8aHRueNE2DRl9H1oMlTLtOyQhLnPwNko3tW8aO/pXLamOfh4XAg67kgjA NN/y2/wBOQ0wwK5F8so54poh5lsOhiS2geFYgFlBdXNxVjCzJrtiLKGJQybpnna5ZS7O 5TdMsDqd1M35a6kx1NX7mW0agtVHKQgtGlzh9EMHTR7hDZ/NzmU14ayrlq/mPvZ3pC0d ZBQhPuQHoq/tWgrspN5EtA8JLGjPtWrtwM9W/WZPuHd15uzPIq28L12TfgAoo277dEqd 5F8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5C3e/Eph9aWYOrmeeTD0UZp0oBjxmVPWoBXR3wjVPAE=; b=VeRBBp8gvLu4WfnfKWyBQ2/z/t39z+7SFzxqYUdtxew89uAWQ0GJFdeWxo/aI9VZup pvxWzKq49t72H5h8a7FVnNMqTd2xnEDjDpo7N2EqIUC1PWaI79eAEsaHJN1o7iFLow7v ksjEBAdd2k89REjfWhiYfAhqdOQal79IAhCQM2Z7IkCvEkN2HSY5ZA5okJ7yoqcL4ZvS Or6a9Q30KxCaNwJb/aeHR1eLVuEbceI7DR5YnXOVYqzajjrUtygzGBDPvHSl+SPRuI/s DtqT6vzp1boP2Y5xzedmFOFFY7nEUOIK9Ophf4upS0a+F3Dax/6/ZsA7+t7KyfPfcMYE 0pGQ== 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 28si8812488pgw.364.2018.11.28.14.21.53; Wed, 28 Nov 2018 14:22:08 -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 S1726766AbeK2JYJ (ORCPT + 99 others); Thu, 29 Nov 2018 04:24:09 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33058 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbeK2JYI (ORCPT ); Thu, 29 Nov 2018 04:24:08 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gS8CW-0001GX-0M; Wed, 28 Nov 2018 23:20:56 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Andy Lutomirski , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Dave Hansen , Sebastian Andrzej Siewior Subject: [PATCH 05/29] x86/fpu: add might_fault() to user_insn() Date: Wed, 28 Nov 2018 23:20:11 +0100 Message-Id: <20181128222035.2996-6-bigeasy@linutronix.de> X-Mailer: git-send-email 2.20.0.rc1 In-Reply-To: <20181128222035.2996-1-bigeasy@linutronix.de> References: <20181128222035.2996-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/include/asm/fpu/internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 69dcdf195b611..978a1633c0698 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -106,6 +106,7 @@ 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" \ -- 2.20.0.rc1