Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3820974imu; Mon, 10 Dec 2018 08:19:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/UHruUVMMH6eLpyVe27SN3fT8vuEplLq8/WpLWKxyNdfEyCYzfcC/lLlnBplw/rEO8WbM0Y X-Received: by 2002:a63:9f19:: with SMTP id g25mr11380567pge.327.1544458781317; Mon, 10 Dec 2018 08:19:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544458781; cv=none; d=google.com; s=arc-20160816; b=z9zQ4eb8Y02koCDTpgkogDElETDUs3gA0k10XzM1a+N4lOWsfpxlZGrfIzS8cyNHHD sB+5GnkztAm1VWzEIusWgwUtJChck9V/Wu6vTcVmJfDZbFM2i9ywC6WcuRX37H7c0Zs5 m58HUtIc0JX0snaGdriL7X0L4kr7BhwT39K8gBx1DpFfNJ47Fu3v9TjL8kuhyEXiwGCo VfJESWn71FS32mIlJJqikqjSAfYF6b8+U6JvpDkvN/GJ7GJXI8W5UgKx91lldFZxCtPp D/54zkf/7xie41qUDbyGGZM65OLa9DmfO5K/yj5DIxuHdwz1joZFnpypfnv4bjFw4izk 5Vjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HR8XTrWUz+NU1wTjNulU1sT8TpsWohzXX+56KaMDLjk=; b=IcdYX0lvR3DZ9+sIjSkmN3fYH1yCWAN1cDLPj4G2rz3+N6UE6jHJ2KwT0+D7OWY1Iw 2QgK22CLIGpgXds8RBIqbj3fvsSnEtUSQfDQXhpBq4vUqwLNCUce29zTs1xNw6OY9Nbs p19IYUHZAzQ3AMYf3kNzXtSTJl8siO+gDEvYWVyGcSqPRyDoU/SRREvdupmD7s5VsWw3 as8Gb4f1snbGOTfSgESth2InbNKFSs4sHK4Do76vQXDihU0Ro5yHMvq5y908jhLINUfW eAcWZg5aPsPD//c6U+7a+UqLpyrcdPy+pB7HiG2SVTFH3L+y0uFVZcSjBmQ3XMuN0XZP eKxQ== 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 e9si10179319plt.330.2018.12.10.08.19.22; Mon, 10 Dec 2018 08:19:41 -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 S1728020AbeLJOmE convert rfc822-to-8bit (ORCPT + 99 others); Mon, 10 Dec 2018 09:42:04 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33479 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726888AbeLJOmE (ORCPT ); Mon, 10 Dec 2018 09:42:04 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1gWMkw-0005Vh-JX; Mon, 10 Dec 2018 15:41:58 +0100 Date: Mon, 10 Dec 2018 15:41:58 +0100 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Andy Lutomirski , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, "Jason A. Donenfeld" , Rik van Riel , Dave Hansen Subject: Re: [PATCH 29/29] x86/fpu: Defer FPU state load until return to userspace Message-ID: <20181210144158.46sbqy5b3lkhcra5@linutronix.de> References: <20181128222035.2996-1-bigeasy@linutronix.de> <20181128222035.2996-30-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20181128222035.2996-30-bigeasy@linutronix.de> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-11-28 23:20:35 [+0100], To linux-kernel@vger.kernel.org wrote: > --- a/arch/x86/kernel/fpu/signal.c > +++ b/arch/x86/kernel/fpu/signal.c > @@ -228,13 +228,12 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size) > struct task_struct *tsk = current; > struct fpu *fpu = &tsk->thread.fpu; > int state_size = fpu_kernel_xstate_size; > - union fpregs_state *state; > - void *tmp; > struct user_i387_ia32_struct env; > struct user_i387_ia32_struct *envp = NULL; > int ret = 0; > u64 xfeatures = 0; > int fx_only = 0; > + int err; > … > } else if (use_fxsr()) { > - ret = __copy_from_user(&state->fxsave, buf_fx, state_size); > - if (ret) > + ret = __copy_from_user(&fpu->state.fxsave, buf_fx, state_size); > + if (ret) { > + err = -EFAULT; > goto err_out; > + } After reworking the series after addressing the comments for 08/29 I noticed that `err' should have been `ret'. Sebastian