Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2074104ybk; Mon, 11 May 2020 11:17:05 -0700 (PDT) X-Google-Smtp-Source: APiQypLTV1bkbHkoNeexpKdNEy2KA+tOMxYRhCCL8/aaM2e0fUtLNZwYK5NKHYujCOo+bkTY7BO5 X-Received: by 2002:a17:906:4a82:: with SMTP id x2mr12880604eju.194.1589221025255; Mon, 11 May 2020 11:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589221025; cv=none; d=google.com; s=arc-20160816; b=LkUFXUhEOEgYd2tCZh5y2An+rRy+us+cN030/NUureMrwjmq/iH+9L/m5yzXmS7/D2 fwHHe42M8N+uoALLyShXSgvrsSO9Jbx1Qx6OP9kp+zlXRBlkbCKBtnNLEMoYaMgqQEiP sTrqaPSRFYzTbSNoJnWMcDiKFfotl2bbM2Ra64edmz5RhfQek6msd8eAfj3QMm+L9Idm K82Otrpa41WbMZGHaF3zbRUndO6coiYRqRyan3iKTTcDOUFDnfdxy1NIe3oso3U9imX/ 32qjPhavGAgIbr8WOnPASrvkq5hGwt1fkEbP+al1L49qyfbplAKvdBTVYtt+ZjU7cXnk YNhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=Bb59hf+R5r8ZU/16xp+Mg3j8+BychhpcKUTqwi3zSTw=; b=YHfobLhDwWGN0fgrRJXI/9Qv+aqONuUe0BlgyflwbX2oql7MTXWYpMmMBk6EVB56yf 5c1oBIXcDNE8+msyqmyhpuFKy6uA9tX4jAvaagVc9dJ4lMPEbm2+C1e1OL3Ys6eKwRJf T6J5xkWseVO6ETGMrFEtCTVcQCohHM2Q3XNaj4VSRKpsA/9iMp/1UHlZ1V9sv5a3oMqX k09Pcuzw/9wanPR5kxnrIZHMnNmdePw2gMV2Mkmv32Co+2DpmrfGWpiyJTc1soo9A4DT T7G0YZ/EKZVOAfA/Xs6o5h5DO/6ezqVZEm4pGvu18SXnG4ilD58BkrJnbEJnSDzNgv3p 8RFg== 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 n12si6929705edo.392.2020.05.11.11.16.41; Mon, 11 May 2020 11:17:05 -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 S1729747AbgEKSPA (ORCPT + 99 others); Mon, 11 May 2020 14:15:00 -0400 Received: from mga06.intel.com ([134.134.136.31]:48472 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729673AbgEKSO7 (ORCPT ); Mon, 11 May 2020 14:14:59 -0400 IronPort-SDR: sUAk0p1aeW/MFSEKzEXBwTFjcaBUwvxKeJUhwM6K6/LP3ZjrYL8LbLDCr1uXJg3hits8GyIaQW wobFUbridamg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 11:14:58 -0700 IronPort-SDR: BpkxzblzM2I1siBJKtycZz+TxOlbj8w5qCdZbj8vzlbHy6R/TrVYfwAIndohx7bWNz5Jz4keiU hfre976NkXeA== X-IronPort-AV: E=Sophos;i="5.73,380,1583222400"; d="scan'208";a="409004530" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.254.97.196]) ([10.254.97.196]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 11:14:58 -0700 Subject: Re: [PATCH v2 09/10] x86/resctrl: Add arch_has_sparse_bitmaps to explain AMD/Intel CAT difference 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 References: <20200430170400.21501-1-james.morse@arm.com> <20200430170400.21501-10-james.morse@arm.com> From: Reinette Chatre Message-ID: <8383ddd9-5849-d948-c391-aeb0cc927423@intel.com> Date: Mon, 11 May 2020 11:14:57 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200430170400.21501-10-james.morse@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, On 4/30/2020 10:03 AM, James Morse wrote: > Intel expects the cache bitmap provided by user-space to have on a > single span of 1s, whereas AMD can support bitmaps like 0xf00f. > Arm's MPAM support also allows sparse bitmaps. > > To move resctrl out to /fs/ we need to explain platform differences > like this. Add a resource property arch_has_sparse_bitmaps. Test this > around the 'non-consecutive' test in cbm_validate(). > > Merging the validate calls causes AMD top gain the min_cbm_bits test > needed for Haswell, but as it always sets this value to 1, it will > never match. > > CC: Babu Moger > Signed-off-by: James Morse > Reviewed-by: Reinette Chatre The Intel bits do indeed look good to me but we should check the AMD portion ... I peeked at the AMD spec [1] and found "If an L3_MASK_n register is programmed with all 0’s, that COS will be prevented from allocating any lines in the L3 cache" ... so AMD does allow bitmasks of all 0's (Intel does not). Does MPAM also allow all 0's? Perhaps "arch_has_sparse_bitmaps" can be used to indicate that also? Reinette [1] https://developer.amd.com/wp-content/resources/56375.pdf