Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2084795imd; Sun, 4 Nov 2018 16:51:14 -0800 (PST) X-Google-Smtp-Source: AJdET5cuaSxf7Rs3D2EFcjPFHqQ8xC+uCr8/iDiXbhhMy2ONZhNOlndK53aaDuTYBgcCNzTxVTAH X-Received: by 2002:a17:902:bb89:: with SMTP id m9-v6mr17261640pls.66.1541379074474; Sun, 04 Nov 2018 16:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541379074; cv=none; d=google.com; s=arc-20160816; b=yuq1nPw4QPUzVOAlf3GNacDp5d8NMe7e+gAy58AIS4KJdc6Uw0pvlUhykx+BNv1BlW x3SwEwHTvQI+UszXhmIQ4Gwn2T6lb1932XiXk96otoqtnL7vOrsG5AWFcWvU+IPe6xZL j0nsLU7jn5Pni2uN0iFQ5aBBFZKPbMiAjCdEgT8Hg5bD30DB5bAAlQ4mlgzEuz1p1Z47 eH1kmEdBcWqASXCmmO+Dc4FvxucsPX4/IiIE7VMcXbkD76so4Ekl7SEE7rDnG0sMFpeb mt7aZSN4YqiP3D25ydG/VNxIGcD/XWKAKf8meKmnuGzhp3fSFvwYfETZ+RDIhU3biGB5 AV1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=4Vzdd3vamHNSX1V+il2+w2HUrsuS7Oganay2j5O1thQ=; b=ChncpH6fLycm7m4H94mwQi04l2mDrmEJoCcV+ophQJXO7QWdHJ6u9l12/NFlYer+sO 7bSbyrUEM77FX0pe/fAnbWRm+2SrmUiJSglT7g/ltVYtjKkojR91lm37H4G/Hp6RAfPx V14zzd2SDJKGkgsGXWEEMqAKOmCK2Eptcz5XDjpC/1pzGh6vN3cNOxn4z7IxX8ugIGCk WO3bG6AZbcCatLASntwPbZ1x1aBYwJczA+Ti7CNbp/DTuVckBTfXaUauTB3zTtbeFuIz D99J2kyErJfDd5ODaVXkQqx4Tr6yMVkFRnOf3eC9C0ThUT8UieT/iAMsRv0TOSReEeN8 kOLA== ARC-Authentication-Results: i=1; mx.google.com; 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-v6si15309734pgk.479.2018.11.04.16.50.59; Sun, 04 Nov 2018 16:51:14 -0800 (PST) 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; 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 S1727217AbeKEGOt (ORCPT + 99 others); Mon, 5 Nov 2018 01:14:49 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33428 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbeKEGOt (ORCPT ); Mon, 5 Nov 2018 01:14:49 -0500 Received: from p5492fe24.dip0.t-ipconnect.de ([84.146.254.36] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gJPTR-0002P5-ML; Sun, 04 Nov 2018 21:58:22 +0100 Date: Sun, 4 Nov 2018 21:58:20 +0100 (CET) From: Thomas Gleixner To: Nadav Amit cc: Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Jiri Kosina , Andy Lutomirski , Kees Cook , Dave Hansen Subject: Re: [PATCH v3 1/7] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()" In-Reply-To: <20181102232946.98461-2-namit@vmware.com> Message-ID: References: <20181102232946.98461-1-namit@vmware.com> <20181102232946.98461-2-namit@vmware.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 On Fri, 2 Nov 2018, Nadav Amit wrote: > text_mutex is expected to be held before text_poke() is called, but we > cannot add a lockdep assertion since kgdb does not take it, and instead > *supposedly* ensures the lock is not taken and will not be acquired by > any other core while text_poke() is running. > > The reason for the "supposedly" comment is that it is not entirely clear > that this would be the case if gdb_do_roundup is zero. > > Add a comment to clarify this behavior, and restore the assertions as > they were before the recent commit. It restores nothing. It just removes the assertion. > This partially reverts commit 9222f606506c ("x86/alternatives: > Lockdep-enforce text_mutex in text_poke*()") That opens up the same can of worms again, which took us a while to close. Can we please instead split out the text_poke() code into a helper function and have two callers: text_poke() which contains the assert text_poke_kgdb() which does not Thanks, tglx