Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2185149rwl; Fri, 6 Jan 2023 03:08:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXv+JPVdNrM32C0CZQskyi/+ESaoWIos+4wNdT/avJXJaKhwh2OQP/YwWOzpiHULmNlWsYPQ X-Received: by 2002:a17:903:d1:b0:192:b866:f7e0 with SMTP id x17-20020a17090300d100b00192b866f7e0mr21195527plc.60.1673003294213; Fri, 06 Jan 2023 03:08:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673003294; cv=none; d=google.com; s=arc-20160816; b=0szMKe8h+zwg154eC9r//sprGW6bwwVLtRRQWz88iPLwPYDhhcZkXaTJ1YU+zbHhe+ jsp9Rdq/oD1gTakKvI9Uc2+JN/5MaTwRAYIyhmE9VfPO44LAYAWfFijpNkVTUNQ8MmUI zulcdE024HZHGbg3Ffg9svs/ppZLfWA6a2qUFjsy5Nec8EE600NsMJWg6Rdyd6XOhY7o Z2L/8l9QTzgMZOn8wpu/6IPTv8W7nd4EWtvT0Q5Y9E3pnHR6gJEAn/NGezGOEQ3hg22R 8DqGBTCHmuP46PBorWj7jnuqRVYEgC6ONEGOeWKPCSyqBVTzszd7cN+BtKeyFEMJSEkm ZpDg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=/mWOqsJxxhaYX11aVse0gF3iuzzCyD8Tm3ggJlMzbco=; b=iNQNf4A9L5IzbExqcPbb1wvfWvcHHVTvId0BI7aAzf1B0jGufUlcO3iP8H6UWbD9ac HMVrWAC4CDCnSZyiSL+tK7vc6laTcUKjnkeqfv/qnnZIR6RfEDOI+0azmIvUZ5TKd0bu Iqe/jTx/OnTy7ZepgPEZaVwgnCt1V3XatFtq3HZxCltkExQr1aGAXqGc3bJ3oCFYyKH5 AU+JfghVIgpEv06/nw/nD8XPzbzAG5B05imC/WHY2tyfp2tutffuzpApfZzwEcVEci3Z POO3zeV6ZTE+7fkUXvle9umNtTG3xf8W+T/EXmQvr2S/xMiB99Vuxk1EKkFUYhSEwA+w TFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZdC9rjcx; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k198-20020a633dcf000000b0049b36d5a275si1148155pga.400.2023.01.06.03.08.05; Fri, 06 Jan 2023 03:08:14 -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=@gmail.com header.s=20210112 header.b=ZdC9rjcx; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjAFK43 (ORCPT + 54 others); Fri, 6 Jan 2023 05:56:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjAFK40 (ORCPT ); Fri, 6 Jan 2023 05:56:26 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5769E6B5E5; Fri, 6 Jan 2023 02:56:25 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id t15so927092wro.9; Fri, 06 Jan 2023 02:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=/mWOqsJxxhaYX11aVse0gF3iuzzCyD8Tm3ggJlMzbco=; b=ZdC9rjcxkBTLbJcL5wOAh+p7ibccSZW3xZfYMQrJNhgylswEV01HwZI3we4UYGftLP lTicQNZNzY3Go+TBfhMYpZ6Ug/pCXx0WsLpkCPp5UbyD8Xp0TYj+OD8z9wG7iRdvig+z lOOhLowF7Z+6FTKGeN+6QKNSGwSGKftJbhhWEo2JBlKaAryF+zjiCIcGz/UYeFCwzrIT eUv8y5AuupfuuHqpfYK5cyMzRUs5d1TdsJbR8daja6TjwA/VnJhaG0jFyFeJZVDmkPA9 1EUNt+MAtzVhF+/Bo4fwKvOXeUn3d860SIEm0Qjvh8us/Lr2QQcHw64iX6bmUFxbHKpq 770Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/mWOqsJxxhaYX11aVse0gF3iuzzCyD8Tm3ggJlMzbco=; b=hTu38QrEZ0C5uLq1THTJV1ZqDyTFV6BIBFcMLs1EPIOHOfvXva05JlzoxWLxorSSNo VtRkHq9SsmMbUsgslKgWT5E8A8cjznpBZDqr9oQHUoz8M9rARuHhVRnvflxeI9xyV6SZ sqWcoazG0rhxwB2dxsGDU1BOjOC3lDiK7GAaMX7QBPPdeP6b3MC1nHC3NCUnn32xmgyc hTMRL1IVJUQxu/83HQ3syDzxvDcfv3+MNhE9rte3qEimK2/oX5F8kjWoP98ZCUfPCx1i FuJAOu9f/bPa1qKC9e3CQRq6udeRck6aJtXx8hGlk+YIQ9VdQdyXSZB/vk75R9+WQXEy HR7g== X-Gm-Message-State: AFqh2koEHD6navwwu4SqX6vf5OHD9I1HoScKPTRdNJnxL7elrtuFYkw2 sgq+k7TtHCktYbn4fKXdozo= X-Received: by 2002:adf:fc01:0:b0:297:dd4a:9207 with SMTP id i1-20020adffc01000000b00297dd4a9207mr13817809wrr.10.1673002583921; Fri, 06 Jan 2023 02:56:23 -0800 (PST) Received: from gmail.com (1F2EF380.nat.pool.telekom.hu. [31.46.243.128]) by smtp.gmail.com with ESMTPSA id a11-20020a5d508b000000b002779dab8d85sm854904wrt.8.2023.01.06.02.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 02:56:21 -0800 (PST) Sender: Ingo Molnar Date: Fri, 6 Jan 2023 11:56:18 +0100 From: Ingo Molnar To: Borislav Petkov Cc: "Zhang, Rui" , "Hansen, Dave" , "ak@linux.intel.com" , "x86@kernel.org" , "dave.hansen@linux.intel.com" , "peterz@infradead.org" , "linux-perf-users@vger.kernel.org" , "mingo@redhat.com" , "tglx@linutronix.de" , "kan.liang@linux.intel.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake Message-ID: References: <20230104145831.25498-1-rui.zhang@intel.com> <25d07838-3904-a086-4238-f56c9424b53a@intel.com> <4cc5cd868b20366fc9d4bf157656e0c295074282.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 * Borislav Petkov wrote: > On Fri, Jan 06, 2023 at 06:05:41AM +0000, Zhang, Rui wrote: > > But I still have a question. > > Take RAPL feature for example, the feature is not architectural, > > although 80% of the platforms may follow the same behavior, but there > > are still cases that behave differently. And so far, there are 8 > > different behaviors based on different models. > > > > In this case, can we have several different flags for the RAPL feature > > and make the RAPL driver probe on different RAPL flags? Or else, a > > model list is still needed. > > Well, you asked about detecting CPUs supporting RAPL. > > Now you're asking about different RAPL "subfunctionality" or whatever. > > You could do the synthetic flag for feature detection because apparently > giving it a CPUID flag is soo expensive (/sarcastic eyeroll) and then you > can pick apart subfeatures in the RAPL code and do flags there, away from > the x86 arch code because no one should see that. It's a trade-off in any case: there's a point where quirk flags or even feature flags become harder to read and harder to maintain than cleanly separated per model driver functions. Especially if internally at Intel RAPL functionality is not yet treated as an 'architected' feature, and new aspects are added in a less disciplined fashion ... Sometimes the addition of an 'architected' CPU feature iterates the feature-set non-trivially - as people consider it a last-minute chance to get in their favorite features without having to deal with backwards compatibility ... So I'm somewhat pessimistically leaning towards the current status quo of per model enumeration. Would be glad to be proven wrong too. :-) Thanks, Ingo