Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1740057imu; Wed, 28 Nov 2018 14:24:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/V1O+vCZEUqMtG4RbJ7TwRg22Nq+msNcVl6di6ZtFBg/BlXXUqhvSKPr9EqqPrg06xEMODO X-Received: by 2002:a17:902:b40d:: with SMTP id x13mr28563554plr.237.1543443888752; Wed, 28 Nov 2018 14:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543443888; cv=none; d=google.com; s=arc-20160816; b=Le/7ZjldhAPnjxTU6tbar8ps5eBIxEz541hvWOjmZfQ3lXCXIrq1F+u5y/w+zEC5Pg dwKdNGZQpECqva1C9m7kI23FPo3bT3t9nYmc3gPhphWTL0SY+xgWdZ2v3wquBneFJDIC opaw8uzekscqNPMOtzmgGSxMY2/I6RRqWtPs/kxoGNBG+1T7N8TVSpDMD7hnIA1BDPNu RNWGzhmrRyILHflGkRQ4JB1s4bKhc4ih2Dy5rqQ9ZqAt+K7Rszv/4I/RDQJFprykkjTP fz+bU+iaWfNPFW3JQOCs0ontUP/uClsA9qq6e3ybcFgshyLylu3W5JqENS43Z1kIcT0Y rkOg== 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=x5OW/2My4J5Xl6+kZhWHNhhc6knCiHAhTnw3QecFJgk=; b=WYmnDIi6nUTn1EkBpdDObOa6G6yK0mP4jxML2fDVi2+cuvRlSOnweeDJ4/RG0Mcty+ 3wmySMzciXQVeI8mMrG4DpNzHMLZPD8RQw9gi3Iep447pBtshWnJ8C05giCpujNgOudl djQtIddaml2nK/LYGMQtl5Q1VVrdv9v7HOayg0aqXBZSBDQ50yI8HV4FqzG/nnlTuZIR oWxtFvJGAOPbhP0JKRNFlMsHhnl41AtCONmvKJlCuQe+SevHJ7vlmzluX1Dp2NgTpH15 CK32AutAh02cYMlUt0irc0akAlwnmMQ49eKA10f5FpfusjeRUdojUX4sHLm821Z7i3bD IhhA== 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 u3si8057067pgj.300.2018.11.28.14.24.34; Wed, 28 Nov 2018 14:24:48 -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 S1727233AbeK2JYh (ORCPT + 99 others); Thu, 29 Nov 2018 04:24:37 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33200 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727181AbeK2JYg (ORCPT ); Thu, 29 Nov 2018 04:24:36 -0500 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gS8Cu-0001GX-Ay; Wed, 28 Nov 2018 23:21:20 +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 22/29] x86/entry: Add TIF_NEED_FPU_LOAD Date: Wed, 28 Nov 2018 23:20:28 +0100 Message-Id: <20181128222035.2996-23-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 Add TIF_NEED_FPU_LOAD. This is reserved for loading the FPU registers before returning to userland. This flag must not be set for systems without a FPU. If this flag is cleared, the CPU's FPU register hold the current content of current()'s FPU register. The in-memory copy (union fpregs_state) is not valid. If this flag is set, then all of CPU's FPU register may hold a random value (except for PKRU) and it is required to load the content of the FPU register on return to userland. It is introduced now, so we can add code handling it now before adding the main feature. Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index cd6920674b905..1e64222030612 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -83,6 +83,7 @@ struct thread_info { #define TIF_SYSCALL_EMU 6 /* syscall emulation active */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SECCOMP 8 /* secure computing */ +#define TIF_NEED_FPU_LOAD 10 /* load FPU on return to userspace */ #define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */ #define TIF_UPROBE 12 /* breakpointed or singlestepping */ #define TIF_PATCH_PENDING 13 /* pending live patching update */ @@ -110,6 +111,7 @@ struct thread_info { #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) +#define _TIF_NEED_FPU_LOAD (1 << TIF_NEED_FPU_LOAD) #define _TIF_USER_RETURN_NOTIFY (1 << TIF_USER_RETURN_NOTIFY) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_PATCH_PENDING (1 << TIF_PATCH_PENDING) -- 2.20.0.rc1