Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4419559imm; Mon, 18 Jun 2018 14:49:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIwpbl4I6OckKDDXw16ybLN/Ioo/JbLuyqMpyFY4UciCaYGi98LkJPUmQNNsu1DXR0XuaAn X-Received: by 2002:a62:a0c:: with SMTP id s12-v6mr15366829pfi.33.1529358576272; Mon, 18 Jun 2018 14:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529358576; cv=none; d=google.com; s=arc-20160816; b=Rt1BZ4NVTwlCOkGCxPo4TXlf3nyGP/cEzwKYqhI2frEAfG3IxhtSbjB2gq2XnwzM5a VaxI/xLGd5jgsMWZwvkYlrKD2n/P1TVCzi6H+akNQAfUkbAywry1OpyLcZupLBu76R40 +OydQzeOtcZTP+vrif/6u6lWZRBfJEFJ1hqm1R7tNj2Gzw5T72XR//uj0Cr4H1qZmcL2 LWPPb0qjGMgSZKpDMWijOXsJK6yJ/9utcLx/IVeySJVSo0Nzpn63r+3RWR7ZOout1UG4 aG3EzpTS2Cb6x2GLjZIi4I0HQWF9OccOhQMCPIT9R/KCnWyjjgr3zWgFepTBLTOBTXuJ fGhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=cOLicwBQzMoA6cKSRNjh3C45t2I5iKjgzsHy7Imet2s=; b=HmSt7nqS+JxguuQZFns2LWaKWbxTzArSlrxxrBv09V1VWJ2e7Fw96tEOa3Fc6I3r4G XVZz9FK5x59oSxJquEbGwKUxkbhV2fiROY+FfAZduv/XF2ULci0SpEncOHyAknhZ/OA7 wBoqnelMBc/pv7jrWz51rQUQqt6zwIGhGh6NSPOJU7PiPw2zeIS2a/bSZSbEh95tm9EN NpdLE66ik/GIC1ysbSQrVyTWLdNHaWO6FFLjy/LkBeh6gH5tx9taCFGPunDO5GbJ6+rl KD1HePVCXH4cfVtVkIl923k1NKBmRW4D9RDnguYuVst/exCE8djz9R0SQ5uqhqsDcAh4 4lmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G2UKpQ3k; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69-v6si12726443pgd.499.2018.06.18.14.49.22; Mon, 18 Jun 2018 14:49:36 -0700 (PDT) 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=@kernel.org header.s=default header.b=G2UKpQ3k; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936376AbeFRVrU (ORCPT + 99 others); Mon, 18 Jun 2018 17:47:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:40750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755347AbeFRVrS (ORCPT ); Mon, 18 Jun 2018 17:47:18 -0400 Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13B4020852 for ; Mon, 18 Jun 2018 21:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529358438; bh=MCS0vo9fUt2JrQLC8B4aN1g9EmGSfbG/GbNOGDPWcwc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=G2UKpQ3k61BvYEuD807vxFB5iY0le9YKLF+XSy+5guGqqGG0ev2cU3hNuHyhKRESx oUlokqL1ZkrFM456yW4OH10OX1IPbvzAaODg3NuCi8p5YDm3xy/bEwfFn6/EYzZYb5 ZkRbpdRNVDeGS7yuqpX+JHYRTVLKMsECz1avHqrE= Received: by mail-wm0-f49.google.com with SMTP id r15-v6so16492399wmc.1 for ; Mon, 18 Jun 2018 14:47:18 -0700 (PDT) X-Gm-Message-State: APt69E22yZX+fBUedlnG3ETPJcJrs+s94U+8xlB1Bzui/6tomNGIEKEM w3vdIKBStIiQV534kNolMqNb/t/Hi5GV53DOfDX7OA== X-Received: by 2002:a1c:b947:: with SMTP id j68-v6mr9330493wmf.144.1529358436552; Mon, 18 Jun 2018 14:47:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andy Lutomirski Date: Mon, 18 Jun 2018 14:47:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86: Call fixup_exception() before notify_die() in math_error() To: Siarhei.Liakh@concurrent-rt.com Cc: LKML , X86 ML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Lutomirski , Borislav Petkov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 14, 2018 at 10:10 PM Siarhei Liakh wrote: > > fpu__drop() has an explicit fwait which under some conditions can trigger > a fixable FPU exception while in kernel. Thus, we should attempt to fixup > the exception first, and only call notify_die() if the fixup failed just > like in do_general_protection(). The original call sequence incorrectly > triggers KDB entry on debug kernels under particular FPU-intensive > workloads. This issue had been privately observed, fixed, and tested > on 4.9.98, while this patch brings the fix to the upstream. Reviewed-by: Andy Lutomirski With the caveat that you are perpetuating what is arguably a bug in some of the other entries: math_error() can now be called with IRQs off and return with IRQs on. If we actually start asserting good behavior in the entry code, we'll need to fix this. --Andy