Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp480529rdb; Thu, 1 Feb 2024 14:32:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfyPRCdYz7iTZeEryRurIYe7xGavaCZfpQRQcmKEWl6XxlNESqnmonWoBD2Hdq4e+VhR19 X-Received: by 2002:ac8:5d11:0:b0:42a:b315:190d with SMTP id f17-20020ac85d11000000b0042ab315190dmr326629qtx.17.1706826731870; Thu, 01 Feb 2024 14:32:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpqjLyPWbGTg3ylvpx6eJ3u4PnnpHdoS83WrlpnHRocuHLv7/MdqMu/B/TyrSbpRIaAb4W4s5K2TkGW44hXyUv4dlWXErrbwk2hdO2JQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g1-20020ac87d01000000b0042bf9849fc8si563522qtb.31.2024.02.01.14.32.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 14:32:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RL6+qfpj; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-48945-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48945-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 702951C21C0A for ; Thu, 1 Feb 2024 22:32:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6FEC405DC; Thu, 1 Feb 2024 22:32:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RL6+qfpj" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAFB4405DB for ; Thu, 1 Feb 2024 22:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.15 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706826725; cv=fail; b=L2iMpFhzRuPGrJsB52iY7hn3BbAbJ3felJ5typCB6Da9FBgqfggPadLbmPO20fcdUeOV+N6Nhv5Guy5OnYAcSaxn5RaFOzw21iRBjH56WXM3aPagbqaNHAxW00RE45u4NR7TncsVGJBtlzh9UW0Ygc6WzXt/nOLbyLtjSwG0/Vc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706826725; c=relaxed/simple; bh=sE4ZSpJzu3kTt5XpOc9g1m1GfPUSpduInwdG8KbLJeA=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=suHcRZzzBLF2F8BRAnRKv0u4y+27icPqXzzJeqdD/8XlAp1N6LQ4+qxRHNzaYh90hPmTjusgt12SFsu6aNClEJILBVUlKcsXydyJ3a8j4taG9yPayyTm3S5FJEELxFZR5na9fRsNLtDncZimMrT1RqDfc6Jv+2gNQp9XtV1knQY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RL6+qfpj; arc=fail smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706826724; x=1738362724; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=sE4ZSpJzu3kTt5XpOc9g1m1GfPUSpduInwdG8KbLJeA=; b=RL6+qfpjth4IlQMC4yRF4NlwURjpV/UStjgJ9JiXcDeu7/Vdo8RrQTii Tn9qYS5z87c6e8wm50jHDJuJbWqBZK11zE5nNrmfVNIP+DcwmV4bidUDS IYnegk5/xFxnqozAqa/dA1oAGdQZOfSNXY6gA5CwlqCruk21uOLIjTqSV xOvgq0zEnVBKrgfiEaMQsFq42BwU0TUkzcyUBdOBbo/g2+Aib0yKdurGR vyR6XmwtGr9lvqR0wxajqyf7JKq3OzlRPYGp/IX0stVLM05Pxs0W14/4y U0m/rbelMlZTiFC0XJNM8J4zHeo7bf1lf9Uie+3VspyxdQ+LsBb6xMdam Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="210132" X-IronPort-AV: E=Sophos;i="6.05,236,1701158400"; d="scan'208";a="210132" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 14:31:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,236,1701158400"; d="scan'208";a="216505" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Feb 2024 14:31:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.35; Thu, 1 Feb 2024 14:31:44 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.35; Thu, 1 Feb 2024 14:31:43 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 1 Feb 2024 14:31:43 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.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.35; Thu, 1 Feb 2024 14:31:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcRlf/a5p+hQEvLm02OUPrWKvrl2jCqCOZGisCdOuCfcn+kpN70ZP4VHUikNyyYumxBftBaMMatDHep8ieMVXHJGHXb9yAS1AiOQhpEAPswSBmx1ykXM3QBuMVkMKglXfFpOljd/DVUfPFtNfiri2poF89QxwCMhy+712w7Sx/2C7BEphL+KabVLrDH1pNypjnALX6fq5bJecQ2CjHpXoxHU9pHNuWTRUStJrMl7x/1V1ssoTbUZJO2nspNL6AdkVgrWTI98JcXO2Ex7l4sE7I7djNeLEHT0dgjaLe8rLXHjFCmo+u7sjv9nk2TsGWSY2qUSGXMFndJ3j35UgiLczw== 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=8lT72NiGK5cKKkRNJHnDqkwMZNfcJEQAmhnrsN20Qn4=; b=QQ5iwMGvY4MoGZSE6Ut+sG3xdhJfvLI6xsMO/Myj7Fs5GMNKznMO862TZROyRgDTviiaqlnPZp7XdURrXyYZXGVOrLyMUUTZuPYed54xpYF1C1F8EJCKOs+AtfoxN/cwjBrtdxrwJK0KAi3OJvTo77O327IQNkRK95QRX/OBRH5dTC2hie0yQ10XCyfyNvLtMVk1HvFatrx6n5RTXa9fwTeKyZekS34XREPMRWs3/wn+CdHJ9Sz6g4q06Pl6rfIkTz4lNiXrIxpNoo5B5i9vhNOaAK/VHaaFxPajfibuqzDjTXhMnwWhma4HVdpAGmIJi5RnrZwF+UjuAdi4OmM8rQ== 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 BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) by SJ0PR11MB6765.namprd11.prod.outlook.com (2603:10b6:a03:47b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24; Thu, 1 Feb 2024 22:31:23 +0000 Received: from BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::c3aa:f75e:c0ed:e15f]) by BYAPR11MB3320.namprd11.prod.outlook.com ([fe80::c3aa:f75e:c0ed:e15f%3]) with mapi id 15.20.7228.035; Thu, 1 Feb 2024 22:31:23 +0000 Message-ID: <15d8e520-c129-4b09-9a25-ecee5da36ca6@intel.com> Date: Thu, 1 Feb 2024 14:31:21 -0800 User-Agent: Mozilla Thunderbird Subject: Re: [patch v2 25/30] x86/cpu/topology: Use topology logical mapping mechanism Content-Language: en-US To: Thomas Gleixner , LKML CC: , Tom Lendacky , Andrew Cooper , Arjan van de Ven , "Huang Rui" , Juergen Gross , Dimitri Sivanich , K Prateek Nayak , "Kan Liang" , Zhang Rui , "Paul E. McKenney" , Feng Tang , "Andy Shevchenko" , Michael Kelley , "Peter Zijlstra (Intel)" References: <20240118123127.055361964@linutronix.de> <20240118123649.971809766@linutronix.de> From: Sohil Mehta In-Reply-To: <20240118123649.971809766@linutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0095.namprd05.prod.outlook.com (2603:10b6:a03:e0::36) To BYAPR11MB3320.namprd11.prod.outlook.com (2603:10b6:a03:18::25) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3320:EE_|SJ0PR11MB6765:EE_ X-MS-Office365-Filtering-Correlation-Id: 21470e2c-1a0e-4abf-5ab8-08dc23758552 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6qGJqFdKHHmQTuwz6tREjFw4eMumm+zz8PT5dgpZpwTUAmAAz+UdA6w9JfYi0dM6+r7sbHBTCBv20/50Wjw40E7EjTbG/xg1Rq6ilLDmnrcM87eWDYvPpo9nFpFsPR3WuqjReRJYVwy/4LmuEyRCgm/BS/wbN+zhBnpBmm5tQWngdgFOX/GGtxaOSQ6Y09+grsO+CzLv3jIlbUDPgjnKF6XtSUjak3fxHbEXTKc1+J0yOUnsxCXT0HIJBmb3cEwylubuvYdQXVvqO3tjfpN+/WL3GGBUUjdwchxEuh6iqxRRyZuK+bJRLooR9HQu8m92yRSdIKdXsefPq6aK3zAzCnaC5OfOyKVFyJ/X4trhPJ/WPt84UkRulbjlmstkA2ofvac33g5wEhs5RNKLIo/4NYc6oNpMGSPoxzn3DYoJoRl5MpjJoL9Pb+ULHBGeh6Qz0zv2DunxAxcBjvYhBzf5TC+nMp5EYRa1JHROUPjrmszO1CUJjexV5I/qZL6JrxVOnCUJQ2phcPYz1gduDBUtbmeHYAHagmZD5GzbixgmO6vY1uiIUyOxzSQwhlelWXKru7F+TtUNNk55PeJGI0gZx5pM6yIr2isBegPbT5TnYSks3sL7JGRZAUfUYzB4JkWvgMVcGZpzjt1Kunc48MgcPw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3320.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(136003)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(31686004)(478600001)(54906003)(66556008)(26005)(2906002)(8936002)(316002)(44832011)(66946007)(66476007)(8676002)(53546011)(4744005)(110136005)(6506007)(7416002)(2616005)(5660300002)(4326008)(38100700002)(6512007)(36756003)(41300700001)(86362001)(82960400001)(31696002)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UnJuTkFlQkhhYmd0Z3Znem52VlB3MkRDZzRoWUZick9PSzdjTmxRTWQ3MUJG?= =?utf-8?B?R0EzOWJTU0hrK1lKcUxHTWd5WDBOQjAxTFgwTC9KZFBLanRteTB6Z1JtU3Jx?= =?utf-8?B?WmZlV0Y2OUJRNTBRVFNtZytSTkMvNmlRaUZsT3FrcHFkZ1oxdWhJazFnYU40?= =?utf-8?B?WXdndjhRZHJDLysyaVNpazZENnJhQUhCZmVEODlvRElhV1A3cG9rdDE3ZUpQ?= =?utf-8?B?YXJLYzYvWlhyUXoxbW9xUlJQTHBIK1pTNGdPYUpZSFN0ckxnTGFIYTFGY3k5?= =?utf-8?B?eHN5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WDAr?= =?utf-8?Q?TdiyRON878fkuuhMpy4gVEHDZ?= X-MS-Exchange-CrossTenant-Network-Message-Id: 21470e2c-1a0e-4abf-5ab8-08dc23758552 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3320.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 22:31:23.5803 (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: nBUPHFd5vGERkiFRigrMprKv+r2A9TnkQCxB/kTWE9kjkSKqxJYmKTZGCGvqmChNFc5mxLEcCQB7MWkih1CuIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB6765 X-OriginatorOrg: intel.com On 1/23/2024 5:11 AM, Thomas Gleixner wrote: > --- a/arch/x86/include/asm/topology.h > +++ b/arch/x86/include/asm/topology.h > @@ -172,6 +172,13 @@ static inline int topology_get_logical_i > #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) > #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) > > + This additional new line can be avoided. > +static inline int topology_phys_to_logical_pkg(unsigned int pkg) > +{ > + return topology_get_logical_id(pkg << x86_topo_system.dom_shifts[TOPO_PKG_DOMAIN], > + TOPO_PKG_DOMAIN); > +} > +