Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3909510pxj; Tue, 15 Jun 2021 11:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCr8iRuJ7ya1/HQtJw3P4yC/JJ7FtxEHRlLgA3sl/SlZwesCvHgzr1C1M/DQd3YM1TN8RT X-Received: by 2002:a5e:df42:: with SMTP id g2mr483596ioq.166.1623780708929; Tue, 15 Jun 2021 11:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623780708; cv=none; d=google.com; s=arc-20160816; b=x3KT4ITjer0+dXYEtO7WdqxaaPBjhARj7KIr9AKmBU9WXmcKQYZfpgHKbY2MBmuUxy SWkBqgIDHhUiNUD1BVgHdcLlJgJNcF7aEjXWMeiPiS/LjXTMvkyKsk8Pjbz/SAZAyvKv 5SuuzxaO2Q7lACjdZXu3KvMtFXh6Z/aWKpu/RMerLBlwEsnkwVTuzx26mzaNKsZkODUd iWiIHzo6t54lvlCZhD58OMoDRVuTutJow2CAykhvPYyBQ+PuptSPofwIlAvaeSJ2Bh1G B0wQp4OdaRbqlEUq8H92AyKEJEaQJSqVDTNnuy6qB4MSzpRrnqdR6TJ/7WbTXllAjxfG 7CEA== 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:ironport-sdr:ironport-sdr; bh=4ec5/zp7j7+z0NIF5CTfEn/ZZgFxZ5IW5D7KmbmI5Wg=; b=NIX4PNP07e5rmPTrzaCVaAMsxhw1aKCK13tkJSXKSc2/hgqZ5GePGXomKC05rbRqzZ 9k7RyvmZE5KpXaonwrXmpW1GEZ4QzmfQZIIbmic0JquIMmqUva3baWFK2qJV/IvyA95b 8Ps8eAEPTo/j0JOJCj3ZWC0snjbAuKkLQ3F5JCjhrCQWC1AW96TSBefGs23DKxBIl5oT JSaWkVkd4HEofVUYKIlz0yRZozwHGf5/BVOmZSZyIpt8nyin98RUIWH8l84IyAoCz5HZ urj9xI+I9O/ywRRXc4bIhpCaIqCWwmR4J04HK6qIaFom4xrgGnxe3LdgxsWFpVNgAH3Z s61g== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si13482786jaj.46.2021.06.15.11.11.34; Tue, 15 Jun 2021 11:11:48 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhFOSLU (ORCPT + 99 others); Tue, 15 Jun 2021 14:11:20 -0400 Received: from mga04.intel.com ([192.55.52.120]:8557 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231388AbhFOSLR (ORCPT ); Tue, 15 Jun 2021 14:11:17 -0400 IronPort-SDR: DgBN2PPNoiT6asw+rlgkLbxt55ybJszkPPN5ajalZkkfRJFA/FL6asfrdyQopn3kWQabEYk/MR VXc4wCkff/hA== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="204214845" X-IronPort-AV: E=Sophos;i="5.83,275,1616482800"; d="scan'208";a="204214845" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 11:09:12 -0700 IronPort-SDR: WM91ExTKNFaPBV41HRFQh0uyAnxlBkylfxhahAd+UNc3mWLPvPH50KyiWIuMxo+/HM367/ATHO Eua1+24Eo9nA== X-IronPort-AV: E=Sophos;i="5.83,275,1616482800"; d="scan'208";a="554528877" Received: from rchatre-mobl3.amr.corp.intel.com (HELO [10.212.184.247]) ([10.212.184.247]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2021 11:09:11 -0700 Subject: Re: [PATCH v4 18/24] x86/resctrl: Make ctrlval arrays the same size To: James Morse , 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: Reinette Chatre Message-ID: Date: Tue, 15 Jun 2021 11:09:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210614200941.12383-19-james.morse@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, 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. > 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 ? Reinette