Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp626434pxj; Thu, 17 Jun 2021 10:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMCfGm0brH5ytqa1yQ/MwgrSJx7KpZK9M+t4hoyGY7TcdlrSvMQEtV/HKRwSEFQXNEW4ju X-Received: by 2002:a6b:e303:: with SMTP id u3mr4862806ioc.177.1623949497982; Thu, 17 Jun 2021 10:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623949497; cv=none; d=google.com; s=arc-20160816; b=D9ok9V7C79WHMItIsnAQaR4jyTgGQFX6YhtaziFMZ3HWmi+Yim0x1EYgeWy19R8BQg JIGk1BwQilDQg3MOWOUm3Q20pOrwYyFQ3PPZqyAOO3zEjB08GKKWX3oeU/MQ95Mra5ir WY4pT1TxFximYsDxTG9NN8y8N2yehxRxelFKPC846qqs1w+VoCxAX44bdS7nZtAfBgJr 6awWikn907sVP9bI2YBVzChcrg9ejzX4Z0Ugzz342dtSq9GW3HxXa8f99dbhfR0ZanSv FIySLkP7UC+G6zVVhFic7fH7h1/OdJShFj1gPT0HM23y2TAnAIbz4wNuzxr5Sarokawe PIQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3vAnIQHSRLWeDwgIhv4CglA+NzUCIXVBSxyzSYMAd1g=; b=XDEtQn6t7TQ0Q1TW/YEC/ovu+TmCvmThWNZef9br1kDrMS/jkBRtMzCi4awlAUFnxZ Az16dFGA3zBk4opAo7+H0ucL22ByqsmvVd/Vr4YWiEOQ0XvKa5Eb78Wf4YxkBmr8N93T IdgoDTGqRsPk2SejreKpbhQXrOt5fzoUPb0BDcjW2omQsorDdn4rBfJT3yYRXVYaJDDz Uhxo8nNcsAlijxTxvcJ7oCwB8BRO/1teXqmaNbFf+YPmt70T39fZ3+fw2fdTHS4JxVu6 MjASvLwhVfWVznssc7jsqOoP0iGoc4O3sbRk5CzLdICEXdd3MrTBUXo/NoEtB/cRkD3r /VwA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si7910029ilu.77.2021.06.17.10.04.44; Thu, 17 Jun 2021 10:04:57 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbhFQRF1 (ORCPT + 99 others); Thu, 17 Jun 2021 13:05:27 -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