Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2487784rwl; Fri, 6 Jan 2023 07:07:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXsVYPqVEpaW1HJeaWDOLdEtPXqX0u1aI/Knpf34fGNA3lF67Wj+2tOEeh1DUZuTFkcez7Mt X-Received: by 2002:a17:907:6e16:b0:7c1:b64:e290 with SMTP id sd22-20020a1709076e1600b007c10b64e290mr84802256ejc.45.1673017666125; Fri, 06 Jan 2023 07:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673017666; cv=none; d=google.com; s=arc-20160816; b=WhganupZTDryV5dA94Qz712+VoHzpk4RMvigb534PIQ3VXbIf19FCRa+OJn3uLxVqh 2FZJyepHC9URO6Nm2btqBToxJGA5jNwKfX6f4jUL3IOCSoiNXEQu1gJuP0tVB+xh+nlH A7VlRAUTCw/ql7Su5TV6oboQLyZgYRmC/CFo9sdCIVmPP4winGJK7XN/ZX9cac11+YUw WmtahJ25W2yEfKtWSErBq0yiiy5ORIhQeRkv6IPzeEZtCtzLt+QThfq9J1mRmwGYnrbN Dh0Ua6O7iJB6jLwDT+mP5OYs780E6mU4FY1qAxvmva46w/vLd1h6jpyASUSBVsjnM07C pB+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KS9mdKU9dFFTpbklIwhtsJi30Jb2UrpxuMcaonGHjXk=; b=ScvjQKicTZIlVFWwdBSq6tZAupYo4NWIdpCET/cSaglG+AqFj8GtoVdNrR/DoehCHW I9rWl/jFMjhxdfPWMOkRXkwcBRZ5UzWv1JbZ0HIUud/sB9M8N2CKPPadB9HBxFESd5NB 1mwt1H2DC5Os6jwVOj+Cgkx1ZPaS5xC5QqL01g2lXtvMpS2elIc8zn5vMltkpUudhoS2 uSkG+U1HpfC1bItEiy9Of+nrGxPEpiB1PUj0pQOzavkSCRfkRocZBHcFyV4moWXih7lL FUWT3fy+VH4Mng+s1Vb8vLQwPPO2/hRzii48elUeRRhcoPXtV4gz8yV48GUP0b0fJkpC ZcOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VfCItclP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a170906795200b0078266dc4b8csi1940575ejo.719.2023.01.06.07.07.32; Fri, 06 Jan 2023 07:07:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VfCItclP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235127AbjAFOvR (ORCPT + 56 others); Fri, 6 Jan 2023 09:51:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234652AbjAFOur (ORCPT ); Fri, 6 Jan 2023 09:50:47 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464544319B; Fri, 6 Jan 2023 06:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673016647; x=1704552647; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=5BzoGa93/OVMZ6VfRHCQ/6WaBQK1UUhnnBhcz48iiWQ=; b=VfCItclPbii5kVDUyPwnWAeKde1/X5ulj9NQFagApUMPPbp1a2JeEdaF Dl/uYeAoJY51vqA4qc1KV8x/XhL9a3MCFnvaOh+clF0FbMryuco4jbSBV oBQbLLrGjx2WMMCy8w9izAMqFM82HsoIchZHH7lk66L0oGPfacgxwlTX7 j6ASQSgZV/RJURADa255WIcOfwxxxFaWcbXp4EpJicA2gDBMeSRNEsnn/ NURdMFGV5KtGy/sCnpvhFLBCDd1MK3RYxr9XeztwA8w1WEKwN93br109O ZUADiJozWshFaZf45j/nQRXWBvNfyKOE0q+xqhILMyXZx6o6JxMQ90JjQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10582"; a="302852687" X-IronPort-AV: E=Sophos;i="5.96,305,1665471600"; d="scan'208";a="302852687" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 06:50:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10582"; a="724458448" X-IronPort-AV: E=Sophos;i="5.96,305,1665471600"; d="scan'208";a="724458448" Received: from xiangyuy-mobl.amr.corp.intel.com (HELO [10.212.251.186]) ([10.212.251.186]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 06:50:46 -0800 Message-ID: Date: Fri, 6 Jan 2023 06:50:45 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake Content-Language: en-US To: "Zhang, Rui" , "bp@alien8.de" Cc: "ak@linux.intel.com" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "peterz@infradead.org" , "linux-perf-users@vger.kernel.org" , "mingo@redhat.com" , "tglx@linutronix.de" , "kan.liang@linux.intel.com" , "Bityutskiy, Artem" , "linux-kernel@vger.kernel.org" References: <20230104145831.25498-1-rui.zhang@intel.com> <25d07838-3904-a086-4238-f56c9424b53a@intel.com> <4cc5cd868b20366fc9d4bf157656e0c295074282.camel@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/6/23 06:38, Zhang, Rui wrote: > My original proposal is that, instead of maintaining model lists in a > series of different drivers, can we use feature flags instead, and > maintain them in a central place instead of different drivers. say, > something like > > static const struct x86_cpu_id intel_pm_features[] __initconst = { > X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, X86_FEATURE_RAPL | X86_FEATURE_TCC_COOLING), > X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, X86_FEATURE_RAPL | X86_FEATURE_UNCORE_FREQ), > ... > X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, X86_FEATURE_RAPL | X86_FEATURE_TCC_COOLING), > X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, X86_FEATURE_RAPL | X86_FEATURE_UNCORE_FREQ), > ... > {}, > }; > And then set the feature flags based on this, and make the drivers test > the feature flags. That works if you have very few features. SKYLAKE_X looks to have on the order of 15 model-specific features, or at least references in the code. That means that the X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, ... list goes on for 15 features. It's even worse than that because you'd *like* to be able to scan up and down the list looking for, say, "all the CPUs that support RAPL". But, if you do that, you actually need a table -- a really wide table -- for *all* the features and a column for each. What we have now isn't bad. The only real way to fix this is to have the features enumerated *properly*, aka. architecturally. I get it, Intel doesn't want to dedicate CPUID bits and architecture to one-offs. But, at the point that there are a dozen CPU models across three or four different CPU generations, it's time to revisit it. Could you help our colleagues revisit it, please?