From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05300C433E0 for ; Tue, 2 Feb 2021 21:06:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6C50E64F3F for ; Tue, 2 Feb 2021 21:06:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C50E64F3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E03956B0005; Tue, 2 Feb 2021 16:06:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB36B6B0006; Tue, 2 Feb 2021 16:06:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC9956B006C; Tue, 2 Feb 2021 16:06:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id B58356B0005 for ; Tue, 2 Feb 2021 16:06:05 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7A2C31EF1 for ; Tue, 2 Feb 2021 21:06:05 +0000 (UTC) X-FDA: 77774560290.11.news43_3f15dac275cd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 635B9180F8B80 for ; Tue, 2 Feb 2021 21:06:05 +0000 (UTC) X-HE-Tag: news43_3f15dac275cd X-Filterd-Recvd-Size: 4699 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 21:06:04 +0000 (UTC) Received: from zn.tnic (p200300ec2f0e1f0020339110b9493ea9.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:1f00:2033:9110:b949:3ea9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id AB6981EC0489; Tue, 2 Feb 2021 22:06:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1612299962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=q6L9rhyrJTIFzle1zVvDWk/ej5JXAdlKMIkTzGJKZEk=; b=V2fQWNHOugTsgtHYlbc/g/l5hSJK79OYzF3s35yFm5rDNsXOgRE3rSz6GyI7bKEyYb4C/R oBcb7Ny6m47O818px+Ohwx7oqZhfhWkV9z3VZN/0SNsQfdzoUYQSEH/DlffjLT2UWkQvp8 nQnHRqT5mIZrly548O5vTBbHF0NPo+w= Date: Tue, 2 Feb 2021 22:06:00 +0100 From: Borislav Petkov To: "Luck, Tony" Cc: "x86@kernel.org" , Andrew Morton , Peter Zijlstra , Darren Hart , Andy Lutomirski , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH v5] x86/mce: Avoid infinite loop for copy from user recovery Message-ID: <20210202210600.GF18075@zn.tnic> References: <20210119235759.GA9970@agluck-desk2.amr.corp.intel.com> <20210120121812.GF825@zn.tnic> <20210121210959.GA10304@agluck-desk2.amr.corp.intel.com> <20210125225509.GA7149@agluck-desk2.amr.corp.intel.com> <20210126110314.GC6514@zn.tnic> <20210126223605.GA14355@agluck-desk2.amr.corp.intel.com> <20210128175735.GB2120@zn.tnic> <20210201185812.GA54867@agluck-desk2.amr.corp.intel.com> <20210202110126.GB18075@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 02, 2021 at 04:04:17PM +0000, Luck, Tony wrote: > > And the much more important question is, what is the code supposed to > > do when that overflow *actually* happens in real life? Because IINM, > > an overflow condition on the same page would mean killing the task to > > contain the error and not killing the machine... > > Correct. The cases I've actually hit, the second machine check is on the > same address as the first. But from a recovery perspective Linux is going > to take away the whole page anyway ... so not complaining if the second > (or subsequent) access is within the same page makes sense (and that's > what the patch does). > > The code can't handle it if a subsequent #MC is to a different page (because > we only have a single spot in the task structure to store the physical page > address). But that looks adequate. If the code is wildly accessing different > pages *and* getting machine checks from those different pages ... then > something is very seriously wrong with the system. Right, that's clear. But I meant something else: this thread had somewhere upthread: "But the real validation folks took my patch and found that it has destabilized cases 1 & 2 (and case 3 also chokes if you repeat a few more times). System either hangs or panics. Generally before 100 injection/conumption cycles." To which I asked: "Or what is the failure exactly?" and you said: "After a few cycles of the test injection to user mode, I saw an overflow in the machine check bank. As if it hadn't been cleared from the previous iteration ... but all the banks are cleared as soon as we find that the machine check is recoverable. A while before getting to the code I changed." And you also said: "I tried reporoducing (applied the original patch I posted back to -rc3) and the same issue stubbornly refused to show up again." So that "system hang or panic" which the validation folks triggered, that cannot be reproduced anymore? Did they run the latest version of the patch? And the overflow issue is something else which the patch handles fine, as you say. So that original mysterious hang is still unsolved. Or am I missing something and am misrepresenting the situation? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette