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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA2B5C2B9F4 for ; Thu, 17 Jun 2021 17:03:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F382613C1 for ; Thu, 17 Jun 2021 17:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbhFQRF2 (ORCPT ); Thu, 17 Jun 2021 13:05:28 -0400 Received: from foss.arm.com ([217.140.110.172]:56756 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhFQRFW (ORCPT ); Thu, 17 Jun 2021 13:05:22 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0A7CC13D5; Thu, 17 Jun 2021 10:03:14 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A2223F694; Thu, 17 Jun 2021 10:03:12 -0700 (PDT) Subject: Re: [PATCH v4 18/24] x86/resctrl: Make ctrlval arrays the same size To: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com References: <20210614200941.12383-1-james.morse@arm.com> <20210614200941.12383-19-james.morse@arm.com> From: James Morse Message-ID: <46b42971-724c-c585-efec-c824838d7434@arm.com> Date: Thu, 17 Jun 2021 18:03:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 15/06/2021 19:09, Reinette Chatre wrote: > On 6/14/2021 1:09 PM, James Morse wrote: >> The CODE and DATA resources report a num_closid that is half the >> actual size supported by the hardware. This behaviour is visible >> to user-space when CDP is enabled. >> The CODE and DATA resources have their own ctrlval arrays which are half >> the size of the underlying hardware because num_closid was already >> adjusted. One holds the odd configurations values, the other even. >> >> Before the CDP resources can be merged, the 'half the closids' >> behaviour needs to be implemented by schemata_list_create(), but >> this causes the ctrl_val[] array to be full sized. >> >> Remove the logic from the architecture specific rdt_get_cdp_config() >> setup, and add it to schemata_list_create(). Functions that >> walk take num_closid directly from struct rdt_hw_resource also > > This is unclear to me ... "Functions that walk ..." seems like it is missing to describe > what they are walking. Yup, I'm missing at least a word here! Fixed as: | functions that walk all the configurations, such as domain_setup_ctrlval() and | reset_all_ctrls() , take the num_closids directly from... >> have to halve num_closid as only the lower half of each array is >> in use. domain_setup_ctrlval() and reset_all_ctrls() both copy >> struct rdt_hw_resource's num_closid to a struct msr_param. Correct >> the value here. This is temporary as a subsequent patch will merge >> the all three ctrl_val[] arrays such that when CDP is in use, the > > the all three -> all three ? Yes. Thanks! (I've never managed to spot things like this in text I wrote) Thanks, James