Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1509727ybk; Thu, 14 May 2020 10:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEStW7W8irSoHmV0G9DcTROM2/EPNH+z/jfiBCZisnotMMJr4Jh1+OgDYaFjrRqiD0O7ul X-Received: by 2002:a17:907:2054:: with SMTP id pg20mr4701815ejb.127.1589478055916; Thu, 14 May 2020 10:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589478055; cv=none; d=google.com; s=arc-20160816; b=jKBJrg3fJmKge2M7ajyx0ImLzEEX01vCb8qQ5YvvSPiRuO2NnIp7O+PXgo0aFSkSfB qwg9Uwz6yTZU5RnWMMPhqQtoiPHBwgtHJYqwv7F2XYOjAY2uRWSqPSoDmmYBo77aq6uC szyCdKNLTIwy0Dmx8i2w9qtcX8nzAQQMz+5TwGs7RIkiDhH2wfoxDBacie+NtjMA/FN9 6fTUxrU9Bmng+W4vHhtEJSByTehqNcVtZw4tvv/vA9Il/40OHXQ49XmDX17nK+ERCspy RwSv38b2MZKcn1hOSgQAKffPnq5Dx1RBGbSjGGdluUpJopoHLcUVrSQclSARv5QLFAUF E8Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=7ALD1o+C/byl3FaCA42NVaT7ChrQmJrlRB/GBi5BaRc=; b=S/7qd564fBV16tFF5aFf2Jly7EqLZof/dd7sYhXAKolyUip3HprzB3knko//052vrP 94tdMTrF4pWpvbH6PNrKzyOHYxiN5SyIH99yvAGWmiHASOzDJNCtlPVmYs6PNc7o9x80 NCb5qhqLrO5JBir30JMNwJZPrUp/KHnH4MdvEhO4XSMZDlnpW585ndPABHhYLXESz9jo noP4cfORZGoXt6aa9WUWYW8AEOvzm1qWvLnXSTZVFrzhc+P3f8MVazbzuqbWooJ5WtdD zCFNhaosFSCwZ0tPPxv3uFk1olntiUWfvCoKLM6ImQjfyN1xaRTnu5qkQvHSkJV1NBVV a9fw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si292780eds.258.2020.05.14.10.40.30; Thu, 14 May 2020 10:40:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726067AbgENRjF (ORCPT + 99 others); Thu, 14 May 2020 13:39:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726032AbgENRjE (ORCPT ); Thu, 14 May 2020 13:39:04 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B0DEC061A0C for ; Thu, 14 May 2020 10:39:04 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jZHob-0004fZ-Mj; Thu, 14 May 2020 19:38:37 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 1415C1004CE; Thu, 14 May 2020 19:38:37 +0200 (CEST) From: Thomas Gleixner To: Mathieu Desnoyers Cc: 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 Subject: Re: [patch V4 part 1 29/36] x86/mce: Send #MC singal from task work In-Reply-To: <409359846.20366.1589413337072.JavaMail.zimbra@efficios.com> References: <20200505131602.633487962@linutronix.de> <20200505134100.957390899@linutronix.de> <409359846.20366.1589413337072.JavaMail.zimbra@efficios.com> Date: Thu, 14 May 2020 19:38:37 +0200 Message-ID: <87y2puxvqa.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Desnoyers writes: > ----- On May 5, 2020, at 9:16 AM, Thomas Gleixner tglx@linutronix.de wrote: > >> From: Peter Zijlstra >> > > Patch title: singal -> signal. > >> Convert #MC over to using task_work_add(); it will run the same code >> slightly later, on the return to user path of the same exception. > > So I suspect that switching the order between tracehook_notify_resume() > (which ends up calling task_work_run()) and do_signal() done by an > earlier patch in this series intends to ensure the information about the > instruction pointer causing the #MC is not overwritten by do_signal() > (but I'm just guessing). No, it does not. See the ordering discussion. Aside of that signal never transported any address information. It uses force_sig(SIGBUS). Even if a different signal would be sent first then the register frame of the #MC is still there when the fatal signal is sent later. But even w/o changing the ordering the taskwork check in do_signal() runs the pending work before delivering anything. Thanks, tglx