Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3554594rdh; Thu, 28 Sep 2023 15:41:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRZkcnsHmcw4SHwxnStm4xr3cAG1LlYolBYRNVajeiE4WFmAK29Gi9TvanEs2LTagweQxS X-Received: by 2002:a05:6830:1693:b0:6b9:8357:61e6 with SMTP id k19-20020a056830169300b006b9835761e6mr2629934otr.35.1695940882781; Thu, 28 Sep 2023 15:41:22 -0700 (PDT) Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id cd10-20020a056a00420a00b006875398611csi19205348pfb.80.2023.09.28.15.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Zo2lCtjM; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 649768292A5E; Thu, 28 Sep 2023 08:54:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231875AbjI1PyR (ORCPT + 99 others); Thu, 28 Sep 2023 11:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjI1PyR (ORCPT ); Thu, 28 Sep 2023 11:54:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33669B7 for ; Thu, 28 Sep 2023 08:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695916455; x=1727452455; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=ylUZIRaAaQTu3xzBYTIxJQba7FBfSxZ4R8/3JLk85iM=; b=Zo2lCtjMXCnkStBRo+OumKR/N8fcG/kfI4M9EmhelZd4lG6mpPngbgb6 mL2h07WJKd5dCnSPCf+GDTgQfwJyBVGeIxy0wFApn4CbPRxKv9ZsMU/kx 0HqUJ1m6hYNKHd5my35Grg29IoiGTL4lnPVZhbrjCPd3RVquvzcdpql6w nzo9Ko3PWqUk+S/3oWuHh6zjSOY1irpUGcayY16Nw48tSv74dJhmcWGKg ajLJ7p4En1WEkkd7i0JfcP1wY7o3xOtBf7CnEdjlgUrJ8ABCKbvNlAAw0 xRkdce+NVpp6w1nHXjttSuiRLG7pDnIpEI5LqWs4fkUAp4WfMLudpidAr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="384907079" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="384907079" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 08:54:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="726277007" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="726277007" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 28 Sep 2023 08:54:00 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 28 Sep 2023 08:54:00 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Thu, 28 Sep 2023 08:54:00 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Thu, 28 Sep 2023 08:54:00 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Thu, 28 Sep 2023 08:53:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IbjJ4rGF5eOx2qONvNCCUyGc6vivsln40/9OisBbFyEqsKXUvZxg3Hzj0h+o2xoHiJzJaXMlmsl4OYn8yA+N0pQ1eMSPjW+modcjyC+YIbr0WrnN0yMeCPQ116E8daG9/YoShXtlWOlyMtM4D4jEx/S0OM44FYKQLgE2f70ZUxx73R1CZ7+NkOS6mE+3V6ygni31+CTp9okt4DCKxdJ3WMWu6U42S08Aplv7sTAADKlVm4vtO0Dv8yPq8g1cNohUSSYVsNNHafTwNGGAAevyCWj48F8uXIlo/JubcYBIe6TbFaNIiqGxC++DegcuNRkdbIqdlKsBNwhb+A/uSI+5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OC6FZFLDiB50lNnUJchw6Dvmc5LW0WMvHOOjeYnhMiM=; b=PE9UixpNHekhCRr6J8WSR2O8y/litoqs7ecWuX/cg0sJd+2OSKaZsoo5GAhuuvwGkfVgdApsMGNFgumINvubRRUh2Ylwq4y6pVTozgoMPIrOrlEP0hy1E/zVy9zb6ydN3YiZ/50cfDaoim18uAaHcDKf3aelWLA4+dDR7dQpRJjlz8W1ezwUHaDsjulrifY9N6Dv7q/m/Cnx86Q8KqX4NAt1GEOcaz69cJZFtU2eu6MQ3ImxOC0m06ywRMVsDqmNFAtBb/adGsyzHJuaf2OxgBZo8XJV76nwOUiuBsARsd1gmV+NCzoKdreD12dCqhqMwHly2K0s6sMimhS+CDRYqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) by SN7PR11MB6775.namprd11.prod.outlook.com (2603:10b6:806:264::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Thu, 28 Sep 2023 15:53:57 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::bd70:f215:4a97:c84e%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 15:53:57 +0000 Message-ID: <8a5d1211-8acb-762d-ae36-bf508b082ef4@intel.com> Date: Thu, 28 Sep 2023 08:53:54 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [PATCH v2 1/4] x86/resctrl: Enable non-contiguous bits in Intel CAT Content-Language: en-US To: , =?UTF-8?Q?Maciej_Wiecz=c3=b3r-Retman?= CC: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , References: <918e147601697b1d4b8f8589f5751e05d6ceccdf.1695371055.git.maciej.wieczor-retman@intel.com> <9751cbaf-8653-d32a-6058-13c251c59b3d@amd.com> <4sxjxe4cgvookcobwbrmsoeszjordi3bpjg22zxut3lanjc46j@xpqt6nblx6uc> <13b360ac-4292-5056-6d00-6eb1d4186b11@amd.com> From: Reinette Chatre In-Reply-To: <13b360ac-4292-5056-6d00-6eb1d4186b11@amd.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MW2PR16CA0053.namprd16.prod.outlook.com (2603:10b6:907:1::30) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|SN7PR11MB6775:EE_ X-MS-Office365-Filtering-Correlation-Id: ffe572af-ee60-4fa5-13b0-08dbc03b200f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jFdlyVmLrHt3u4v/TWjlhLlGOK8sf/FiGB2ADpCjsfJexyg9HenVKfP8RDEGvZmp782EFi+KPkmkCNv5eouWG8wgHcfdoLxBUaYPSsAruD3AZ5YB0BcibMiXjWXyHLALC0SxAng0kca0I8f7gc6kVeZaXlCxk1D3RRZRCqt6fHnpmgBsMoatrqfIpZBbp+JKrmF4jCKkXCL2fANKSVpDemJsaQAsLIbOjJmINWlKJnmoIOVlKIjsoa0/ueWw7OHwegtqdvBHABWtDnWoXd0euGNdQe1K5Gd1B+glPi/AwMfQq7dFJgOaXFiYpGht4nV7Ed2gDw6xvxonV3fKja4b1tCRcb3x7xLAUnoe369orzT+i89SKpLmvreHu3FhWWHtikZWsyvzGXy3iHDIczkh4ZjryhVIOy5JuET6C0UnXY5paiHQECJX/7VyK19abC3uo+qEidmR/HDa2AT27+MF37O688MWSzgWjiOWutgewfVlX868w9gowXNc9nIxzSrMFlX6cKt7CIGtZz6aRIIxTzbDz8y8kcCF3Y3QT9DbN4khP5kV10vUAnoPm7qH2yCcebrfgjH7+vmcyPa2Aj915OdizBsvEvGBWxKSucuaQeaNa4AY92aOLJXdSZNai+gC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(39860400002)(366004)(136003)(396003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(2906002)(6666004)(31696002)(44832011)(5660300002)(31686004)(66476007)(86362001)(6862004)(54906003)(36756003)(6636002)(8676002)(41300700001)(8936002)(66946007)(66556008)(4326008)(83380400001)(316002)(2616005)(26005)(478600001)(37006003)(966005)(53546011)(66574015)(38100700002)(6506007)(82960400001)(6512007)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RGhTNG41d25Bem92Njh6UHpEZEY1VXcvbU9HWXFicHNKb1VmcXVCTGZVV2I1?= =?utf-8?B?UDBvUDJEQVRHTGg4YUFHR3I2MFdHZUJ5eVpXUWUvRkU0TmQ2WkpCcTF4Rnp0?= =?utf-8?B?VWZpdDBMTXBPbTBRYTJwRmozQ29SRzFScmgvRWxOZ1hIcnNrRTQ2V0J4L2Fj?= =?utf-8?B?OHZVZTJlQ3hjNFBDWFgzVnBTSEJHQ2EzRXlxdFV2UHBtZWkxWjI0OUhwWmE2?= =?utf-8?B?dUVHeW55TkZQdkVBL1pPQm9qWS9VTnQveTJRVjlGZzJqN2JvSFRyakV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h6Mmx3TTlEWUxpNEUvTDliczdoeXVOTFFUWmRPNnkxU252WFdV?= =?utf-8?B?czhybExvc0FaY3BXRWtteUFpUmF2UHpjU2lTTFlMY1JESndQdXBVSm5xWW15?= =?utf-8?B?cUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: ffe572af-ee60-4fa5-13b0-08dbc03b200f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 15:53:57.7868 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vjV/koeR/K+WoTUurxStVI6krYYpgdt1RUg7kGct+jKe7F3CMrkCIGdDzesxL138qjD0CdhwT1d/IcEeH6Ozpg7XrdpA1/xtZfBIXuJaL6k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB6775 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 28 Sep 2023 08:54:34 -0700 (PDT) Hi Babu, On 9/28/2023 8:08 AM, Moger, Babu wrote: > On 9/28/23 02:06, Maciej Wieczór-Retman wrote: >> On 2023-09-27 at 17:34:27 -0500, Moger, Babu wrote: >>> On 9/22/2023 3:48 AM, Maciej Wieczor-Retman wrote: ... >>>> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c >>>> index 030d3b409768..c783a873147c 100644 >>>> --- a/arch/x86/kernel/cpu/resctrl/core.c >>>> +++ b/arch/x86/kernel/cpu/resctrl/core.c >>>> @@ -152,6 +152,7 @@ static inline void cache_alloc_hsw_probe(void) >>>> r->cache.cbm_len = 20; >>>> r->cache.shareable_bits = 0xc0000; >>>> r->cache.min_cbm_bits = 2; >>>> + r->cache.arch_has_sparse_bitmaps = false; >>> >>> Is this change required? >>> >>> This is always set to false in rdt_init_res_defs_intel(). >> >> The logic behind moving this variable initialization from >> rdt_init_res_defs_intel() into both cache_alloc_hsw_probe() and >> rdt_get_cache_alloc_cfg() is that the variable doesn't really have a >> default value anymore. It used to when the CPUID.0x10.1:ECX[3] and >> CPUID.0x10.2:ECX[3] bits were reserved. >> >> Now for the general case the variable is dependent on CPUID output. >> And only for Haswell case it needs to be hardcoded to "false", so the >> assignment makes more sense in Haswell probe rather than in the default >> section. > > Here is the current sequence order with your change. > > 1. > resctrl_late_init -> check_quirks -> __check_quirks_intel -> > cache_alloc_hsw_probe > r->cache.arch_has_sparse_bitmaps = false; (new code) > > 2. resctrl_late_init -> rdt_init_res_defs -> rdt_init_res_defs_intel > r->cache.arch_has_sparse_bitmaps = false; (old code) > > 3. resctrl_late_init -> get_rdt_resources -> get_rdt_alloc_resources -> > rdt_get_cache_alloc_cfg > r->cache.arch_has_sparse_bitmaps = ecx.split.noncont; (new code) > > The code in (3) is going to overwrite whatever is set in (1) or (2). > > I would say you can just remove initialization in both (1) and (2). That > makes the code clearer to me. I assume reserved bits in Intel is always 0. > I believe Maciej already addressed this in his response to a similar question from Peter. Please see: https://lore.kernel.org/lkml/xnjmmsj5pjskbqeynor2ztha5dmkhxa44j764ohtjhtywy7idb@soobjiql4liy/ Reinette