Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1040904imm; Thu, 6 Sep 2018 14:22:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZW6EDec4HLGTk4VQYxY9YDAUbXeUyAfyyUkDJUheeIdBhi0Z81oDzY3424whnLVnUIv4Lh X-Received: by 2002:a17:902:9a83:: with SMTP id w3-v6mr4846052plp.75.1536268949284; Thu, 06 Sep 2018 14:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536268949; cv=none; d=google.com; s=arc-20160816; b=c/UM3vUATMDSIIE941Oam/Rh1dsuVqiI/AXYVYNOrkjNAQMlyzIaIZZqovPmNSdtRa +D5jTnEHSTPZ5wCviQEYuDFwqQWGplq11uHZHKRHUjsDwxBnZkAPgv31meOniRw1HYtn Vj9vZevUW+E6kXz4DaeUZ5+M6Oxy306jbIHDOkZxbvR0vDrz30DIlxYfIbCEAXPdlp8M ZD3ueDlUK8zcHBo2IwlbCWYVL41bJoJ9/VWpG9ss8+EY+wXK0R3DNTu0ss5ZYXlcmHKe vFg1P2wFoX1n/8rkzl0S53UY98akL+djqI9X7byDEZ0q9N48NFyPyFFI0KII7V0zElqr 6KzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hdLNGESV/Zmlv9YBKz/S6B+1oEbN9RnAUFg0BowPAsU=; b=f2pxpMQzUVxg+OEuOR4ZYZdAaqabFbwhr9+lS3X6rMC2kS1jePbR9F7W9jBMprpEE6 Yx8lwHSGgQJSpGIlhxyBu1wCIQIgcWHtoGs40WjmNntXzwvY8Hon2DYIWHr2hMwFqgt0 GxB4bQZgEeCk8/edj1J9UB5G1Z/IFlJZ6SCiZ1g1VWRRyyZKY3O837KnDmrWH6jFNjzu MrO9UAlLNrxnl+KdOUMMVbuFDKnInXR1kli+9pfXIpmKtr5cI4P+BtyRZe2WWJjsJrnW dd8++afeuKTOUedh6ACyuqdylw+fzanznS5FCGwfZxdfhu94PIbnimfSypNDHumTPJqm XmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SoT+nvOO; 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 p7-v6si6417391pll.42.2018.09.06.14.22.13; Thu, 06 Sep 2018 14:22:29 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SoT+nvOO; 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 S1728760AbeIGAbH (ORCPT + 99 others); Thu, 6 Sep 2018 20:31:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50374 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbeIGAbH (ORCPT ); Thu, 6 Sep 2018 20:31:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hdLNGESV/Zmlv9YBKz/S6B+1oEbN9RnAUFg0BowPAsU=; b=SoT+nvOOr2ASbDRd2dQIn8Hs4t QH9q/EhEJyyXuRKGRj/+9NV1rtvhtXcI+kmP8GhirhbnRUTdVHdMKEIznY+gDySAP949LCqkMvBsb Dg3oAQKmlXVbD9FKeoycBi2KWXnBgIpsT3/2QHXltz9n7BJ7LULplA2Ovt3kaQesln43hLtAetEzf Cm/7MOj/y0/kk0qYr2F3yXYM/rdDTMzXI8z5R1yQdKI/PU8hnRUJSWfIeEHWThSnjzXERIdb4Zd/0 TStQtaiX3XKpNJbzMXYE918J13uEiCCbmRo7Ca3jQvcedkrX17yK+OWlN1ZVrg5U6qtUrrczNGw+f Pc3+GNgw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fy0Lo-0005Yy-2i; Thu, 06 Sep 2018 19:54:00 +0000 Received: by worktop (Postfix, from userid 1000) id D36D66E0AA9; Thu, 6 Sep 2018 21:53:51 +0200 (CEST) Date: Thu, 6 Sep 2018 21:53:51 +0200 From: Peter Zijlstra To: Nadav Amit Cc: Thomas Gleixner , LKML , Ingo Molnar , X86 ML , Arnd Bergmann , linux-arch , Dave Hansen , Jiri Kosina , Andy Lutomirski , Kees Cook , Dave Hansen Subject: Re: [PATCH v2 1/6] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()" Message-ID: <20180906195351.GB9358@worktop.programming.kicks-ass.net> References: <20180902173224.30606-1-namit@vmware.com> <20180902173224.30606-2-namit@vmware.com> <20180906194003.GD4816@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 07:42:14PM +0000, Nadav Amit wrote: > at 12:40 PM, Peter Zijlstra wrote: > > > On Sun, Sep 02, 2018 at 10:32:19AM -0700, 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. > > > > Argh, that's pretty shit code... > > > > Not only is that text_mutex abuse ugly, so too is the fixmap usage from > > IRQ context. I suppose this really does require your alternative mm > > patches for text_poke(). > > Right, I forgot about that… With that CR3 trickery, we can rid ourselves of the text_mutex requirement, since concurrent text_poke is 'safe'. That would clean up the kgdb code quite a bit.