From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83914C433EF for ; Wed, 1 Jun 2022 16:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CkWB14EU4qFBoJO0VGgHdM7iXwf8iSmdgSo1JTA/bpA=; b=ur39j1maqLwx0C Qz1NEHmW5qoCVIuUvhlzJBf3w1dH0V50B8SvcE7h5rIZXelsOTbS1E9yzWYR8pCnjbxswqTi3PyXS XP7qIHjDnIDwfndBcvWtvu1DEYpcKvDiC1Hs2ksPT3qfERN+7XHxaLYURce5+l9vkOsEmNSNcqP+V 0AhyZxiDMAMbff2cnrdkzEx2Fd1uCs4lC0wwK75MICjcC9+806OOz7f1gYkhau5sfqIyNZdW32oQc bPz1WIPYBH7b8riehbZ3JCEJM/jk4QvZ2joUQcSPz5hhOzEp5zxNirwOnEQwy7Y3KJ12rmgQbaE/b 2XZnqcjEcvY08GiUWjEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwQw3-00H2Cx-9f; Wed, 01 Jun 2022 16:11:03 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwQw0-00H2CN-26 for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 16:11:01 +0000 Received: by mail-pj1-x1032.google.com with SMTP id gd1so2491522pjb.2 for ; Wed, 01 Jun 2022 09:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wUn7MbvYM0f+kxfgfHr3SU5d8feU3VLIiBAHfTMyhug=; b=zLkZxW5nEzOWq0nFkreNp7O9HcVtER0I/B+1kx1VcF4Of8C6AYIdpcDgOumxlt8rSl lImhOzhgOer/OUquh8fYZlD95VedyN6Mi09Sg5uXLJ1/q2goQIjWUInjuo9EhutI+Lqm NuOSjxhuq1PeErieO6PbDBzb1bnBKxpeYlTIyuFHQlLsWAiUiEpB5DPZHEp8NbBp004O qlqAMGqkzwl9LZOETw9CDCtQmGg0+ZN662poM8atdqtnAVs0MWxV2GNTQVbq3u7AQOzZ yYlqSBvjlJBz6ss/BKtwt9VmwWtRfTD2NEFwl3W08I+VRZBdKGLA2Hj7RwBTd9ClqXSV 8f0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wUn7MbvYM0f+kxfgfHr3SU5d8feU3VLIiBAHfTMyhug=; b=hwJc6kjbmLLIXIUelxwGUC+/jG3njKk/GtGCmMuuidZwu7oy+l+ufZ6C6tXJ5WGqVD a6oMtuLdl4GxDCwC9/jcbL/uAMBr9/4ZjPW+hf4VT2R0XU+GQ8xKLPYPk4zS/cjbaKKI 3Snp7p49BmdgpaPgzpzepS7lMkNLWeHU7jiq+a4bdKvkFnp9iyqpccRpJYjCkGDPODd0 PSAAG8u2NhBpoBra7RlQ7BxsRYID1F6Ehrxbe7BCy1Z1loKjpmkz43Dp88Sm6UNYfxjB axDeQwBpaT41DufaXt1WyGWfCj4B8LpKSNZnSr3TTZY+JaMQGPf/L9cZYGbkPuAHlwG9 OZpA== X-Gm-Message-State: AOAM532ZeL4tmhEYbjTgZ16FW96t3Ns+rTuKY5JbO499eZF4/gd4iUzd 5wMc19E2KS4F9hi7W0Tzog0fhfg+qCR4Hw== X-Google-Smtp-Source: ABdhPJyif3Fv6sOhc57Fe0oW2mgFNRwN3lZPmhRWgxu6gBeJIlJ+RknXnqwYotl8iITrguQIIhmTZg== X-Received: by 2002:a17:90a:86c8:b0:1e6:7147:8b4d with SMTP id y8-20020a17090a86c800b001e671478b4dmr124782pjv.45.1654099858014; Wed, 01 Jun 2022 09:10:58 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id m4-20020a17090ade0400b001d9780b7779sm4010683pjv.15.2022.06.01.09.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 09:10:56 -0700 (PDT) Date: Wed, 1 Jun 2022 10:10:54 -0600 From: Mathieu Poirier To: Mike Leach Cc: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, suzuki.poulose@arm.com, leo.yan@linaro.org Subject: Re: [PATCH v3 4/5] coresight: tools: Add config file write and reader tools Message-ID: <20220601161054.GA577493@p14s> References: <20220414064457.12052-1-mike.leach@linaro.org> <20220414064457.12052-5-mike.leach@linaro.org> <20220527162534.GB360589@p14s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_091100_198721_A1CA3E93 X-CRM114-Status: GOOD ( 37.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [...] > > > diff --git a/tools/include/uapi/coresight-config-uapi.h b/tools/include/uapi/coresight-config-uapi.h > > > new file mode 100644 > > > index 000000000000..d051c01ea982 > > > --- /dev/null > > > +++ b/tools/include/uapi/coresight-config-uapi.h > > > @@ -0,0 +1,76 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 */ > > > +/* > > > + * Copyright (c) 2020 Linaro Limited, All rights reserved. > > > + * Author: Mike Leach > > > + */ > > > + > > > +#ifndef _CORESIGHT_CORESIGHT_CONFIG_UAPI_H > > > +#define _CORESIGHT_CORESIGHT_CONFIG_UAPI_H > > > + > > > +#include > > > +#include > > > + > > > +#include "coresight-config.h" > > > + > > > +/* > > > + * Userspace versions of the configuration and feature descriptors. > > > + * Used in the tools/coresight programs. > > > + * > > > + * Compatible with structures in coresight-config.h for use in > > > + * coresight-config-file.c common reader source file. > > > + */ > > > + > > > +/** > > > + * Device feature descriptor - combination of registers and parameters to > > > + * program a device to implement a specific complex function. > > > + * > > > + * UAPI version - removed kernel constructs. > > > + * > > > + * @name: feature name. > > > + * @description: brief description of the feature. > > > + * @match_flags: matching information if loading into a device > > > + * @nr_params: number of parameters used. > > > + * @params_desc: array of parameters used. > > > + * @nr_regs: number of registers used. > > > + * @regs_desc: array of registers used. > > > + */ > > > +struct cscfg_feature_desc { > > > + const char *name; > > > + const char *description; > > > + u32 match_flags; > > > + int nr_params; > > > + struct cscfg_parameter_desc *params_desc; > > > + int nr_regs; > > > + struct cscfg_regval_desc *regs_desc; > > > +}; > > > + > > > +/** > > > + * Configuration descriptor - describes selectable system configuration. > > > + * > > > + * A configuration describes device features in use, and may provide preset > > > + * values for the parameters in those features. > > > + * > > > + * A single set of presets is the sum of the parameters declared by > > > + * all the features in use - this value is @nr_total_params. > > > + * > > > + * UAPI version - removed kernel constructs. > > > + * > > > + * @name: name of the configuration - used for selection. > > > + * @description: description of the purpose of the configuration. > > > + * @nr_feat_refs: Number of features used in this configuration. > > > + * @feat_ref_names: references to features used in this configuration. > > > + * @nr_presets: Number of sets of presets supplied by this configuration. > > > + * @nr_total_params: Sum of all parameters declared by used features > > > + * @presets: Array of preset values. > > > + */ > > > +struct cscfg_config_desc { > > > + const char *name; > > > + const char *description; > > > + int nr_feat_refs; > > > + const char **feat_ref_names; > > > + int nr_presets; > > > + int nr_total_params; > > > + const u64 *presets; /* nr_presets * nr_total_params */ > > > +}; > > > > I would call the above cscfg_feature_fs_desc and cscfg_config_fs_desc to make > > sure they don't get confused with the kernel's internal structures of the same name. > > > > The issue here is that the common reader code expects structs of these names. > > The alternative was to put multiple #if _KERNEL__ defines in the > middle of the structures in the kernel headers to eliminate kernel > only elements- which you pointed out in your comments to v2 of this > set was a maintenence issue. > > This is a least worst alternative. We have common reader code, there > are minimal changes to the kernel headers - some of the structures in > coresight-config.h are backeted by a __KERNEL__ define but those > without kernel specific elements are used in full. > > The cost is maintaining these two structures to be the same as the > kernel versions - which I believe to be minimal as I do not expect the > data format to change going forwards. > I agree with you - the current implementation is the least intrusive and easiest to maintain. Unless someone finds an alternative it is better to keep the current solution. > > Moreover, I would keep this file private to tools/coresight/ and rename it > > coresight-config.h. > > > > I can and have moved it. > Howver this file includes the kernel coresight-config.h, so renaming > is a non-starter. > Yes, you are correct. > Thanks and Regards > > Mike > > > > + > > > +#endif /* _CORESIGHT_CORESIGHT_CONFIG_UAPI_H */ > > > -- > > > 2.17.1 > > > > > > > -- > Mike Leach > Principal Engineer, ARM Ltd. > Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel