Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3928590imu; Mon, 12 Nov 2018 02:59:59 -0800 (PST) X-Google-Smtp-Source: AJdET5fdjchQuUSvXvfQffOWu6Dn+2H/G7Cb8jkfW9xs8fdJrm+7Cm4/GPjDOwJJOmek1OS4Op6S X-Received: by 2002:a62:c104:: with SMTP id i4-v6mr417748pfg.133.1542020399337; Mon, 12 Nov 2018 02:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542020399; cv=none; d=google.com; s=arc-20160816; b=ZEQ73za13KOmzzmPiIxCeqhiEIoG7+0nSUj9JsDRRff29I5OQv+Dk4p9UQCLPpWCNk BAN/9yiU4qV8cbvxYepBxRSErOfzfXGlgnp1WU25Zy3dvWTqd9vKqa5aNLHz4a91nVBb RiJe1GOZC+N/mFThw7Qn/Xt2Uvr2eL3hRXFtjT7kFvxpSGGCw05wOMmo0JDdbg82Cwyf 2LfwT2JWv85TrDvV9m8MxN9yqApR9+ohUPzKPAU+8ShjIm2yGjqGS0fv83HnD6UxwrgP EdKkk9ZbDAKSdp4ak3+19oA9jm2eMdA/+iQMiIEbi6OzxOD8Cf6btwJpOzo8dWG1028k BOSA== 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=x9CF+LqOjq9Kg1MtzCHNC9kTYkYBXaW7ojjMLo9i+UQ=; b=dTDfmICCG32rDKLf9vw/ybzZeOUJmeGAwRF23E9ZRcbv6fP3o2e3obXt6Jh8aw23nJ dYNTLhR9n8gtHqcIPjvO8w+DXsUgH7x6d5F0Nvjdxzs9bcyg8AXZQthQRZY40NZBWDbT vTWOJKKBfy3jZAtw2Ts0vmM0F9YZ4cqJ/jTfUwlJ6hhRvHU7ylNl7Pyyx7aqas06+xf6 okNdFvWX9A89wuR3wkThQpgNVYim6bc3sxhvROhJkDnXvEFYksCNMGQo0TTI6Ke2UK4Q lqDDxp/9/vGvfg/IQ2wjx3l9oG6y2gfOLcl/8bdCZik7W20mJg0f0xHRIP+GV6Tbxcef f0Hg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si3325840plz.392.2018.11.12.02.59.43; Mon, 12 Nov 2018 02:59:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729243AbeKLUv6 (ORCPT + 99 others); Mon, 12 Nov 2018 15:51:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:48596 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728350AbeKLUv6 (ORCPT ); Mon, 12 Nov 2018 15:51:58 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4A823B044; Mon, 12 Nov 2018 10:59:13 +0000 (UTC) Date: Mon, 12 Nov 2018 11:59:11 +0100 (CET) From: Jiri Kosina To: Masami Hiramatsu cc: Nadav Amit , Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Borislav Petkov , Dave Hansen , Andy Lutomirski , Kees Cook , Dave Hansen Subject: Re: [PATCH v4 01/10] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()" In-Reply-To: <20181112115419.3e86d8a522b6c7457c036dc9@kernel.org> Message-ID: References: <20181110231732.15060-1-namit@vmware.com> <20181110231732.15060-2-namit@vmware.com> <20181112115419.3e86d8a522b6c7457c036dc9@kernel.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Nov 2018, Masami Hiramatsu wrote: > > text_mutex is currently expected to be held before text_poke() is > > called, but we kgdb does not take the mutex, 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. > > > > This patch creates two wrapper functions, text_poke() and > > text_poke_kgdb() which do or do not run the lockdep assertion > > respectively. > > > > While we are at it, change the return code of text_poke() to something > > meaningful. One day, callers might actually respect it and the existing > > BUG_ON() when patching fails could be removed. For kgdb, the return > > value can actually be used. > > Hm, this looks reasonable and good to me. > > Reviewed-by: Masami Hiramatsu Yes, I guess this is much better than putting the 'enforcement by comment' back in place :) Acked-by: Jiri Kosina Thanks. -- Jiri Kosina SUSE Labs