Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5311210imm; Tue, 19 Jun 2018 08:24:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIGVsDvFYk5vWaiZ7Lh+gMF6pktvuSUKN4hlEhZAvBleKH1/U50js7BIniBU4CgNDgPe0FY X-Received: by 2002:a62:904c:: with SMTP id a73-v6mr18606413pfe.145.1529421853781; Tue, 19 Jun 2018 08:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529421853; cv=none; d=google.com; s=arc-20160816; b=0D96vbwhvygbd0nDOspl3NjxKXAHgVz2wKNznbwYDWTpZp6s/Exab3zQZ9uE8Nhssq bCMMlwzWzGtcR30t0lTTykP43nwBkrtHh9isryS/ggEkmd8mGt68ErfZrpsxpP452lxv g6YwV2bTcIWTBUB/u+xOgogksSXMMFQAyVBVQ3B5SZs6HoC4GaPfVkCJICaNrvkE4dD1 pVj4OErItHEonXyplBX32qUvYLccwPvzm7t8uNpBj5jJWP4pPplQ0npyYnCX0vZwisnU MIImWTT94Z5WfuieFdJ041iINMe0DgtTuXV+QlnKfjpUQTeSZBJKKumCnpH+C3cCr7/p dc0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=SaN4Frn4nribuqiKUuDZC+THHVdnIlI6VvpmHTO1oZ4=; b=SmXl6RdTpKo7V5WlYy+gfybFRvmDW6UNjLpF48CzVVxt1e0t3LoZuB7PRkeUfpLUNU zSrfqiR9T1AuCHrskKtm33SQ21iF/STysDcqm0W3DbfJYB2aeOvl7C2SVY639CP2zmHt Q1zZg6sj0iopg0Q7FfrMgzCmEkO7c3FiP2mliMMXkQnyi0QNj2Hkbsnh2FcVpd4zYuvn SUhe5JHd5ugE8KiSCSWB77jvMjHsQ8Q0foMHSbgtu+blXxc1TlQE1BHLpisLRP3eeeDJ 3noLjsJJ2uBGYmDbyPRL0E++qZPm92fOBrjcmBegcGtUBETQHLbLGJXrLAYsMnmaNtyj mPFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=o2soD1yh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23-v6si18022454plr.498.2018.06.19.08.24.00; Tue, 19 Jun 2018 08:24:13 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=o2soD1yh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966571AbeFSPXI (ORCPT + 99 others); Tue, 19 Jun 2018 11:23:08 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:37572 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965599AbeFSPXG (ORCPT ); Tue, 19 Jun 2018 11:23:06 -0400 Received: by mail-pl0-f66.google.com with SMTP id 31-v6so32604plc.4 for ; Tue, 19 Jun 2018 08:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SaN4Frn4nribuqiKUuDZC+THHVdnIlI6VvpmHTO1oZ4=; b=o2soD1yhJdW7yfOGwrWAKWCPgOQxA+n4pfpRqfTQX4x8+VuF+1fZIBtYWNkpeJNJcJ t+9+hmfH17sRmg3o1aJ204s5g5QxgUPXVIOYJ7VomIYfaXh7oodlcmvy8CFDMeRy00g+ 3FNzbE+TncQcWjN5FypqOilQvaFHVFPZUoMAB7XD3FKceQN0Jtr4Xz2Xs7Q/t/CVcBDK 4X13wRP98TXFmCLlPlBi0fXdI7XrQmOE3ab0TjKjOeabToDM5zXUqGsTE6Jlz8cSSaxQ pbr7wPZ6hplfLoJupS+BFrqEkRCY4XwZtiarVwUlUgjlBOb/DbfJkm7szvBoMmf6gjyG AB3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SaN4Frn4nribuqiKUuDZC+THHVdnIlI6VvpmHTO1oZ4=; b=nM1wrT9McL+w2TIKrNdhPyTQLGehxORKZFloP17o7FLMJ33Gk62pqkwbnEcUKK//iS uz4tUaWZLFh25WdDLAjbvuLHRAloF0VYUdojf7SYp65jlKHCn0+imSnMBPudklQKV7f1 U3yZiJluSloKWxWs7ey2/VFNqqS5oKuu5wvack3nZPiFevEi9SNZvGikOAjdnxUwEjFM qPzITRh3tkw9Pvrey7g4PATh8Kafwh1TLlKm8zb8NE0jF9NczllHD6O3flJU1vSop6C8 2ku7Na9enfRoPBBQXlSPrc8/raefLi56oLXrHVJxvkHn4XLc0lyWx1COy8W/Eiq2zZJT xUcA== X-Gm-Message-State: APt69E2RwXLw75+bhnBuzYx8N/OE0gKxs3Rz7wuG+a1tQjukz3S29pcD iofQdgbGe5gHMdm1aC0huc0DMsqZXms= X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr19189101plb.274.1529421786250; Tue, 19 Jun 2018 08:23:06 -0700 (PDT) Received: from ?IPv6:2600:1010:b023:c12a:9165:dc8d:85a7:914? ([2600:1010:b023:c12a:9165:dc8d:85a7:914]) by smtp.gmail.com with ESMTPSA id p16-v6sm45203548pfd.47.2018.06.19.08.23.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 08:23:04 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] x86: Call fixup_exception() before notify_die() in math_error() From: Andy Lutomirski X-Mailer: iPhone Mail (15F79) In-Reply-To: Date: Tue, 19 Jun 2018 08:23:03 -0700 Cc: Andy Lutomirski , Siarhei.Liakh@concurrent-rt.com, LKML , X86 ML , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov Content-Transfer-Encoding: quoted-printable Message-Id: <048143ED-D567-4B6B-ABF4-EFE5F1B87607@amacapital.net> References: To: Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 18, 2018, at 11:23 PM, Thomas Gleixner wrote: >=20 >> On Mon, 18 Jun 2018, Andy Lutomirski wrote: >>=20 >> On Thu, Jun 14, 2018 at 10:10 PM Siarhei Liakh >> wrote: >>>=20 >>> fpu__drop() has an explicit fwait which under some conditions can trigge= r >>> a fixable FPU exception while in kernel. Thus, we should attempt to fixu= p >>> 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. >>=20 >> Reviewed-by: Andy Lutomirski >>=20 >> 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. >=20 > Confused. math_error() is still invoked with interrupts off. What's > different now is that notify_die() is called with interrupts conditionally= > enabled while upstream it's always called with interrupts disabled. True, but I don=E2=80=99t think that matters. What I=E2=80=99m grumbling abo= ut is that we can do cond_local_irq_enable() and then return without local_i= rq_disable(). Anyway, I think the patch is fine as is. We can unsuck the entry IRQ handlin= g another day. >=20 > Thanks, >=20 > tglx >=20 >=20 >=20