Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5588196imm; Tue, 19 Jun 2018 12:59:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK3rrPdjup2LaSx7DZevWxzq/f6rjo+ASmtxmxEPg6RPIGlDQFIDIyTkqLjmkC3btPCoQfa X-Received: by 2002:a62:4c88:: with SMTP id e8-v6mr14829388pfj.99.1529438348958; Tue, 19 Jun 2018 12:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529438348; cv=none; d=google.com; s=arc-20160816; b=lh06zkHnC1odjsJKfLVJztYpilf8cha7q7lI3KVROZ2TDiDHbzXLoa4C2tIHqIuV/m dMIVqyrPq+AyRXps0a9p/1vmgRsRmLKi0nC3FCOxM/4ZveHvLkRA5Ro/NWi20Iw104Bq 9FzJXG1tVt4KoD/0z+GAT5PMPJ5Ibgsbj3R9Gt/CKgy9qn/C0o704UAK+Aq51xvGCaZH PBylIXVKVZT8H21pG9GLjpkGqtcDIwt4D7m2r969iW4Yed2oE7o9YUoX7jEblmfr2Ak7 aFmii9YFwRuwg08EQGFNwOwDNQYniW/8p+51yYF/FUSAitsR2n5eQNgRgByIn9bIcT5b 054A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=oQEZ50UzOVGGoHqRNP6p+/7zM3XQQG+li1B0AwUDb0w=; b=fG2qej6eYHBIs0ZB5h+dSyQyebZYM0lBXSsMwTBIhovwN628EziIMk/B0j0fWObr46 RDn7jyqhK5Tb1gL0JgGQzoXuf8tq/yM1gxRMsseMAFBTFsEkf4/lXQPONBGoYgSRn5UV FzzIotPTmlm8CD/57ybiVsvtLm7NdBEoY+XqjgPotlxHFZfKf1eGG5PkTYwfck6f1eLJ aFeV23VWxg7Z/IpjRgZIG5e6xITZDxEPCT26TNfTWPCwyR37GPHobRB8rWL+5nnbREsc naWzYmbKdQwESXFAejwL+VTb63vDAn/hkzDKozelCF078vIsP7z9dLBDVQ6+UivQVxmn zQlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=lxtRa2B0; 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 y16-v6si432370pfn.111.2018.06.19.12.58.46; Tue, 19 Jun 2018 12:59:08 -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=@concurrentrt.onmicrosoft.com header.s=selector1-concurrentrt-com02e header.b=lxtRa2B0; 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 S1030657AbeFST42 (ORCPT + 99 others); Tue, 19 Jun 2018 15:56:28 -0400 Received: from mail-eopbgr710110.outbound.protection.outlook.com ([40.107.71.110]:2427 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030472AbeFST40 (ORCPT ); Tue, 19 Jun 2018 15:56:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=concurrentrt.onmicrosoft.com; s=selector1-concurrentrt-com02e; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oQEZ50UzOVGGoHqRNP6p+/7zM3XQQG+li1B0AwUDb0w=; b=lxtRa2B0CWJYdrgK64nSw+MW9FNEaXOlxb3NcTn32K1ePEtymMb9TmRDOvTIzYPyg+ku5bcmaKkvuscWG/9K1s2hsUV9ug7qoM1lNLSwKtEz3jVP7JUlJ4hHcaXYxfNaU6N1KrLBc3HTytvz/WCxZt0aMxs3ijvARwVQs1QZl1w= Received: from DM5PR11MB2011.namprd11.prod.outlook.com (10.168.105.151) by DM5PR11MB0043.namprd11.prod.outlook.com (10.164.155.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Tue, 19 Jun 2018 19:56:24 +0000 Received: from DM5PR11MB2011.namprd11.prod.outlook.com ([fe80::d9fc:b142:3a66:2c34]) by DM5PR11MB2011.namprd11.prod.outlook.com ([fe80::d9fc:b142:3a66:2c34%7]) with mapi id 15.20.0863.016; Tue, 19 Jun 2018 19:56:24 +0000 From: Siarhei Liakh To: Andy Lutomirski CC: Thomas Gleixner , Andy Lutomirski , LKML , X86 ML , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov Subject: Re: [PATCH] x86: Call fixup_exception() before notify_die() in math_error() Thread-Topic: [PATCH] x86: Call fixup_exception() before notify_die() in math_error() Thread-Index: AQHUBBaUW86w1+9ez0usdUxJuRkw36Rmk56AgACQVQCAAKJ8YIAANDWAgAAFfUk= Date: Tue, 19 Jun 2018 19:56:24 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Siarhei.Liakh@concurrent-rt.com; x-originating-ip: [65.190.80.89] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR11MB0043;7:jYvmXN5SL0niDi1bcPeEWMrFRJwikM312nF/9i4iVbbX9mjxvYCHFfapxHI1OVEnPSdBXhdCR4TQsbPplVUkLxkUUJN/uXkFXc6enlO9lECKl/0pJgIlGpJ084pm2d55lSZWYB3nXFB+uLPH1/mKwEXqYHKy5abA8Zy6WD4dd2kAdOeWRVZdTpTs0Ir9gZRSKafBWwJtKtC+wNKWQPvyXszClibvDrP/0bD+aKSTRNK7qCnZlsMVVTZja+BgfPwj x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: d9c53f29-5d85-47bf-de78-08d5d61ebcd5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM5PR11MB0043; x-ms-traffictypediagnostic: DM5PR11MB0043: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:DM5PR11MB0043;BCL:0;PCL:0;RULEID:;SRVR:DM5PR11MB0043; x-forefront-prvs: 07083FF734 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(366004)(39380400002)(346002)(39840400004)(376002)(189003)(199004)(7696005)(81156014)(33656002)(105586002)(102836004)(6506007)(5660300001)(74316002)(14454004)(9686003)(59450400001)(8936002)(54906003)(7736002)(93886005)(2906002)(53546011)(3660700001)(229853002)(81166006)(8676002)(478600001)(3280700002)(66066001)(76176011)(72206003)(106356001)(5250100002)(305945005)(6916009)(316002)(97736004)(486006)(55016002)(6436002)(476003)(3846002)(25786009)(6246003)(4326008)(2900100001)(446003)(11346002)(186003)(6116002)(26005)(99286004)(68736007)(53936002)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR11MB0043;H:DM5PR11MB2011.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: concurrent-rt.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: skpSOek8GhUkFHrkNl/ucK7k+6BcQVUTsOUPJeCHmZOGZ+rgKWVfkmMCblQRG3fxoiOmpbHxu1UX2rq6bG0I2C+Hs/Zxi2G+UFpiN99UsoxoApguZ0XNzo5J/M9Sm/OTEYOQoXyxqsV+2h14A8CumVdRRs3g+OULyRcy+gGfQvrEYybSQgfTRtaRUoSCdYBvfanUuppgwhPaLSnb/ZG81K1bskfqpsI//6ZQYm1/saWDTG6aylBmHlIG9PnUcNwL4EXpfdLFkGo8wzYOyCHk50Zm7v24DDv9gtjxuUKQYiI6K3uQoXxAFpdPlkmhXj1SLhj6TIv3k8f0RLg82fQEQA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: concurrent-rt.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9c53f29-5d85-47bf-de78-08d5d61ebcd5 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jun 2018 19:56:24.7097 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 38747689-e6b0-4933-86c0-1116ee3ef93e X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB0043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Jun 2018, Andy Lutomirski wrote:=A0 =20 > On Jun 19, 2018, at 9:15 AM, Siarhei Liakh wrote: >=20 > > On Mon, 18 Jun 2018, Andy Lutomirski wrote: > >=20 > > > > 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 fail= ed just > > > > > like in do_general_protection(). The original call sequence incor= rectly > > > > > triggers KDB entry on debug kernels under particular FPU-intensiv= e > > > > > workloads. This issue had been privately observed, fixed, and tes= ted > > > > > 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.=A0 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 conditio= nally > > > enabled while upstream it's always called with interrupts disabled. > >=20 > > I see that notify_die() is being called either way in upstream (ex: > > do_general_protection() and do_iret_error() vs do_bounds() and etc.). > > Is there some some sort of general policy/guide documentation available > > which outlines the expectations of notify_die(), as well as its notifie= rs? >=20 > I doubt it. >=20 > The right fix is to delete notify_die(), not to document it. kernel debug= gers should > hook die() directly, and other users (if any) should be moved into the er= ror handlers. Got it. Unfortunately, this looks like a whole separate code refactoring pr= oject which I cannot undertake at this time. In the mean time, this patch offers = a fix for an immediate issue (KDB tripped when it shouldn't) even if it does nothing = to address the deficiencies in the framework itself.=20 Thank you.=