Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4956205ybl; Mon, 26 Aug 2019 19:39:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqytZN+NrXflUd117EIRz+17ts1FzXEsTlqlcO05Z/aIug6IZqqMIjpjpPoW/qwYjqMfCIAB X-Received: by 2002:a62:1d93:: with SMTP id d141mr10847580pfd.40.1566873541392; Mon, 26 Aug 2019 19:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566873541; cv=none; d=google.com; s=arc-20160816; b=ySEfZKFMuV6QdLBpoZffDsPsngpjoM969XFMq6e0nwOb5hVPQBlLjmRL2Wkft2g16o b/Mvn3XDHBWHQC2dzwVBopEXgiLnq6eVBke6+tAvQP+RQPc24b0EAce7ZdFz9eo988FY SBWPUjoafl95uPVD8mf/jAtg6xMnoblovD4c3UXexu+QnzFKOsA8HIQ44Do3X9+Y8M7W 0Qpl2REtx3PMpBvTHmIpA/8jNhLIUYl7L8qDt8PDurbTmUsNbGZm1wRo8YIJzrLOPfge gAfdEwERqqySo6BAoQmv9DFICxQQj/zpxXvp4Y2ZOTycrKtL19BHHhWPGmsa5skfeOi1 dgOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wPuyv/QB6NxWNFhsAprUCeA2Bt4SOCSgcpn0/XPYB1M=; b=AtWwMZs/R3guhomz2WW8jZrtF2p1LZCMtJ/8x4puAp5JbprxA3omKNSgE5WBwqymtl cOC67bvtS2qOwRM5gv8PTRPwD5NyoK4AKS5mTDuV5Wjh8ttZg5Bs3t6R+YGY2K6cALvt HaYKyGpWWizTNJutHy794oWruinHiXPAXrJvaSBhZsv09rKUFPlQnOdE1jvBNFRI2Qje 861moOoW1+tZARXVnBILpZgP6l9nqsXfDr9M5UiTEoW6dxSAi4fBuX90HDlaTQYbGg/8 kCkfwTVpfGWduRj0nKSEuILfOadRSxoj4a62kIuckJJzz4sUWcMQTyqBLQt4GmdtwqIs XNTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q7Go3M99; 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=pass (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 16si10746825pgw.559.2019.08.26.19.38.44; Mon, 26 Aug 2019 19:39:01 -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=pass header.i=@kernel.org header.s=default header.b=Q7Go3M99; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728704AbfH0Chd (ORCPT + 99 others); Mon, 26 Aug 2019 22:37:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:34532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfH0Chd (ORCPT ); Mon, 26 Aug 2019 22:37:33 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 BC527206E0; Tue, 27 Aug 2019 02:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566873452; bh=1IV2CM6ErWuo3N+yfdMw51ZAbsWRy4I36btniWe1qIA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Q7Go3M99ctkACkffmRIl2U9APAA7HHwtwnMynerXPU5BSUSZR8Ru99vPmYSG2aJLa VYMoQrvB097EzDzv3sL6Ia+UOUks4qbnXOu6opjr96OAci7grhSLeKJjw2DQHJXYCK dRgXzahaJxb2PBjJQCuInQN+zjyswv+UYbfMBiFw= Date: Tue, 27 Aug 2019 11:37:24 +0900 From: Masami Hiramatsu To: Rob Herring Cc: Steven Rostedt , Frank Rowand , Ingo Molnar , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , Linux Doc Mailing List , linux-fsdevel@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v3 01/19] skc: Add supplemental kernel cmdline support Message-Id: <20190827113724.fa32ce580f5901004044d0f1@kernel.org> In-Reply-To: References: <156678933823.21459.4100380582025186209.stgit@devnote2> <156678934990.21459.10847677747264952252.stgit@devnote2> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Thank you for your comment! On Mon, 26 Aug 2019 08:27:48 -0500 Rob Herring wrote: > On Sun, Aug 25, 2019 at 10:15 PM Masami Hiramatsu wrote: > > > > Supplemental kernel command line (SKC) allows admin to pass a > > tree-structured supplemental kernel commandline file (SKC file) > > when boot up kernel. This expands the kernel command line in > > efficient way. > > > > SKC file will contain some key-value commands, e.g. > > > > key.word = value1; > > another.key.word = value2; > > > > It can fold same keys with braces, also you can write array > > data. For example, > > > > key { > > word1 { > > setting1 = data; > > setting2; > > } > > word2.array = "val1", "val2"; > > } > > Why invent a custom file format? You could use YAML (or JSON): Yeah, actually my early idea was using JSON, since it is widely used and many good tools. However, I thought that is not human friendly format :(. I would like to give an easy to read/write but structured interface. > > key: > word1: > setting1: data > setting2: true > word2: > - val1 > - val2 (Ah, in above example "array" is just a part of key, and is not a reserved word.) > That would allow you to define a schema for defined options and can > easily be manipulated with python (or any language with dictionaries > and lists). That does imply adding a YAML parser to the kernel which > I'm not sure is a great idea. There is a C parser lib, but working > with YAML in C is not that great compared to python. Yes, using plain YAML maybe requires user-space coverter to some other format. > > Another option would be using the DTS format, but as a separate file. > That's not unprecedented as u-boot FIT image is a DTB. Then the kernel > already has the parser. And you could still have schema now. Yeah, that is what I consider at first. I discussed it with Frank at OSSJ, but he suggested to not use DTS, nor touch current parser in kernel. So I finally convinced not using DTS. > A new interface will take a lot of bootloader work to make it easy to > use given the user has to manually load some file in the bootloader > and know a good address to load it to. Right, that is what I have to do next if this is accepted. As I shown, I modified Qemu and Grub. (Since U-Boot is very flexible, it is easy to load skc file and modify bootargs by manual.) What I found was, since the bootloaders already supported loading DTB, it would not be so hard to add loading another file :) (curiously, the most complicated part was modifying kernel cmdline) > Between that and rebuilding the > kernel with the configuration, I'd pick rebuilding the kernel. Perhaps > this version will highlight that the original proposal was not so bad. Maybe for embedded, yes. For admins who use vendor kernel, no. > Another thought, maybe you could process the configuration file that's > in a readable/editable format into a flat representation that could > simply be added to the kernel command line: (BTW, it is easy to make a flat representation data as you can see in /proc/sup_cmdline, which is added by [2/19]) > > key.word1.setting1=data key.word1.setting2 key.word2=val1,val2 > > That would then use an existing interface and probably simplify the > kernel parsing. Hmm, if it is just for passing extended arguments, that will be enough (that was my first version of SKC, here https://github.com/mhiramat/skc/tree/5f0429c244d1c9f8f84711bc33e1e6f90df62df8 ) But I found that was not enough flexible for my usage. For expressing complex ftrace settings (e.g. nesting options, some options related to other options etc.), I need tree-structured data, something like Devicetree. Thank you, -- Masami Hiramatsu