Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp285669lqh; Mon, 6 May 2024 21:09:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpIz0fyK1AhZUS6e4nTaLt3rQgn25PlVLuCAxu3dA32E2H7seVHDWoya7NdpOhnS7Y8V4Uac3Kj+84hEk1DYil0RjR1QT8X3EPn0/2kw== X-Google-Smtp-Source: AGHT+IGzSSRZS34l2jvlUmimx08tnUabGjVjYx6t4mEC7/rh6ZHYOBKFNTmqrtUPqfKghIa1MmfB X-Received: by 2002:a05:622a:2989:b0:43a:dcd6:6507 with SMTP id hd9-20020a05622a298900b0043adcd66507mr16779340qtb.50.1715054959887; Mon, 06 May 2024 21:09:19 -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 j7-20020ac85f87000000b0043c78d1ee56si11049543qta.139.2024.05.06.21.09.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 21:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170636-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=@amd.com header.s=selector1 header.b=L7XawHrG; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-170636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170636-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 8D8B61C22841 for ; Tue, 7 May 2024 04:09:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC1E34F5EC; Tue, 7 May 2024 04:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="L7XawHrG" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) (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 4755CA93C; Tue, 7 May 2024 04:09:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.66 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715054950; cv=fail; b=sEmq78wxP5P8jRzSsOEIHhvyWKfAkFOVNcTm5+eYQsUdDzPOYiJnk/VVKB6b4cjTifA6/zkz7hs+IWU20Fo9bmRHwhQVTXYiky5aOg5zqaHa++HB9PabUfK1wMM2btBOW5tEUcw34qQjXfzr2fxslZAVvASew5E1cOPknqRmRP4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715054950; c=relaxed/simple; bh=PJk8rQCNz/+5dk6DVmUqv+99oYGSUrN7gQIU19mnCPU=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=eUZojynwEskbllMS+iGw1Zdll4k48BC8EuaYeTH6oGpNPbCjVoeE6NwtYaI6ccZtxhnqDCerKlJD2CInDnipnP/xM5ByLMKQ2xjYJ1zmpIKQu2uUIzA5LU1y/59O8a8K3aIlnE4ctg3xWmi94gjn7nJdwmS1j7WUJ7oYT3HCaec= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=L7XawHrG; arc=fail smtp.client-ip=40.107.220.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dt8/mDbWzCAnK7ZIxGxRyoI4YyWUcpcKVlgQHpZoH0qL4hNoGQx6hDCNd/piAWXxxBS9UL4SaiciGQudRmvl0FSw2e5i1qm2YAorSRDQ8impdcVkKvlw9gnxJSWs2+KTpqBed4VK8e0sFmjGcxzwkih2/9MB+c6V8MvkZcjr1omcfKT/siYuuj5zeNDB/64HEOrXvIt7JypfTmiWMv/3jdY13suhspKpk3ospDsM4VEartkp0Ok30X/F+3aHtNO6G7Y5bKmxgiNfwtJMsv3YOxNEjmu1bP736DISktgPktV+04vOPUob2xvnmybeGyLZMujt+fYmE+R0orucfJL/TA== 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=gUUym2ATWSWcx3lQ9Wgy8jvSbvPQxKCaPDckU4hJ7j8=; b=k3W+5w3zC69lfOPvWOQblRpJhteZTnt5luoJPOUzkA/Xt37VHMZZFVHQXCayxVK4/DMdUqg3urzaL5yu4fmy7V9hxk3o3dmkyHTXZ7XyXTEd8nFeLrTA0+C288e9o2V7McnOGl4S3DU6cev/haUrgyiTnOhOUMjda/cFxumDszW5CSAE1wz9IacDJo0fpD3mKEf9UVzEIsZMQj+umaiPFB0CS3MVLlvFb3rJCTOVtJHLgmvythjj6e4fH6pGklix0Pw04Yd3eaePh8YOY7XrBpBzVIurDZ6bVcOoD5ooDgNVRVHXWcJxF8CYU+NSg1vKj6foYHBNIf64rg2XUhgDDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gUUym2ATWSWcx3lQ9Wgy8jvSbvPQxKCaPDckU4hJ7j8=; b=L7XawHrGDOt1cTPPflgQmx8rOIELheeNocc90sqol1RdTtjGWCYkeYqsmaTmpaFjxd2uNW0wThLInUdgPl1goDSqFoYTR3NH0mCIo5wgZOwt4EVtgqb1B8UVJvLdUGmu17G4nxTdSPM0VpN6n5IVfvGPRtptzRlY6U7j7qvam8Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::10) by DM4PR12MB6496.namprd12.prod.outlook.com (2603:10b6:8:bd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42; Tue, 7 May 2024 04:09:07 +0000 Received: from PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::5e9c:4117:b5e0:cf39]) by PH7PR12MB6588.namprd12.prod.outlook.com ([fe80::5e9c:4117:b5e0:cf39%5]) with mapi id 15.20.7544.041; Tue, 7 May 2024 04:09:07 +0000 Message-ID: Date: Tue, 7 May 2024 09:38:44 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 2/3] x86/bus_lock: Add support for AMD Content-Language: en-US To: Tom Lendacky , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, seanjc@google.com, pbonzini@redhat.com Cc: hpa@zytor.com, rmk+kernel@armlinux.org.uk, peterz@infradead.org, james.morse@arm.com, lukas.bulwahn@gmail.com, arjan@linux.intel.com, j.granados@samsung.com, sibs@chinatelecom.cn, nik.borisov@suse.com, michael.roth@amd.com, nikunj.dadhania@amd.com, babu.moger@amd.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, santosh.shukla@amd.com, ananth.narayan@amd.com, sandipan.das@amd.com, Ravi Bangoria References: <20240429060643.211-1-ravi.bangoria@amd.com> <20240429060643.211-3-ravi.bangoria@amd.com> From: Ravi Bangoria In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR06CA0004.apcprd06.prod.outlook.com (2603:1096:4:186::20) To PH7PR12MB6588.namprd12.prod.outlook.com (2603:10b6:510:210::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: PH7PR12MB6588:EE_|DM4PR12MB6496:EE_ X-MS-Office365-Filtering-Correlation-Id: 51b58ec2-3838-47cc-e3eb-08dc6e4b7070 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|7416005|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?cmd6Nis1ZmF6YXRiWUFFMHF1K09DRHJQVExoMzVhSEtCamNmcFR3TjlXbVhr?= =?utf-8?B?VlZyaTA5K0o1NzZLRkRCREF0OTRNQlZLYzN2VzJDajBxVXA2TGVUNzJ3c04x?= =?utf-8?B?N0p3ZzJHQVJoTmo2Ymk2dE5KbThEOVJXTHNYa1JySTgxelE1RUNCQU12Z1Bp?= =?utf-8?B?YzJ4VDlsSTFSYWFzbTI0cDZYc0RoMUp4U3pqMDJNNHpDRUk2eFRDVXkzNEVi?= =?utf-8?B?QTRLV0gzbjNCQ1RFUzRPNVgrUThDbWppdXF1Q2FTcVIwbFZMQ1h3bEd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dWVOK1JyNXI5YkV5?= =?utf-8?B?ci9INWRRL2ZITVFZZk04bnlCR3lqcFkvNjI2TGdFaDdma0FRWVZ6NHp1QWl1?= =?utf-8?B?UUpyMDM3RTRNbEtCL1JTeDZRZlVkR3NoVnFMNVJqSnhLMDFXZzZkTjQ5ZW5w?= =?utf-8?B?cGd4ZHIvbzJUL1VPZEtURGdqVDBzbG9tVlpHb0FrRlFhWnhVa3pQZkFSNGpD?= =?utf-8?B?cURlL1M1VmRWUzBQcVJZRnpnOTR0YnJJd3ZqbFhrT3R5OFd2U3lDaDZMTlJN?= =?utf-8?B?L2FzSWViM3hhemRYOUdHN1JkbEVuWkVYZjdzOU1RaDFhTlNsODEzcy9CWmFn?= =?utf-8?B?TTVGREpOanNBMGp6aHl6VWpqWFNFc0lFRnd5VDZKZ1RMazFJeVB0MlZGa3pJ?= =?utf-8?B?WnIxdzdER2g3eGhVNzJ3eEdDZjRyL200WlN5S2pxWE12OUVBSGhkcGRaTnlU?= =?utf-8?B?VkkybnN0Tk5ZRlo1djV4ZXdtYVBVLzh5R25HSko4ajdSUVpjWUR1QW8vQTk0?= =?utf-8?B?ZFJ0YklxTGdIMllGWEdKVTFuaFpRT2FRbjhIUXZkdUVGcWQySDNCSUh3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB6588.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(7416005)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RFZtVjZRRTMxSGNTcVc5RHBXM1k2bkY2cC9DY01BdU0wc3ZGeEFmL3lHYWY3?= =?utf-8?B?bVo5dlBzd1BsQThkUmwzQWZsa3B6M2I0V1R1UTNzOUI5bFVpVklxT2EzTU53?= =?utf-8?B?U095VWdGZHY5cDQvbVRsQTRG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FXZDBv?= =?utf-8?B?YVArd3dHUVNXMHZ5ZzdxdFIxZTR0MzhIN2hnUkRHVlVrd0VacGVHL3Z1OUhC?= =?utf-8?B?QVBlZ3BJYVNSWmp5SWJxVFljY0hTcmFUYXI0NmdaQ1hrZVlNa2pGZHJkRkF0?= =?utf-8?B?WEJjT21FZk9ZVDlUWmNXN0N2NlJ2eGk1QjV1Ti9ESkdRTVlwbGptMGx6d2RH?= =?utf-8?Q?o9Q5zsuUKqaqLyLbZU1NV7N/7?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51b58ec2-3838-47cc-e3eb-08dc6e4b7070 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB6588.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 04:09:06.9359 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OxqNPK65HLM6boAZGldAFBlshTWpOXK0ytd9fEVMUu0MvR7HFdfAwzaBfabWJaYgy3/hcIK87blFYFNDHEdhwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6496 >> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c >> index 39f316d50ae4..013d16479a24 100644 >> --- a/arch/x86/kernel/cpu/amd.c >> +++ b/arch/x86/kernel/cpu/amd.c >> @@ -1058,6 +1058,8 @@ static void init_amd(struct cpuinfo_x86 *c) >>         /* AMD CPUs don't need fencing after x2APIC/TSC_DEADLINE MSR writes. */ >>       clear_cpu_cap(c, X86_FEATURE_APIC_MSRS_FENCE); >> + >> +    bus_lock_init(); > > Can this call and the one in the intel.c be moved to common.c? Makes sense. Will do it. Thanks, Ravi