Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2550312pxb; Sun, 24 Jan 2021 11:03:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI9I7ieHjCkKjbi0hQQruI83cziN14rTuiS8MWYhbFxNogDwNws4vb843jfVCbsfgOZ7DT X-Received: by 2002:a50:d888:: with SMTP id p8mr297306edj.147.1611515010038; Sun, 24 Jan 2021 11:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611515010; cv=none; d=google.com; s=arc-20160816; b=Rb23/TerEOLiYcZnXDWzON97UCf55tR501npvisNFGWQYGDTnbEt9iWRPa2Tzfx4fw 9frSx+zpyoSAlAx38FH+yixsBB7QD/hgFyfIkA2eWGn+4oezQroxPMKmLKV98vsOvNsZ yzDKj79sV3GDyot2PZPLthAS2AsP2qI/7im+noduRoJWUWbjn44+y+OES4uFMdXcCkv1 mDheqosS9W/O4TbT1gQZ4T/TACQfB3sDOuTkj1rFL4TOFGe2J0b3VXOw2FBj5szYbPl/ YQRC899JBsdZcpzK3e9uaaPUrCun1E8uNE2y+shxhHiXlWatf3Jeq/GcFGFVz9MipNjQ xBpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=390klXntTyzADdcYSiU7jUixNmbaaKXEs4InAvaWm+s=; b=wLnX35WswSOHcwtLKA06Djfg6Rt20W+pWzI88/2ZnBQXoiBhbv/O5yB0KiDai3LEgA ikI2I+0nh3Zet260C0VAPIcJZemeTWRt8+7pCztvYtvZ48HSSsqMuwagk+8D7a2BvOCh 18GkgCCxOGzRhOowN6xC+pRGnUyA4Wgsk9b4ORGgZJ05G63aJYVAcTeLQpzCtPBuOcmu iM6ya4o5rzLHnKaSqXFa0fB/WE4Rhfq/RnF/VRSzkNREzrveUz8EcbQtm5aTjwaZR/yN 1Hz18qvYyCw+BOXWqjpqYTcsP+oJJqXqtS4VoPBw1fQbe160ikyVCBR6dGyyVqoZoEbl vthg== 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; 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 k22si5295861ejs.273.2021.01.24.11.03.05; Sun, 24 Jan 2021 11:03:30 -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; 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 S1726529AbhAXTCg (ORCPT + 99 others); Sun, 24 Jan 2021 14:02:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:37982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbhAXTCc (ORCPT ); Sun, 24 Jan 2021 14:02:32 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 E0AD122CF6; Sun, 24 Jan 2021 19:01:51 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l3kdx-009lho-MZ; Sun, 24 Jan 2021 19:01:49 +0000 Date: Sun, 24 Jan 2021 19:01:48 +0000 Message-ID: <87r1majh0j.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Alexandru Elisei , Ard Biesheuvel , Jing Zhang , Ajay Patil , Prasad Sodagudi , Srinivas Ramana , James Morse , Julien Thierry , Suzuki K Poulose , kernel-team@android.com Subject: Re: [PATCH v4 15/21] arm64: Add an aliasing facility for the idreg override In-Reply-To: <20210118131839.7ao33jeufq3dfnb4@google.com> References: <20210118094533.2874082-1-maz@kernel.org> <20210118094533.2874082-16-maz@kernel.org> <20210118131839.7ao33jeufq3dfnb4@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, alexandru.elisei@arm.com, ardb@kernel.org, jingzhangos@google.com, pajay@qti.qualcomm.com, psodagud@codeaurora.org, sramana@codeaurora.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jan 2021 13:18:39 +0000, David Brazdil wrote: > > On Mon, Jan 18, 2021 at 09:45:27AM +0000, Marc Zyngier wrote: > > In order to map the override of idregs to options that a user > > can easily understand, let's introduce yet another option > > array, which maps an option to the corresponding idreg options. > > > > Signed-off-by: Marc Zyngier > Acked-by: David Brazdil > > > --- > > arch/arm64/kernel/idreg-override.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c > > index 75d9845f489b..16bc8b3b93ae 100644 > > --- a/arch/arm64/kernel/idreg-override.c > > +++ b/arch/arm64/kernel/idreg-override.c > > @@ -37,6 +37,12 @@ static const struct reg_desc * const regs[] __initdata = { > > &mmfr1, > > }; > > > > +static const struct { > > + const char * const alias; > > + const char * const feature; > > +} aliases[] __initdata = { > > +}; > > + > > static int __init find_field(const char *cmdline, const struct reg_desc *reg, > > int f, u64 *v) > > { > > @@ -80,6 +86,18 @@ static void __init match_options(const char *cmdline) > > } > > } > > > > +static __init void match_aliases(const char *cmdline) > > +{ > > + int i; > > + > > + for (i = 0; i < ARRAY_SIZE(aliases); i++) { > > + char *str = strstr(cmdline, aliases[i].alias); > > + > > + if ((str == cmdline || (str > cmdline && *(str - 1) == ' '))) > > nit: Extract to a 'cmdline_contains' helper? Took me a good few seconds to > parse this in the previous patch. Giving it a name would help, and now it's > also shared. Good point. Adopted! Thanks, M. -- Without deviation from the norm, progress is not possible.