Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp406954lqb; Tue, 16 Apr 2024 22:36:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/J+Xvhip6KgxmyAZoVI7u6ErbZ0IcrvvfX8mMINUKcDNWO2e6BF5ONXOcDufBnErDBoinHQKUc+X8boplp3rnBUViXhT2IEpYwgnzJA== X-Google-Smtp-Source: AGHT+IG+mFj9cpgpZx+ku8LR/DxFkxtx0w1AeuqvtK/1KUT83IHPvf+pQs0pKS423AFvXoCld5rO X-Received: by 2002:a05:620a:8128:b0:78d:6eef:7d69 with SMTP id os40-20020a05620a812800b0078d6eef7d69mr15851657qkn.51.1713332188362; Tue, 16 Apr 2024 22:36:28 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i12-20020a37c20c000000b0078ed1fc6503si10726320qkm.567.2024.04.16.22.36.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 22:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147963-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G4ljZTyX; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-147963-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147963-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 0EF431C2147B for ; Wed, 17 Apr 2024 05:36:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EEAA52F62; Wed, 17 Apr 2024 05:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G4ljZTyX" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 DD35852F6A for ; Wed, 17 Apr 2024 05:36:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.17 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713332170; cv=fail; b=SU7UFuWDnGQMtJVSfrGoKJSsvP8T9zVT8jtms+Oo7tumG560XXuqpe/sY+PGVb2hKyitQi/AYFRJScq2Df6mkL6hifdd/Z7Ofq9yICcc8B/AADA2LfqNGbsBEwEHp8bI5inOHPaLnR1Z3S3FfKMgYsnQl5KC5EYDf6RdQ47jZdY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713332170; c=relaxed/simple; bh=N0srBs9lg2Cm0Q1ake7HcrdfW5EpYT4W1qp4Xy81wC4=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=bDS62vWx0Oqt7w3unC69helnL3dm7JZEacKNJO49z2H5IDtgUcBREh8G6WrlH9E4NYQD/aYjLdsNe/zi6fYCOHy9scnle9h9dNns2sc3XlEV0ZkVyGW2x7SW8MP8aHSwxBUWrvWYgI1FOmUjMAZvu0cM3v1X2XbhX0lM8SmR1aI= 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=G4ljZTyX; arc=fail smtp.client-ip=198.175.65.17 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=1713332166; x=1744868166; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=N0srBs9lg2Cm0Q1ake7HcrdfW5EpYT4W1qp4Xy81wC4=; b=G4ljZTyXKlgGHuTa6wI+uPP+yAaxL8RROkxg26jO4EwimOTGRs1vUGE4 KoGyxhmSk+WJ2EO5G+YjXYLWyTmSN+DZAcutDL3iKcp3PO2355/CyFda7 FNsBn6G6ZhqcXOqnnD62a8XOxQmBd4EmXtp/fMG5Oiz8DcW+1+ZiItGJG TKGGAWPMlcTF1DoGFzsrD/bo+0SXUw1oduPFkEJCeXJk4ez7qqiczDIz5 9jXufGRbnnILkT4oC5sn0v4IB5v6RRItv0vgWg4XPX78G8JQxkNG4Uc2h RIFaF50KDHfFBoObsF9AIVjawEzke+WB09xT4i91npdTOJhezHFw+SkkU w==; X-CSE-ConnectionGUID: JiayJz/CQYaRKBuTjNg/gA== X-CSE-MsgGUID: 2rofy4D0T4OjMlTS5ATicQ== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="8928936" X-IronPort-AV: E=Sophos;i="6.07,208,1708416000"; d="scan'208";a="8928936" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 22:36:05 -0700 X-CSE-ConnectionGUID: hr/Inr9PQ82lDoxlvs0PVg== X-CSE-MsgGUID: rbSBAaYpSsm5CGPtOv+BNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,208,1708416000"; d="scan'208";a="22987542" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 16 Apr 2024 22:36:05 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 16 Apr 2024 22:36:04 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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; Tue, 16 Apr 2024 22:36:04 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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 via Frontend Transport; Tue, 16 Apr 2024 22:36:04 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 16 Apr 2024 22:36:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+VgJgdDt3qRWSr0kFZx3b7uhS8RI1tCKiFUpRPpstOIoVPLORcC1X69cT835E9fMvvrLNGMMnwDA3ZzPqz2rdMEkQ7T9ljk82eOgrjiGae//jUDmsh3pfN3kgRbFRA0aAMoz1Ep2aLohI0lVhgzo3xIoGmPbPOa4SEK27e2M34B8o28BB5mwHDqV+gSuLMR2KMtEpHZrR3HcGdWhabVeoCAElyISxc62jwNg/Lquzc6+LX52EnxewrmA6HFXLVhPzTOJSq8BtHJ5KQ9swDBTsnFPaOCtCMUjM5OvHWtT15WIzb84c5UbKI0wUX6LcTerpR6k7PxT70iQxNQEUoxeg== 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=BlCw//HKHRqD4XWZDtBrMSfXX1qWa5IEl5HphS4cWAA=; b=CPmkoesEDUazExh1gbFUOWv1TxRD1RQNawVi9fFz8b8PgIIcNzjvd0QZ05P86ZA1HQsEDfSuwVeRBALh2CVw45PuRBVrgPjNgmTzpRmdF4MjWwAAWNbQfMLF2Z1rYWYjaYnipHtqXr+odAPUAgu/3pQl4KQrmwiJs4jqHVQBpmEh+6FbtWQ0tkd5Ygr1GWAkvs4H6zGbgOP1JSz5vzfjW+2G21bXlp5BvbwE8bznIxdWY+Iv2QYItWfs7BOXgCH9/dqT5RE+L5lE/HvUc1xep2gGO/lM3iAFLWgDJ6mifCvswc2eCgGKagi4tFV4NPiC//GOoWDctuexHmLDvEQNog== 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 DS0PR11MB8665.namprd11.prod.outlook.com (2603:10b6:8:1b8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.29; Wed, 17 Apr 2024 05:36:02 +0000 Received: from SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::d610:9c43:6085:9e68]) by SJ2PR11MB7573.namprd11.prod.outlook.com ([fe80::d610:9c43:6085:9e68%7]) with mapi id 15.20.7452.049; Wed, 17 Apr 2024 05:36:02 +0000 Message-ID: Date: Tue, 16 Apr 2024 22:35:58 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 7/7] x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI To: Ingo Molnar , Josh Poimboeuf CC: , , Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , "Greg Kroah-Hartman" , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , "KP Singh" , Waiman Long , "Borislav Petkov" , James Morse , Dave Martin References: <3833812ea63e7fdbe36bf8b932e63f70d18e2a2a.1712813475.git.jpoimboe@kernel.org> Content-Language: en-US From: Reinette Chatre In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0348.namprd03.prod.outlook.com (2603:10b6:a03:39c::23) To SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10) 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: SJ2PR11MB7573:EE_|DS0PR11MB8665:EE_ X-MS-Office365-Filtering-Correlation-Id: f56350e5-b44f-4264-55a9-08dc5ea044f9 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: AvOqfc50MQavQh4GtiWLu0pbztdhAvRyAoruFmxb9RDqlLXbPMEDOhLsL9tXk+NkrbFlgSLpLkZvBUUpjJEGv7MR0Hfo9LQFHUl6k0Rqnz9oeFMfV1zEZoZRtUayOc6Oogpabn0JwWfVbnMhP1jPd5REviZEV/ZGcqo05eRGxjcEseeKrZHp28ncayHz9+Dk9XFqmVReYsWjxZb/nJjrdSlXC3NkxtTyZZaO3xKM0Mdmhf/WhQILsQy1452st4DOAppmj3iw1d6K7P+6ptb8OCsuCO0k4mITPFQ5DgrCd6SWINLElyCajNjCT/t4x498kwrrjR6P1NGtFkwXSlXlaVsfhbHVDvm2lGdDkpTTBzIcpNo/1uz19ZXqSLeMVgfFAQNK3YDt+B3f++frqn4WgV2QCz5KZzIjHFUUv3WrtKEEHNlxdXOPqzak6xZvqWJwqZ3yDAx7GdNTia/zeUaZSil8fobQ8sWrNin1KXVsvZCasQzwxPz84OZNEq9oBQFE0dyhgwj8I1DdZyep4m4/KCYH7d1ePOiPjQQ+u581yr3ZlTMf/oNLzNBhBX4a9yb0iFdsyptDr0zlUSMczUKgsz4AAPHquUgyFX1QfKTsLqd6mb2Ja1+jYtaGJZkLlGDVS9BfxWiQtbGtmqzkjCQQzMdxXHPG1QTEYA8npatQFcQ= 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)(1800799015)(376005)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UURSZnJXbWZhS0pUcGtQNnA4eitZQ09sZkZ0Y3VaV3lPRG5Va2ZsdFNhREFv?= =?utf-8?B?LzlnV1VIM0dCNEhQM2RPbzhuSGNPZkkxbDI0aHYzdWpXRkN3cHA0cmhqNW5u?= =?utf-8?B?VHM0YWFvUlJhWFZ2elArN2g2bVpVZnZCRU0zOTgrZEk3dnBWTkVLYi9YNmU0?= =?utf-8?B?bTQ4ZlNrV2FSUm0rSmhwNndqOTRnYXZDWUZjM3FhOGxJM1A3d2tueFhNNEFz?= =?utf-8?B?SDB4bUt3UEozeldnZk9TbVk0T0RsMzdsQU5XNlk3SzdEdnIzOGhWbENveHln?= =?utf-8?B?N1BYRWVvKzZ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0luUkNzWEFEakN6SndTanhWS3RjRlN2?= =?utf-8?B?TnhoOWdMSDlkK0RwWFFpU2I0MldCdXhzSjVlTEVSMWNBUmNJeFVyWWNJaWg0?= =?utf-8?B?aGc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: f56350e5-b44f-4264-55a9-08dc5ea044f9 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2024 05:36:02.6063 (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: eOcysRWnzmS68SX9O4NXab3HdNRgZ2JIHqWK1hN1pw1wOLwX1O7ZuoObHCPp+0tjKwK5cU+YwA7LeRWlwEEIo0xhKqgJji5mZncoGHWyD/g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8665 X-OriginatorOrg: intel.com Hi Ingo, On 4/11/2024 1:18 AM, Ingo Molnar wrote: > > * Ingo Molnar wrote: > >>> static enum bhi_mitigations bhi_mitigation __ro_after_init = >>> - IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; >>> + IS_ENABLED(CONFIG_MITIGATION_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : BHI_MITIGATION_OFF; >> >> Uhm, after this patch there's no CONFIG_MITIGATION_SPECTRE_BHI_ON >> anymore, which is kindof nasty, as IS_ENABLED() doesn't generate a build >> failure for non-existent Kconfig variables IIRC ... >> >> So AFAICT this patch turns on BHI unconditionally. > > BTW., this is why IS_ENABLED() is a bad primitive IMO: > > kepler:~/tip> for N in $(git grep -w IS_ENABLED arch/x86/ | sed 's/.*IS_ENABLED(//g' | sed 's/).*//g' | sort | uniq | sed 's/^CONFIG_//g'); do printf "# %40s: " $N; git grep -E "^config $N$" -- '**Kconfig**' | wc -l; done | grep -w 0 > # RESCTRL_RMID_DEPENDS_ON_CLOSID: 0 > # NODE_NOT_IN_PAGE_FLAGS: 0 > > 1) > > CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID doesn't exist anymore, but is used > widely: > > kepler:~/tip> git grep RESCTRL_RMID_DEPENDS_ON_CLOSID > arch/x86/kernel/cpu/resctrl/monitor.c: * Only allocated when CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID is defined. > arch/x86/kernel/cpu/resctrl/monitor.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) > arch/x86/kernel/cpu/resctrl/monitor.c: if (!IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) > arch/x86/kernel/cpu/resctrl/monitor.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) > arch/x86/kernel/cpu/resctrl/monitor.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) { > arch/x86/kernel/cpu/resctrl/monitor.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) { > arch/x86/kernel/cpu/resctrl/monitor.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) { > arch/x86/kernel/cpu/resctrl/rdtgroup.c: if (IS_ENABLED(CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID)) { > > Each of those uses is bogus, as the Kconfig symbol doesn't exist. (!) > > AFAICT CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID was never defined within the > upstream kernel (!!). > > AFAICT the first bogus CONFIG_RESCTRL_RMID_DEPENDS_ON_CLOSID use was > introduced in this recent commit: > > b30a55df60c3 ("x86/resctrl: Track the number of dirty RMID a CLOSID has") > > ... and was cargo-cult copied in other patches. It was never explained in > the changelog why it's used without a Kconfig entry anywhere. > > Maybe in the future some other arch might (or might not) introduce > RESCTRL_RMID_DEPENDS_ON_CLOSID, but that doesn't justify this bad pattern > of dead code ... > We are in the final stage [1] of untangling the resctrl filesystem code from the x86 specific code with the goal for the resctrl interface to also be used for Arm's (Memory System Resource Partitioning and Monitoring) MPAM that is similar enough to AMD's Platform Quality of Service (PQOS) and Intel's Resource Director Technology (RDT) for which resctrl is currently used. During this work we incrementally separated the resctrl filesystem from the x86 specific code. RESCTRL_RMID_DEPENDS_ON_CLOSID was introduced during this effort to prepare the resctrl filesystem for a fundamental difference between x86 and Arm and you are correct that this is dead code until the Arm support arrives. The Kconfig entry is currently being reviewed [2] as part of the portion where the resctrl filesystem structure starts to take shape but it remains without a user until the Arm support arrives in the next part of this effort. I do believe that there are precedent for subsystems obtaining support for features a couple of kernel versions before users of the features appear. With Arm MPAM support requiring this capability from the new "resctrl filesystem" it did seem reasonable at the time to add the capability in preparation for Arm support. Reinette [1] https://lore.kernel.org/lkml/20240321165106.31602-1-james.morse@arm.com/ [2] https://lore.kernel.org/lkml/20240321165106.31602-30-james.morse@arm.com/