Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp636671pxy; Wed, 5 May 2021 10:02:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/WLkDYuED6dQKmbs2+Ekl+jCKzgTc9dx0+lGboSmU19ULnbCSup0ioudHL0zSzwGwHap+ X-Received: by 2002:a17:902:ee11:b029:ed:7108:623e with SMTP id z17-20020a170902ee11b02900ed7108623emr41291plb.38.1620234133985; Wed, 05 May 2021 10:02:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620234133; cv=none; d=google.com; s=arc-20160816; b=R6/fO2d/GIBSDbQgbMSUEAezaQ5eAFj2wb49Hn4vM9EdmvQN8earZ+Eh8dBIWEl42f hNwalYFbncHPBwBtpmO8OZlh8H/Bf63lH/z1CtJZBdmKjN/ubSo95WNwg5gVMwqU85hE SOH8OLSHUCDfCryC9X37fr97cG7LQxZyqPRFM7CVNwBnBBTRRQnRJurdzxo4kictKH+J LeWcbtiGzMzFv9sSWgp8auOQRSrLoCj47gLDVihICbwl3i4qUDFGU2pm0Fjd341mKN6A sOt4e4Tu68iyGeJN3FFRk93XVahCECu0I0I0qEriX2HZRvOhh5uH/GJkACt5cMVwK3zF pQtg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=D9NFOsQlacKxT47K5m37PKESge7Ty0qOo9XkZIZOwwc=; b=mJ3A0AUSebEfZAzKL5u9/wLXxE5RnR1vbjyzMs2xRmEinUNlYKiFY9ACXpsjE9RE2U EtoCoVh38AzSSm/cSOl7XQXl/PYinHJAQRFbWffFWxNhiDS1bP8A25nReoDauXJf5utJ xE3GMM8clKuxilJzEIia9m8BaaP/PdCxYc+/+9ILnJkb36xywHlHUqpNEwRbAu74W3yb ZtVorXJCsnTlAz0QJe2IUN9g+/MSZJpm+rB2GjOqIZLr0buj1NRsQGegpGksWjJzGfxa 0Yc4J/phsCuBvCIr9OhJQYXJr2c+7/hcPF41eNUzHcEuBtZ9Swj8WrAG7QLjrrJH7/Oj MWvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot13si12438544pjb.5.2021.05.05.10.02.00; Wed, 05 May 2021 10:02:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237449AbhEERAV (ORCPT + 99 others); Wed, 5 May 2021 13:00:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:35698 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235313AbhEEQvM (ORCPT ); Wed, 5 May 2021 12:51:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E7110AF0E; Wed, 5 May 2021 16:50:14 +0000 (UTC) Date: Wed, 5 May 2021 18:50:13 +0200 From: Borislav Petkov To: Andrew Halaney Cc: Steven Rostedt , Randy Dunlap , akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] init: Print out unknown kernel parameters Message-ID: References: <20210503213400.27360-1-ahalaney@redhat.com> <20210503184606.5e8461c0@gandalf.local.home> <20210504152614.mgiihv4ukqajo3jb@halaneylaptop> <20210505163728.oh7rqpdvxrdilmfk@halaneylaptop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210505163728.oh7rqpdvxrdilmfk@halaneylaptop> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 05, 2021 at 11:37:28AM -0500, Andrew Halaney wrote: > I actually did use that recommendation essentially, the patch I've sent > is riding on the work done by unknown_bootoption() which is populated by > iterating over over the different sections parameters can live in - so > this is only printing out arguments that didn't match a known kernel > parameter. Sorry if I didn't make that clear earlier, definitely was > trying to listen to your advice. Bah, don't take my "advice" too seriously - I'm just throwing out guesses. :-) So ok, unknown_bootoption() handles those and AFAICT, that gets passed to parse_args() with the __start___param and __stop___param range. But then there is that do_early_param() thing for early params, which are different and which are between __setup_start and __setup_end - i.e., the ones I meant above. And that function doesn't do the unknown bootoption handling ;-\ More fun. > I'll have to think about this some more (the "did you mean this > parameter" part).. that seems like it might be more trouble than it is > worth, but I admittedly haven't looked into those cheap algorithms you > mentioned yet. The reason I say it might be more trouble than it is > worth is because it is easy to say "why didn't my param work", then grep > for it in dmesg and find it in the "Unknown command line parameters" > list - that's sort of the workflow I imagined would happen when someone > mucks with their kernel cli and doesn't get the intended result. Oh sure - that's what I meant with "cheap". If it can't be done elegantly and easily, just forget it. dmesg | grep is a lot easier. :-) Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg