Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1485529ybk; Thu, 14 May 2020 10:07:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVdP9qi1hNI8TJ4z65ULGqXsqwAQxHpNTqgjsjr4vx7Ie5/nmauItWPCBtyRITNAeEkARX X-Received: by 2002:a17:906:bb07:: with SMTP id jz7mr4631661ejb.317.1589476034742; Thu, 14 May 2020 10:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589476034; cv=none; d=google.com; s=arc-20160816; b=np67tGa2yx/LvTxD8+wjeWOnHsXkcg6R5X54AZ3B5DMkDZcCegW34eWQQGlzgg3DY9 t8C+YuWxgOuV93hhPBRsa/oSRPZUpoFWJQtK2R5hUq1FAWBPbCu5CIOGQ26HYPXpx/5C KtAdDh4CFEaG6gYkpSGGPwcj9KC9i2/YI+/twZof7nDjqPgD8wT9HH/2RDflyDzQCyAc uaXTOxnQbcarEp7uWFhK32n4l3QUioH187r9W57ggaCb5T2kvMvy7R1Te+YCH9JMlCbO n3eHIOPe58Rz8riBhC/8iZxMnVCLp0s1a/mPe1Et040xohEWjNLNyNp7j8OOb1gPOCvO gSMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=LQXqwpa3nj6Fc4ZCrj9+GEMOkkY0i7tuMwEgpzs19zc=; b=OqgB5+/1yoSd7E4E2Z9BVgd4xPj38baCrc4KULtSJouTFxoRkrZ4/Q2FswvLnu06su hSvGjCkKvvn8+SSH6P2Mu9p7i2bCj/egA7QQ4y20i4WavSQ4sc7k1DxPtJt6TLrIWODN Cir6xVIisTskm4Ml0WJh+uJqiX/wXgylbwTmnYgyE63xyQFYPEv9cjFcanJgEtHmX+ky 5r2ezdSCVNjVO+QGmqSnbpDldWutkZAnypTl/wCQk7lkcMEq4D2lmMrGRIP476OR/JVJ n8Vzo5xcepSUUCQf+VqujeI2iqhCtr2DzHSRa8OoSgAfklhux4YeqQSVBm68jRLMaoYj D+NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=pPgANI9y; 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=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si2110205ejh.334.2020.05.14.10.06.51; Thu, 14 May 2020 10:07:14 -0700 (PDT) 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=@efficios.com header.s=default header.b=pPgANI9y; 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=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbgENRFF (ORCPT + 99 others); Thu, 14 May 2020 13:05:05 -0400 Received: from mail.efficios.com ([167.114.26.124]:54186 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgENRFF (ORCPT ); Thu, 14 May 2020 13:05:05 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 336062A6EC1; Thu, 14 May 2020 13:05:04 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YUwEbBenprlJ; Thu, 14 May 2020 13:05:03 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id CF9832A6A79; Thu, 14 May 2020 13:05:03 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com CF9832A6A79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1589475903; bh=LQXqwpa3nj6Fc4ZCrj9+GEMOkkY0i7tuMwEgpzs19zc=; h=Date:From:To:Message-ID:MIME-Version; b=pPgANI9yCeAOJbolI55NgwdCwA2Z46JYDTqrFyr2093oVkWPi/JniF8Lkd1QymGmD r4JYCA34Jx8u/EY/1pGwDzU7TcgsP0dZKzpnunr7HLwsR4P3A9oZdbUETPAL0nPZ4l zwhSHWfwOwGYFGSBIF2A0r+r8Y2MtjrUY7Z1QGoDJmgtgwyqvR5/XUhLvfOflIo2n2 jd9aoPOCZKnHUYjGvtxKVe+HNFBdP2NcWtk+nOfyLwjVplzdtaPn3W6+hiBrO+5ZZg FpgcSd4Xtfy6K7PYJ0MMVmMTtPJFCks0GKQk6u+tcwVlcK4POp0Rb7Rw5tYZA6c1uy 0V/g+LfgXRq1g== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C-79SLDiHFAQ; Thu, 14 May 2020 13:05:03 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id BBAEC2A7103; Thu, 14 May 2020 13:05:03 -0400 (EDT) Date: Thu, 14 May 2020 13:05:03 -0400 (EDT) From: Mathieu Desnoyers To: Borislav Petkov Cc: Thomas Gleixner , linux-kernel , x86 , paulmck , Andy Lutomirski , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , rostedt , "Joel Fernandes, Google" , Boris Ostrovsky , Juergen Gross , Brian Gerst , Josh Poimboeuf , Will Deacon , Peter Zijlstra , Tony Luck Message-ID: <981919093.21263.1589475903673.JavaMail.zimbra@efficios.com> In-Reply-To: <20200514163947.GF9266@zn.tnic> References: <20200505131602.633487962@linutronix.de> <20200505134100.957390899@linutronix.de> <20200514141703.GD9266@zn.tnic> <1278452779.21179.1589472210183.JavaMail.zimbra@efficios.com> <20200514163947.GF9266@zn.tnic> Subject: Re: [patch V4 part 1 29/36] x86/mce: Send #MC singal from task work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3928 (ZimbraWebClient - FF76 (Linux)/8.8.15_GA_3928) Thread-Topic: x86/mce: Send #MC singal from task work Thread-Index: HgI41vOZKsWdU0dWCWo+PNlydfISwg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On May 14, 2020, at 12:39 PM, Borislav Petkov bp@alien8.de wrote: > On Thu, May 14, 2020 at 12:03:30PM -0400, Mathieu Desnoyers wrote: >> - #MC triggered, queuing task work, >> - unrelated signal happens to be delivered to task, >> - exit to usermode loop handles do_signal first, >> - then it runs task work. > > How can that even happen? > > exit_to_usermode_loop->do_signal->get_signal and that does: > > if (unlikely(current->task_works)) > task_work_run(); > > at the top. > > So the task work will always run before the signal handler. OK yes, nevermind. I focused on its invocation from tracehook_notify_resume and missed this invocation in do_signal. My bad. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com