Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3443540ybi; Mon, 10 Jun 2019 10:20:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyoEHtxQYJzlMl7v7Uc1UYnm/ehQ4VGk6+ilqkc1Gh/LAMcnwHQHqvZJ6gRzrdob6fQ3Zx X-Received: by 2002:a63:490a:: with SMTP id w10mr16419351pga.6.1560187250735; Mon, 10 Jun 2019 10:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560187250; cv=none; d=google.com; s=arc-20160816; b=W/8MOozkc6SJqpboKSQPgdjuJ/RWaL6C2MGoa253l8w6WmZTKcL/b5OIMRpFizXAAA W+3x7xFXzqSD7ELKrILEpiRfcirhn0moq/+6rYSQZvVvWI1/X69FunPyCK6e3YYwtpES NfevuQa9NkXPv6A1YXLqVhkdQ9NeB4YsP9ZEEDeiA9DkiGwiuKghM4F0a2fYmGJMtv58 36T5dBL6hGDKWm0dk00CEMLfw4bIHnCzsZvajGuk0/uWBOR1BFSWRTbALSLeO5XNHDRx BIilIBP6zlP5iTVxl0lPuTvf3A36wA+8/el1Y8HfIByFxr17CKD0DrQLHrxEiK0jJ6+/ +vzQ== 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; bh=QEjTNGhAc9U+j7Tceeq6jPULt8p3NkNIdxDWPe9xgrw=; b=vlzS4K9DUDXAKEMt+VzvJFaxmd6bLIh+d34j1JxN04lMsoFXNhjZl2cFsoxFqKhDco rsYcuq/n58xF4jH7eLkEbX+VrCO/C/QN+ym/a6RkbPFEeElCR65PM9CF8scjNYcv7/FW hm5uu6+zaEzY9vkQsROgqr3FW6SyVXx+cDYQryCwmAQrEi2k+zHXBrjSOgstPV+nXu0Q G0hAK6xVoriirYh5Omj8gIX/7fBhBSKuyaqytWn4LVjIkde6FJ3d7EdhLsJto1ZpQV/m l5UJiScxg/NY47WyPBoHGT+1IrJOOX0XzjHP52uRAbwABzCr3hGzcpOZkYapHdpTiFID tD1Q== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r19si9612769pgv.76.2019.06.10.10.20.34; Mon, 10 Jun 2019 10:20:50 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387492AbfFJRU3 (ORCPT + 99 others); Mon, 10 Jun 2019 13:20:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46746 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfFJRU3 (ORCPT ); Mon, 10 Jun 2019 13:20:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EF9067F; Mon, 10 Jun 2019 17:19:49 +0000 (UTC) Received: from treble (ovpn-121-189.rdu2.redhat.com [10.10.121.189]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A521919C59; Mon, 10 Jun 2019 17:19:31 +0000 (UTC) Date: Mon, 10 Jun 2019 12:19:29 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: Nadav Amit , the arch/x86 maintainers , LKML , Ard Biesheuvel , Andy Lutomirski , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: Re: [PATCH 11/15] static_call: Add inline static call infrastructure Message-ID: <20190610171929.3xemvsykvkswcvya@treble> References: <20190605130753.327195108@infradead.org> <20190605131945.193241464@infradead.org> <37CFAEC1-6D36-4A6D-8C44-F85FCFA053AA@vmware.com> <20190607083756.GW3419@hirez.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: <20190607083756.GW3419@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 10 Jun 2019 17:20:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 07, 2019 at 10:37:56AM +0200, Peter Zijlstra wrote: > > > +} > > > + > > > +static int static_call_module_notify(struct notifier_block *nb, > > > + unsigned long val, void *data) > > > +{ > > > + struct module *mod = data; > > > + int ret = 0; > > > + > > > + cpus_read_lock(); > > > + static_call_lock(); > > > + > > > + switch (val) { > > > + case MODULE_STATE_COMING: > > > + module_disable_ro(mod); > > > + ret = static_call_add_module(mod); > > > + module_enable_ro(mod, false); > > > > Doesn’t it cause some pages to be W+X ? How so? >> Can it be avoided? > > I don't know why it does this, jump_labels doesn't seem to need this, > and I'm not seeing what static_call needs differently. I forgot why I did this, but it's probably for the case where there's a static call site in module init code. It deserves a comment. Theoretically, jump labels need this to. BTW, there's a change coming that will require the text_mutex before calling module_{disable,enable}_ro(). -- Josh