Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp636111pxb; Thu, 5 Nov 2020 09:04:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4Tkuc21Aj+DDzUxuhUYa9kzXJSipyyG4tcYKgOTZbGZ/9zPp/FPUjFCHaxLUnD9oiFLFB X-Received: by 2002:aa7:d94c:: with SMTP id l12mr3632675eds.355.1604595861340; Thu, 05 Nov 2020 09:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604595861; cv=none; d=google.com; s=arc-20160816; b=0Disza5qYqWq6f/n1EzoLpSQ1X1WuZSJTWL0WsFMWKkXLxLPhTcOzVU58Krnbk4Rzb ehX0he8sUCtv+kkN+K5Z8Q9tINs/QMBt1CUpdcQIQjRnd4lBkIeg0bj/k4sDB901z9yE ldOHdSO0pbq2kJ0NDbye785F/9GjVpvR16LCYUfeGwiYxf6utZegJvi3n29/0OJVFWq0 y67UG+r51mOE9dFOBiY6sLhABSPlKveyTcGwJTB34zE0vqa+d7U5R9ONqB4YBzrEoSoi DbrVdTkT5QNIMmyvbh2u1vP24Zv1+B0OsXFok9PGBQorHsPqxTpzw2j9q6tkopEtza/q ooDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Y2T77tm0Vk24SDS/yzcm/jP/xW8nOEkGiU2Kx43O7O0=; b=s3+V7iz27MGWpMCF7wTAUlGE/uHzmCsK3Lw5FUGQXMzL5g+RVRQE2w21bn2OE9laBh li+iLIGp3FR7DXmWfK5WdWLQKSWzHfLb14W4l2m7Ix3CpF0x02bSM/025GiNSyhqyOaO 79HDnaxwF8wVAC9H/xBbUO8f+zRH6eOsMHiRP4JVuO618BOYkpYiSe+32mA3J8Nc8Z1Z FX2sN2kmiugSe9beFXPVkW3n9awuIDj5UPy7WUd/ZrAgT9u6W1zpdqfcUeugT5szApCF crYmDKwyjY0EVWfkVEyOsiE7qJpnqFexuM6J1H6j/BE0NbFqIMQQyvt5ws9/nsmmsvvq kCWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZH2FZ7Nz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si1539028eds.110.2020.11.05.09.03.55; Thu, 05 Nov 2020 09:04:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZH2FZ7Nz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731709AbgKEQ6Z (ORCPT + 99 others); Thu, 5 Nov 2020 11:58:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:52452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730862AbgKEQ6U (ORCPT ); Thu, 5 Nov 2020 11:58:20 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5683A2073A; Thu, 5 Nov 2020 16:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604595500; bh=WPfKbYRANsaYY5+y24dfY+e9RC7MfQyTqEBf6L+3aEU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZH2FZ7NzGwDzL2Er6PUXZVBDRy83tC97s/FO6GPnUd/nmdTIXGPib4KGpPYhAEB6t qegoWzpJgUEUXW7lz3lnfMtK3ZPE0ZVOhz8xiBliQeK8B08zvX4+6gK4u2WQvj4MgQ wB/htahwttIct/GH6qQWrodaV+WODv+klzsRNeRM= Date: Thu, 5 Nov 2020 08:58:18 -0800 From: Jakub Kicinski To: Greg Kroah-Hartman Cc: Andrii Nakryiko , bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com, daniel@iogearbox.net, kernel-team@fb.com, Arnaldo Carvalho de Melo , Jessica Yu , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" Subject: Re: [RFC PATCH bpf-next 4/5] bpf: load and verify kernel module BTFs Message-ID: <20201105085818.4f20f3ed@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201105164616.GA1201462@kroah.com> References: <20201105045140.2589346-1-andrii@kernel.org> <20201105045140.2589346-5-andrii@kernel.org> <20201105083925.68433e51@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201105164616.GA1201462@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Nov 2020 17:46:16 +0100 Greg Kroah-Hartman wrote: > On Thu, Nov 05, 2020 at 08:39:25AM -0800, Jakub Kicinski wrote: > > On Wed, 4 Nov 2020 20:51:39 -0800 Andrii Nakryiko wrote: > > > Add kernel module listener that will load/validate and unload module BTF. > > > Module BTFs gets ID generated for them, which makes it possible to iterate > > > them with existing BTF iteration API. They are given their respective module's > > > names, which will get reported through GET_OBJ_INFO API. They are also marked > > > as in-kernel BTFs for tooling to distinguish them from user-provided BTFs. > > > > > > Also, similarly to vmlinux BTF, kernel module BTFs are exposed through > > > sysfs as /sys/kernel/btf/. This is convenient for user-space > > > tools to inspect module BTF contents and dump their types with existing tools: > > > > Is there any precedent for creating per-module files under a new > > sysfs directory structure? My intuition would be that these files > > belong under /sys/module/ > > Ick, why? What's wrong with them under btf? The module core code > "owns" the /sys/modules/ tree. If you want others to mess with that, > it will get tricky. It's debug info, that's where I would look for it. Clearly I'd be wrong to do so :)