Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7403690pxb; Thu, 18 Feb 2021 09:10:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+taa7BIDo+VqR3pUfDN4NyP3qSTf9RrOyKFjtVGtPFrCY9XlxcaGds+NLCdkK0r0jWxdm X-Received: by 2002:aa7:c704:: with SMTP id i4mr321654edq.95.1613668251977; Thu, 18 Feb 2021 09:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613668251; cv=none; d=google.com; s=arc-20160816; b=bAwLjPxGHXr/atacyomV4cBe/XLu+gltDNy5muR+bhmez5iHygSeOCw5fXBsHIvXP9 K/vZ37559HdrsL6iIjmmQUWv8254H+rEUsk97uN+jFhrDJXUUJI5cui3p3W3iejkQ8Sw RfrE9MsehLuwjYeyvgjGMeGVjjblKPQhITVEdYL96YNvuAd4LII6ji0xcr2xAqu2SALO /y8PK0YyUuPmhRIq5O7uLhXD6bfqRkYYM1VwIgjB3f8jvcnu8TO98B/0U/iC/0oKp/Ma gLQdYvrINLU9VrbGykbPuaBSvju8bJPbshFP9KeDH2Z9yppNMmsEX0z5xeMx+4OADBVn /59Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C5T3ehENXPR3Dp3wxtz7+m4co+ANYhyC2qUBSrxsMQA=; b=0RHqjjzPFctXbvTo240mqVzQdR0x9qx/K23UVKCRI/zCs8C2LZupcxyf7750zxvcn6 AikFARwqT9kGL3wSMnkJhu5XjA+ZzRhsSYXnnrZUfB8qpYcGlk4ig9s9r5Ruqj/KfIWT ouHwmQODLzFd1V+kmASJ10JShm6JrgxR1C1kitk6pcA1sE+6Re7ab2m5dGPAgwfMcQK5 /VYJqstkApy2fNPAozr6pa2mvxU0HydJ0vAe7mK2uuhBOc+pa95CMqHnYQ/oasq5zDKd /Bh69e8zAbiFM5/LRyDDeBxPovIBPIa8+Z5FaYFuGsrm3e3WwNVGtsKqrorjX6x3x1i3 0bdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=A6otcrdk; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc19si3857041edb.348.2021.02.18.09.10.28; Thu, 18 Feb 2021 09:10:51 -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=@suse.com header.s=susede1 header.b=A6otcrdk; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232143AbhBRRIQ (ORCPT + 99 others); Thu, 18 Feb 2021 12:08:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:52128 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbhBRO0Z (ORCPT ); Thu, 18 Feb 2021 09:26:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613658304; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=C5T3ehENXPR3Dp3wxtz7+m4co+ANYhyC2qUBSrxsMQA=; b=A6otcrdkcGuk6b40y0c2Ep48vXGzabWsPISrtj4Q5FVBXISGZwVSnVyWP2mxlSgh/KPT58 Tf9lI02hF0MxBpSUfVajAD1N7RyktXC2tJhZyfAhP6Adn9hC7Z1Ntqu+6Yr68kpUySAdSj L1NvfLGr+Cr4kduxUX0TiXsi74hNUC8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7D216AFF1; Thu, 18 Feb 2021 14:25:04 +0000 (UTC) Date: Thu, 18 Feb 2021 15:25:03 +0100 From: Petr Mladek To: Chris Down Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , John Ogness , Johannes Weiner , Andrew Morton , Steven Rostedt , Greg Kroah-Hartman , Kees Cook , kernel-team@fb.com Subject: Re: [PATCH v4] printk: Userspace format enumeration support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2021-02-18 12:41:39, Chris Down wrote: > Petr Mladek writes: > > > - See if it's safe to pass a printk_fmt_sec to seq_file instead of a module > > > > Also it might be needed to store the pointer to struct module. > > You mean, have a `struct module` entry for this? I somewhat suspect that > module.c maintainers are not likely to be happy about injecting non-generic > code into there if it's possible to be avoided, but maybe I'm > misunderstanding? Yes, I suggest to store the pointer into struct module. It includes many external entries. It is similar to struct task_struct. I am active also in the kernel livepatch subsystem. We have added there three values: #ifdef CONFIG_LIVEPATCH bool klp; /* Is this a livepatch module? */ bool klp_alive; /* Elf information */ struct klp_modinfo *klp_info; #endif Many other subsystems have their stuff there, for example: #ifdef CONFIG_TRACING unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; #endif #ifdef CONFIG_EVENT_TRACING struct trace_event_call **trace_events; unsigned int num_trace_events; struct trace_eval_map **trace_evals; unsigned int num_trace_evals; #endif #ifdef CONFIG_FTRACE_MCOUNT_RECORD unsigned int num_ftrace_callsites; unsigned long *ftrace_callsites; #endif #ifdef CONFIG_KPROBES void *kprobes_text_start; unsigned int kprobes_text_size; unsigned long *kprobe_blacklist; unsigned int num_kprobe_blacklist; #endif BTW: Jessica originally worked on the kernel livepatching. She became module loader code maintainer because we needed even more hacks there and the original maintainer got busy with other stuff at that time ;-) I am pretty sure that she would accept it. We need a per-module value. It is not necessary to maintain separate global list/hash table just to store these values. Best Regards, Petr