Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp812846ybv; Wed, 19 Feb 2020 09:43:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwPLlb4lqIKm5w5+lHxRt7ftm/flocieaWZecc6aB9I8ghRkpX7Nwg4BD8ZpzZsAdv9DVnH X-Received: by 2002:a9d:63d6:: with SMTP id e22mr20785206otl.185.1582134224221; Wed, 19 Feb 2020 09:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582134224; cv=none; d=google.com; s=arc-20160816; b=JU7yIJ5CUTMEBluSQ82SU9OUTpC4prbmMg7DS0ScnSrbR7DHeXMfnCR19hMEeq4NNK L09Rh685K46KWDpyn/b29/+GsSy1J3c9iJuURB9q8LKs8OpG5XYr9mYdC57OM/CXWoAt lTFheIsqmmC06yIlqjUj06A5O6UghKPIrNOiLFZEgAEbxovMhSu2uOWniFExrWCl7Nrb PhzM7RuNW14zCnCQxtGkvBOHkYusT0/P0/wETnsPSQeXqUsoQ49qRK84FSwARtjK6Sqm yNb+5k+Mw5zxiQtQuLzbWfH/91XL42CNYUwIcc/Iv6m/iC7d7z99KFnVnVPyDBCYvOrt jA2g== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DpvCtMjqcX25XbMiHHt7/X8aEcXXE9Ghl88YlkXaLKo=; b=D2bt4sRtAR1MRlYUMe4cKQguBvdTwyAJ7aZQcVhoIPr0BsQZnOp8q/MODz90vFnEN1 8T0eCxPv6v0q8E3DeEJYGdHDYFtV+54QVqBWboQfvpKpRoRyb2XjYVnwGKsIwteU5HBd N95+NJzqppx4hR/syCraUIz8MBKVNZ1bCbFAa01ruWbH4hhSdXmfiKHZX+LD0bpHdlqx 5rQm5G6wLmHjuM5Qt11btTOp80wuIyz25GlcJ6vocVEVRNw8G7leRob46AiQb+3PDbkz RyiipeKYH9tuuhDO5KOaWu1Vd7xTmZ4Lr6PLqK0Dq6fY5PnuApTpEsPN3oZYPeooJ5WF xyng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=cZiQCPVU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si9323065oij.118.2020.02.19.09.43.32; Wed, 19 Feb 2020 09:43:44 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=cZiQCPVU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgBSRmc (ORCPT + 99 others); Wed, 19 Feb 2020 12:42:32 -0500 Received: from mail.skyhub.de ([5.9.137.197]:33670 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgBSRmc (ORCPT ); Wed, 19 Feb 2020 12:42:32 -0500 Received: from zn.tnic (p200300EC2F095500C57DC876B1A4488F.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:5500:c57d:c876:b1a4:488f]) (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 9FFFF1EC0591; Wed, 19 Feb 2020 18:42:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1582134150; 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=DpvCtMjqcX25XbMiHHt7/X8aEcXXE9Ghl88YlkXaLKo=; b=cZiQCPVUp+LrsSX1QyqrebwJk24EqpWZK+j7W+aJxC8JJ1UoTV5ioerAUuCl7iI1p2CQ/k vQfI+wh/l37W+kADEV+CXvgpbnqMlhoNanR//2X50YNLOLzAiWRVfAYKjTDtCHAKBs3tis Hmrq69Zv7llUJmARUzJoTwtkd6FarZk= Date: Wed, 19 Feb 2020 18:42:23 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: Peter Zijlstra , LKML , linux-arch , Steven Rostedt , Ingo Molnar , Joel Fernandes , Greg KH , gustavo@embeddedor.com, Thomas Gleixner , paulmck@kernel.org, Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Tony Luck , Frederic Weisbecker , Dan Carpenter , Masami Hiramatsu Subject: Re: [PATCH v3 02/22] x86,mce: Delete ist_begin_non_atomic() Message-ID: <20200219174223.GE30966@zn.tnic> References: <20200219144724.800607165@infradead.org> <20200219150744.488895196@infradead.org> <20200219171309.GC32346@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2020 at 09:21:48AM -0800, Andy Lutomirski wrote: > Unless there is a signal pending and the signal setup code is about to > hit the same failed memory. I suppose we can just treat cases like > this as "oh well, time to kill the whole system". > > But we should genuinely agree that we're okay with deferring this handling. Good catch! static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) { ... /* deal with pending signal delivery */ if (cached_flags & _TIF_SIGPENDING) do_signal(regs); if (cached_flags & _TIF_NOTIFY_RESUME) { clear_thread_flag(TIF_NOTIFY_RESUME); tracehook_notify_resume(regs); rseq_handle_notify_resume(NULL, regs); } Err, can we make task_work run before we handle signals? Or there's a reason it is run in this order? Comment over task_work_add() says: * This is like the signal handler which runs in kernel mode, but it doesn't * try to wake up the @task. which sounds to me like this should really run before the signal handlers... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette