Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp292015lqp; Wed, 12 Jun 2024 01:26:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbpuSZFXbnQAsOfRpz5fNWnWHX8QP+1ZFTqliifRKrvR0iK9KXbLm6VSWXC9wUSGVbc/RAUA6pyp+KONnWakS0M+sw9ebW7696JMeD0A== X-Google-Smtp-Source: AGHT+IFjXb+dg2Obxp9yT5Q7t2mDzlFJ1RTdMQBUlCsB1kcRFeHSf7UbuuZCe5NAydAfaRItKiVr X-Received: by 2002:a25:ad87:0:b0:dfd:edd0:ca0e with SMTP id 3f1490d57ef6-dfe6686cc25mr1076722276.31.1718180816694; Wed, 12 Jun 2024 01:26:56 -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 d75a77b69052e-440d29b1d3bsi66693121cf.668.2024.06.12.01.26.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 01:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211181-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=vM6GqPWO; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-211181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211181-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 5B0FB1C227A1 for ; Wed, 12 Jun 2024 08:26:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE71716C871; Wed, 12 Jun 2024 08:26:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="vM6GqPWO" Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2071.outbound.protection.outlook.com [40.107.102.71]) (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 A3D2E54FB5 for ; Wed, 12 Jun 2024 08:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.71 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180812; cv=fail; b=DgTCR5wU/43cjJ4G7cCpwHdc347bW9+oydkO//UnTg/xH9B3ks43z/8/Or06URH/gHe7a0HEwOKTtzwBKJtcEFqLbYL6r4B8I5HuhzzoMshQW2egfxzF3Cp/zzVecTi2pKdiXEHUk8CO8LQp+Cc47WOHzJicF3UY10hvItnFxHI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718180812; c=relaxed/simple; bh=NZR/gTCL0+QK6KyxGFWLey2GlGexBepSYPgmU5mLKmc=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=paHaYBZI389YQNr8VYst/qabP+pC/xoAEF3aNkB+rYmriAslZDD4YZaPMnsqe7JPVmjPjkgobx5Ed6+i3Jg/GBC3Tz1UG0wPWI3h2ejscCseuLOAZgPW3Km+FPnVXlIqppcFE/vDqnxvGml1oFEyMsc34iuTC8EeP5PQXOIP4V8= 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=vM6GqPWO; arc=fail smtp.client-ip=40.107.102.71 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=Qmra/psyXBDa+I12k8mInVaRJdSIhJW5BnY2PVx2VQKtyBUQuzk4B05nrBggWXgxdQaB/xi3et6s49jRYVHJuizl6Q/Sc9N5YN1vRl4j9yFZzwM4i1dgfyM6ULnZtiu636RMPZbq+Qy7ne/OfutudTVgnSFfiALmzQxHVibZA++x4TIIwzpXaC7x5XaWCI2CLhWWyGNlNFUEofrAGsUiYJSrjVXJisPcuX0/qAIq/W0DU91fSd88F175rBk8bEWb1BFcEVrRuytyVKzfj3XuS7J/DXOuLVQ7YMcEb2FdTZia7mQmCm4IcE19thv9MfiXrJkw41Xm8D8MECuTw9LHBw== 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=fmZ0d0tzWvfPLJS7EKfRGobqGjuH+5geGv5lXujExqU=; b=jEb+yVbUVwrRO3ceOg7opwNkuLrIxdhMoK3g+xkNH5SmFHP2snKgwxCPgjRN4F/bmVTtCgjUlfL6ZhL1pcloy9O32V8e05DpnzBPImTY0+Hlv5e7uQDKFdrEcIfT8rQuQrgdMwbUNK4THddzqFo++cDEnkxorgrmrgDj3KK0H+W3+bCFVLddB1IvBjzNidg5DPT1GF2jdH1BX+9xkmdA7+/8Cv9Zn7yfLkSOq31FeO7dDT9uB1H23f/aDU3kT5iTbdtVa994tErOL5929LPZxNJ6TqR8zvO7MESV6gPxvXBQJhfC6HXd0/50NUo04BRWujVVuykaj6iJ0ReXgXbx9A== 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=fmZ0d0tzWvfPLJS7EKfRGobqGjuH+5geGv5lXujExqU=; b=vM6GqPWOh3N0Wkm1MlUqyV2B+cduCYD80ZAfPH+Es3BcOKRVEV32f107bfPd1AhEEMb2wlyaUfn1moskBpZ23NqK/SmvWDFaQZaFsfMAVF627lwJRFA+p1ebFo/q0aJzl5Zh62dG9L6n3CIr/yox37DH+PU9PmkTBCBpjiSI4LM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) by DM4PR12MB8499.namprd12.prod.outlook.com (2603:10b6:8:181::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Wed, 12 Jun 2024 08:26:48 +0000 Received: from DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::6318:26e5:357a:74a5]) by DS7PR12MB6048.namprd12.prod.outlook.com ([fe80::6318:26e5:357a:74a5%6]) with mapi id 15.20.7633.036; Wed, 12 Jun 2024 08:26:48 +0000 Message-ID: <0192198a-8150-465d-ba74-fd7ab7af1b72@amd.com> Date: Wed, 12 Jun 2024 13:56:40 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] iommu/amd: Fix "execute NX-protected page" when running CPU hotplug To: Adrian Huang , Joerg Roedel , Suravee Suthikulpanit , Will Deacon Cc: Dimitri Sivanich , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Adrian Huang References: <20240611155444.860-1-ahuang12@lenovo.com> Content-Language: en-US From: Vasant Hegde In-Reply-To: <20240611155444.860-1-ahuang12@lenovo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0254.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:21a::20) To DS7PR12MB6048.namprd12.prod.outlook.com (2603:10b6:8:9f::5) 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: DS7PR12MB6048:EE_|DM4PR12MB8499:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e96c4bd-1528-40a4-a497-08dc8ab966d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230032|1800799016|366008|376006; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UVQwZVdEajZzUnBCZmorcHg3TGNVVDJJZEhobzV5SWsxT0NrcEIyVDdlZnFF?= =?utf-8?B?Ym9XaUFLU2VKcHZwaXk3V0JFOExnQ3daQ0ZtOEJtckpQQkdydEl3bk1YVFha?= =?utf-8?B?S2xQN0syc3VVN2dJMktFQmNEQ0JlOXB1cVNqc3VFWWFzbkVZOW8vVGdmMGc2?= =?utf-8?B?dEl0c3hHOWp2aS9jYUZ2RC9DY0ZCU0FmK1FUeDdTdXR5Mkl1dU41eVgxYTBV?= =?utf-8?B?UmlERUhLWWNQRExqVzZhWHBQd1BZM0FkNmVic3dJSG5BVUZqUmZhcDBFeDZM?= =?utf-8?B?NVo2MXhHdlp3WTdubGRETmg1b3h2NEloRkJrZnIrdDRwc2N3TXNETG5wdENj?= =?utf-8?B?b1JnZVlrMzNqOE0wVFdrUG1tQ3RmZWVmaStGQ1NRK01nRmVaTWZPUkJodG03?= =?utf-8?B?dklaUzVGR3BLWG9kTUk5KzJDQ1NNaHZnYVltMGkxQ0ZKOHpLNHpPbFg5MWx2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c3R01PWGN2c1JsSHZEejhBR0sz?= =?utf-8?B?NElZYncyTFdrd1B6dFFOMGFiUGFUd1FnTS9vVmYxNzRPc3ZYbTBQR0ZuNUI4?= =?utf-8?B?VUFlUVlBL0FnaDRJZ2FodUMwTkpMbWFqZml3VllVdkpjSURvbmd4dzdmcTF5?= =?utf-8?B?RnVHUVdrT2YzaE42Ung1SmJsTXV1OVZySEhtQWVNTWNTRjdkUkZGUmd2enNm?= =?utf-8?B?eDVXbnh1UCs3S2lXdEk4Mi9tOWMzSzZkRlNKTy81OFJHMkpnUy9UYUkxZjBl?= =?utf-8?B?aDBJdHhVczR0WmorYXp6MCsxUWlwOUp6eGRvOGFOcjNNVzc4SUtOdUgvTWRs?= =?utf-8?Q?nn7NJtZt3emX25mLW95j?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6048.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230032)(1800799016)(366008)(376006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S24zYTBoTGovTTdkUEpEck5zZ25HWEtpUUc4WGdic1dZNU5KVEZwSzVKNW5s?= =?utf-8?B?blR4b1hVMDIzaVU1NDRCWm5pU3B0bGFYZmRrR3VqZEJwb2o3aUJpZDUxOFRL?= =?utf-8?B?SGlBLzF4b2h3NXpiTWxhWGk4bk9IMkdZZFR6NDhYUGxHa0c4M0RjdFg2SHZE?= =?utf-8?B?bHF4MGdYOE5jbm5aclUvaUVGcmFCamZ2NEtvakEwbFk0Um1xT282a1ZtK1pw?= =?utf-8?B?Y3BBeUc1NTNac0E5RnJ0SldLR294eVZUY2RlZ0E1QVZ0R2ovYlRvaUdaakY4?= =?utf-8?B?QThINGd4OFRKVWdLODBMVitheUtaNjFVYThYaHcrZ01wWUdjRU9UcWxVOFpl?= =?utf-8?B?M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= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e96c4bd-1528-40a4-a497-08dc8ab966d6 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6048.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2024 08:26:48.2129 (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: 3wFuypnCzVNj5S7iZDfiRfLw3wWNQtOg8ObAExSBTHGUM2WhHVIrkSph78iInQc3sKUOlL3v7ILxGgudSm7hYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8499 Hi Adrian, On 6/11/2024 9:24 PM, Adrian Huang wrote: > From: Adrian Huang > > When running the following command (cpu hotplug test case of LTP), > the "execute NX-protected page" exception is triggered. Thanks for the detailed report and fix. This issue has been discussed and we already have similar patch [1] from Dimitri. [1] https://lore.kernel.org/linux-iommu/ZljHE%2FR4KLzGU6vx@hpe.com/ -Vasant > > # /opt/ltp/testcases/bin/cpuhotplug02.sh -c 1 -l 1 > > Here is the call trace: > > process 14301 (cpuhotplug_do_s) no longer affine to cpu1 > smpboot: CPU 1 is now offline > smpboot: Booting Node 0 Processor 1 APIC 0x2 > LVT offset 0 assigned for vector 0x400 > kernel tried to execute NX-protected page - exploit attempt? (uid: 0) > BUG: unable to handle page fault for address: ffffffffbb559170 > #PF: supervisor instruction fetch in kernel mode > #PF: error_code(0x0011) - permissions violation > PGD 1ae25067 P4D 1ae25067 PUD 1ae26063 PMD 134abd063 PTE 80000000 > Oops: Oops: 0011 [#1] PREEMPT SMP NOPTI > CPU: 1 PID: 24 Comm: cpuhp/1 Kdump: loaded Not tainted 6.10.0-rc3 > Hardware name: Lenovo ThinkSystem SR665 MB/7D2WRCZ000, BIOS D8E121K-2.20 08/12/2021 > RIP: 0010:amd_iommu_enable_faulting+0x0/0x10 > Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc > cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc > RSP: 0018:ffffb4e243fafe48 EFLAGS: 00010202 > RAX: 00000000000003c0 RBX: ffff90f4baea0820 RCX: 0000000000000000 > RDX: 00000000000000ec RSI: 00000000000000c0 RDI: 0000000000000001 > RBP: 0000000000000001 R08: ffff90f4baea0848 R09: ffff90f184a90d00 > R10: ffff90f184a90ce0 R11: ffff90f1834ebaf8 R12: 00000000000000c0 > R13: ffffffffbb559170 R14: ffffffffbaa4bd00 R15: ffff90f4baea0848 > FS: 0000000000000000(0000) GS:ffff90f4bae80000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffffbb559170 CR3: 000000001ae20000 CR4: 0000000000350ef0 > Call Trace: > > ? __die+0x20/0x70 > ? __pfx_amd_iommu_enable_faulting+0x10/0x10 > ? page_fault_oops+0x75/0x170 > ? __pfx_amd_iommu_enable_faulting+0x10/0x10 > ? exc_page_fault+0xaa/0x140 > ? asm_exc_page_fault+0x22/0x30 > ? __pfx_amd_iommu_enable_faulting+0x10/0x10 > ? __pfx_amd_iommu_enable_faulting+0x10/0x10 > ? __pfx_amd_iommu_enable_faulting+0x10/0x10 > cpuhp_invoke_callback+0x2cc/0x470 > ? __pfx_blk_mq_hctx_notify_online+0x10/0x10 > ? __pfx_smpboot_thread_fn+0x10/0x10 > cpuhp_thread_fun+0x8b/0x140 > smpboot_thread_fn+0xd9/0x1d0 > kthread+0xcf/0x100 > ? __pfx_kthread+0x10/0x10 > ret_from_fork+0x30/0x50 > ? __pfx_kthread+0x10/0x10 > ret_from_fork_asm+0x1a/0x30 > > > The address '0xffffffffbb559170' is the function address of > 'amd_iommu_enable_faulting()'. However, this function is declared with > '__init' keyword and will be freed in free_initmem(). > > Fix the issue by removing '__init' keyword since this function is still > needed for the up-and-running kernel. > > Fixes: d74169ceb0d2 ("iommu/vt-d: Allocate DMAR fault interrupts locally") > Signed-off-by: Adrian Huang > --- > drivers/iommu/amd/init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c > index 27e293727095..161248067776 100644 > --- a/drivers/iommu/amd/init.c > +++ b/drivers/iommu/amd/init.c > @@ -3362,7 +3362,7 @@ int amd_iommu_reenable(int mode) > return 0; > } > > -int __init amd_iommu_enable_faulting(unsigned int cpu) > +int amd_iommu_enable_faulting(unsigned int cpu) > { > /* We enable MSI later when PCI is initialized */ > return 0;