Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp532812pxb; Wed, 3 Feb 2021 10:58:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpE6nrYMUTZKxriluh0HwzcpMr69VENaYWhSc2GuI/tj+/BUgH+BwEYqNw+02GF4K8muS5 X-Received: by 2002:a17:906:38c3:: with SMTP id r3mr4703564ejd.193.1612378709865; Wed, 03 Feb 2021 10:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612378709; cv=none; d=google.com; s=arc-20160816; b=yZEhp6khUPlnJAZQ4GbM6js9cGvXYIVP6UDFo/kHO0/6nCr5IxGo/i2I4o38atHsOx KN5aT3ENaAMGFtXzkxtQB2pp4aGMwjSpVSEaCHXfwPKx/bqsTkGVWi1vf56NKWpLK5uj BuAEwaiXbyImllXo0hJQp/nCGBB8UL1dq+uoR+RNxFmTHtvCLTV63ohpsGr0cCuFiFSe xKKwlxOomxxC9EXvkg5H/U3mTD0BkAIww/OV0peoi8XDM5wDbNMyLVlk1osL4uk//yyO gvYUl04NqJLxfVRPimOo4WzWICM/RaTLEABgF4vP4bI+DZkKGg9vDzdq2Zgof1Ut+KHR 5Y6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K8nOFh6JLe/Vzhm200Cg+IJZ6YmWcAnqNRvjfWkQIzQ=; b=vmtSCRtYZXrlZcXBrz+jXCNQW9roa4//8C9S1a1cg6Y1jgzNo/M3vJBMV9GeIa3sN2 Y+O1fjksdTkQo/jGykU20PtgC2m4HCAnIwgONCscanujuyPApSTcNrFkd4OnX6jZEFws lW2LcRpJVllBYeBnkHNUaKNF8Ldyq7GVjPGEFXpai2ZXPgmWPyfpD8bio6ZmBoW+XMcV RkFLt6ZiJbyEPW4dW+MKidaF4sRTvsDaZF5TYva86r9X0Dy2mm/Tkmcuh4pdLX7zBiUo we4gAfz6ZbANJP1smw4Iebt5En32ZfJBs+c3eom1N+pdZUcHEa19/AFusgc6L4Lxhsqg K9Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=gkaMfCMl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si1846203edw.252.2021.02.03.10.58.04; Wed, 03 Feb 2021 10:58:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=gkaMfCMl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231514AbhBCS5P (ORCPT + 99 others); Wed, 3 Feb 2021 13:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbhBCS5J (ORCPT ); Wed, 3 Feb 2021 13:57:09 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65D4C0613D6 for ; Wed, 3 Feb 2021 10:56:29 -0800 (PST) Received: from zn.tnic (p200300ec2f0c84009b5670f942e9d280.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:8400:9b56:70f9:42e9:d280]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6055B1EC04BF; Wed, 3 Feb 2021 19:56:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1612378588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=K8nOFh6JLe/Vzhm200Cg+IJZ6YmWcAnqNRvjfWkQIzQ=; b=gkaMfCMlEu1dP1MvbpwbjAB/U+aYwSg6kCiZjmG+oaS8kgTiR1lInlaRVXGTAfntzYWyv4 1PsqF6ShTpOOyVvhHqlx9pNxadXZM3UK+/sXPorMPT5qbx3H8zvgUrfkndWOOmWaRkD5o7 uwbLuFJdX0rjRewfUawE3r8x8R8CZ8w= Date: Wed, 3 Feb 2021 19:56:25 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: x86@kernel.org, LKML , Dave Hansen , Alexei Starovoitov , Daniel Borkmann , Yonghong Song , Masami Hiramatsu , Peter Zijlstra Subject: Re: [PATCH 07/11] x86/fault: Split the OOPS code out from no_context() Message-ID: <20210203185517.GH13819@zn.tnic> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 31, 2021 at 09:24:38AM -0800, Andy Lutomirski wrote: > Not all callers of no_context() want to run exception fixups. > Separate the OOPS code out from the fixup code in no_context(). > > Cc: Dave Hansen > Cc: Peter Zijlstra > Signed-off-by: Andy Lutomirski > --- > arch/x86/mm/fault.c | 116 +++++++++++++++++++++++--------------------- > 1 file changed, 62 insertions(+), 54 deletions(-) > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > index 1939e546beae..6f43d080e1e8 100644 > --- a/arch/x86/mm/fault.c > +++ b/arch/x86/mm/fault.c > @@ -618,53 +618,20 @@ static void set_signal_archinfo(unsigned long address, > } > > static noinline void > -no_context(struct pt_regs *regs, unsigned long error_code, > - unsigned long address, int signal, int si_code) > +page_fault_oops(struct pt_regs *regs, unsigned long error_code, Not sure about this name - it still tries to recover: efi_recover_from_page_fault(). Judging by where it is called, maybe no_context_tail() or no_context_oops() or no_context_finish_me_already()... Yah, I haz no better idea. :-\ ... > @@ -739,6 +692,61 @@ no_context(struct pt_regs *regs, unsigned long error_code, > oops_end(flags, regs, sig); > } > > +static noinline void > +no_context(struct pt_regs *regs, unsigned long error_code, > + unsigned long address, int signal, int si_code) > +{ > + if (user_mode(regs)) { > + /* > + * This is an implicit supervisor-mode access from user > + * mode. Bypass all the kernel-mode recovery code and just > + * OOPS. > + */ > + goto oops; Just do return page_fault_oops(...); here and get rid of the label. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette