Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp708565lqo; Fri, 10 May 2024 12:12:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXz+rCj+BeBabjb3GdUNNWBl68hxTH9+Av3V8TlOfy7EYnDXcSzipzmNIS5nZVTRs47Vjt33E5kbywErCa4b6AzeREqxsNfOnq/+wVkuA== X-Google-Smtp-Source: AGHT+IE4Kxnq3lG3Zj/XOHaHKIj4nRS/FDyVs7k82KNZ0SLEOmtPnbsGROOKOVrwgtz+VJJfc98a X-Received: by 2002:a50:d615:0:b0:56c:522f:53e1 with SMTP id 4fb4d7f45d1cf-5734d5d13b1mr3404045a12.17.1715368378234; Fri, 10 May 2024 12:12:58 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d4cf7si2412559a12.237.2024.05.10.12.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 12:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=Q4mt06JC; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=hFD5ykFQ; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-176131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.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 am.mirrors.kernel.org (Postfix) with ESMTPS id E7C781F24063 for ; Fri, 10 May 2024 19:12:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AD6F47A6A; Fri, 10 May 2024 19:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Q4mt06JC"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="hFD5ykFQ" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 6690CEAC0 for ; Fri, 10 May 2024 19:12:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715368342; cv=fail; b=BiVEqhbhA2HdL2ZXAlq54KvY6Ft+tCVBK2diW82yHEiNufMtVsoNdBkN+7JEdHmw8XE7bJdzUxWfvTgmzuO+UCVUkO7yof93HFHN8W0c343TMPSpPlZpodKFQwP8rKz1H8TTQ6hsuRjylMUyEb15vrBS/KHERQSyFiNSCEtRxL4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715368342; c=relaxed/simple; bh=HPvR1n+wOJdQBs9XxvHSXeRC69m44cX/uew3oQVCKnc=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=Is8LfvT4rbFdUiRtE5voOE9KuQgpiJ8BusZ19waytY//iGjI9pl4Bj+q1xAhllbk2Dr4EiHR83fjKWhc+8uH+aEDdGJi3jdvTqBLM0edNNGBeYKeN+vHKnMWS9iCZUMq8CI2eSdnQC5B1fT9dI6wATUJq3tbJIF+93GckuhAsXg= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Q4mt06JC; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=hFD5ykFQ; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44AI2X5L031689; Fri, 10 May 2024 19:11:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=sZIn7jNGX0lWEhyMs59As0EQSaT1V8jj6GfQtAqBTao=; b=Q4mt06JCfJDCq2pG2kHzxzyG9/85QJSm9Z/VDbWGAmN61IFjuKzkJb2xIYJGanHQs/Wj ULHyHI5Kx6sgCegq8dI4IjdUNpclQaZ5859/tmXimXuIWsl/rKyvQ8vNmb/H5k86yR+N x3LZFmO/eLxUG8p7KakO3kW+oepvSzMh4SvPVN+NAa1rPOv7Qjk6iEaKLB/fGoFa45Jn USbQbzpmYWet8QYVPlYfnKKICJo28q2aZjFZVc9i88iz9YUxVmRpD12M/jl/H6AF9u8B 8Pvja+MDrS3DXU00T02JJBUZb5kEMNKBuLeOpH0VaUfP/C/yXPjY8jgJUAAQAxwAYoQy Eg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y1nfr8meb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2024 19:11:38 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44AHoXnS025085; Fri, 10 May 2024 19:11:37 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xysfq5s4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 May 2024 19:11:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fth0ktL3VAk5bZX1jq2uOwJKGUZuOP7oXgmzXSu1tMy5fw8W1Cwg9CDz0DklLuNtfIC/DfAVKxWZs2ZuVN992YzI8aZW64st18bYzBOs5iTp9Iv8c+6yomDJ/jHfLGZW+lZxjwtXgqzs/n7ichMdxxO2O0Qg1io5C78XcNhsFIcm9vorNBtvjezxDAXOREEVT6YFVodK8G88iiwJ6LrFlCSrh9aLYDgSMlxUrnMNv66mNYtbXbO5Xt72X/75lO0kKivy1ZdANM8gIr1Q51vKXjk/WBQMHPE5nxc0M5iENjijUNg9KKlQe9n6qxtXdPdlUFJ3il15KcLwoag+Dhfltg== 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=sZIn7jNGX0lWEhyMs59As0EQSaT1V8jj6GfQtAqBTao=; b=a8uL9yFOSrlO8RWWcBga48QmJ3mu2Exs4+gYqIGycztE6iOsPMhn02JHu23LTNG1gxS/VSeeT4l3r1PwnEVkJmMUpnjY/sZV91EqZz4lxcetKU5iineQnNsMA7i+R1XgVgcZieiBuOSkwikW4o8XIeuIor6SzCIpLfYllRqti+L54dmhjN006dXcOnGmvDQjoJ/MiYgylX+/OFCkFR3M1VQaqWBB1Key7U9a0Z15rQzXBMlyPO2ZXBVuvx6f0i1KXD9edDLO45n3jANF9TgzwpeLlo3dGyKwvJAAWwd5pQS2VLYIzgzfnY4giA4tL0gbN3qU6w3yhz9ls2gCk99TKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZIn7jNGX0lWEhyMs59As0EQSaT1V8jj6GfQtAqBTao=; b=hFD5ykFQmTEihO4LSbsv4YwD6xbSPSrn4sZ61mCJTsQDgBehFUlrWSzaFUH66WuoLWdjFusdmKUBFuJrsqvKgeFa/tXG5fqeDytN5agbKy6pjDZF5ZmIRhKsgNEYd+uu4N5d1x2eh0HyQfxnCcIPmVlb5lId7shFp54/k3IqTIw= Received: from SA0PR10MB6425.namprd10.prod.outlook.com (2603:10b6:806:2c0::8) by IA1PR10MB7113.namprd10.prod.outlook.com (2603:10b6:208:3fb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.51; Fri, 10 May 2024 19:11:33 +0000 Received: from SA0PR10MB6425.namprd10.prod.outlook.com ([fe80::447b:4d38:1f8b:28f1]) by SA0PR10MB6425.namprd10.prod.outlook.com ([fe80::447b:4d38:1f8b:28f1%5]) with mapi id 15.20.7544.049; Fri, 10 May 2024 19:11:31 +0000 From: Dongli Zhang To: x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, Borislavbp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, joe.jin@oracle.com, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev Subject: [PATCH 1/1] x86/vector: Fix vector leak during CPU offline Date: Fri, 10 May 2024 12:06:23 -0700 Message-Id: <20240510190623.117031-1-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR16CA0044.namprd16.prod.outlook.com (2603:10b6:208:234::13) To SA0PR10MB6425.namprd10.prod.outlook.com (2603:10b6:806:2c0::8) 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: SA0PR10MB6425:EE_|IA1PR10MB7113:EE_ X-MS-Office365-Filtering-Correlation-Id: efb45953-ea36-45a4-469e-08dc71250085 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BqwUhTV4Q34Oc4jHZvwr3/Kxs55qLszxPh6JPHdGMRdkKX8WHfqcEJtmbTdv?= =?us-ascii?Q?f/If0AOa0jON07v5HayShvGzzdf/AZ8NNiYr9wgjyE+/hwTuPePqLyo4c8mM?= =?us-ascii?Q?9ucI0GarkzUTovry3Rx/mhTrURrfqrBkDM9qlgPN23KwVKj4BmQbZ3n46ltB?= =?us-ascii?Q?m3fqa3WfiyYS88WL0dX5CbMWNvu3qO3QVd9pwjCsV8mWWDC60qamkGJzgY5n?= =?us-ascii?Q?TYEIDuhBcVHVE2kZZ7SHAvFNup5Anuq3tY8A3wpdpA2LLfiIVvfyF/GG0HLE?= =?us-ascii?Q?NroYHyQ+OOL0nIo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b?= =?us-ascii?Q?lMLRDaHI8KejXWAaF4HQWRCwsVQc1nouI9kTQhTYlTnmICWGu5mlZz9B1OcL?= =?us-ascii?Q?71H/2AI7Bll5uOSJ9Twv1rAioK6nI/zf4TJ9+oeSng=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR10MB6425.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DAjITnozhBWV80DBaf9ttLEtSkSYBQXblL0bQ+htYa4OMSoiL3rub1+REwVB?= =?us-ascii?Q?Wzrgi11v+DOzKWF0tGn44Pl4iFqQJv0QquPyQeDV95ifOx/8XVOxAmd//EcC?= =?us-ascii?Q?/8nB3m4dr8wlavCeeikSTeX7UEFZsLq1od/FtvM9CaeoMOTK0jPWZWPL/Y5+?= =?us-ascii?Q?w1ooMJItkZ2JstVqV1iCInIrB60fwrZ/5zKqefkb8TysBLXo6/Gkf4UGpTKc?= =?us-ascii?Q?wE7jOrxVoCHHvsYI/l5Zje2r92QBsvCrYagcaqW4pt1T9HI3ns0f9nnRbSm4?= =?us-ascii?Q?Wck3UjsLs2/B+6EpB1I9kxxgqDdjhrUjh5CTOnrDutlNOvXC6onSZhLlBKO+?= =?us-ascii?Q?e0kuFoMYucdwtbcaf+4QJqeQW1NTKQYvALvAIoy5I3TKnNd0iSWir9zIa5Yt?= =?us-ascii?Q?K61Lii8nMmcAr87HbiEPbJrhj97+e3jMkJQBm9ndeO0WacdzmL2yCnpMBIRq?= =?us-ascii?Q?QedDe107XzTwaEmeflT2B3XLniJHB8GE+OyWpe699eTQPagrRaiJowF8gsGa?= =?us-ascii?Q?mlI45Mbs4OCeQmZuUUfnn3lxfT0TEIw3NDCrDv75J6vGun0DoIF/1z3ne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rRuaJmqxUvvcJJxUG5PpwkNdtV7415?= =?us-ascii?Q?2Znu9u+UJORlNHKKy1gWLatfupFIgnyg2AqAKSxsFZAnNTech37rkg+HyPtc?= =?us-ascii?Q?Y7JS19T5+fnYx9c5WnZt4jJj39jlPu/gPF+NyvRs?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: CO958NW/uBZPi6bgtioq4Xiq4YNyiCK1/m471jRhLdvnTD60rx1yddr1bB+L8LxnR4eNLZ1qXxgem+n6PWluvChI94Z++fOiIlW0g0uvuxFpLRcw6WsLjlM7K+v0oZmq10dwlL/wzPJ6/WgA9sPWui2Khrh3D2zID337zQZHxLaCsNNiT5rcG5sLAaDUo7aVnEVV7fCHw53zcQJaxJfbfkwAUIKjMDRDB4d/c+2EjefAePJFGursvHfCGfMyuOHVOZmUjoYOBSvmDrc0++1CmGMoeGXw9H7z5GdooykbzMCXv32xMJcKkQJ5VIzUm/CO1VUE5/7dJmPHH5PJKM5MgmWGcTMlignHHzs2mlLkBLU+7pRQrmljmlgBa3KflN/vJBQDSePLzutlEdjrctn6LdIYnfjj5Q+B4B8fWdDdtK+JtShXXkjxgcS3u5Bt+q6VjcmvFcwKYZfliYQS0UQbc+3os6KAiXOg1GFnX6QPZlG/rErVW4aWcqL3rD4sUJjY6ST9tYxywqoC/r/69e4Lbvglm/oxyHAiRHh61Mii4zv0OBT53wDSlEX5ddvilcACXDkbkk4oeuxU7qbSepncaHyDqDUaM2zJnjI9qm3bygE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: efb45953-ea36-45a4-469e-08dc71250085 X-MS-Exchange-CrossTenant-AuthSource: SA0PR10MB6425.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2024 19:11:31.8058 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TNxG3fvWjY+sEFFSxA8r3+wMPRiHiCurR+5A8ygkAvpWEI1q7Y28E0Qt2Dei3goWZUkHIrYm3Fl7C46bd1mgMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7113 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-10_14,2024-05-10_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405100137 X-Proofpoint-ORIG-GUID: IOHuvzSYcqHGZuzSdoB72_iEW2nMAomr X-Proofpoint-GUID: IOHuvzSYcqHGZuzSdoB72_iEW2nMAomr The absence of IRQD_MOVE_PCNTXT prevents immediate effectiveness of interrupt affinity reconfiguration via procfs. Instead, the change is deferred until the next instance of the interrupt being triggered on the original CPU. When the interrupt next triggers on the original CPU, the new affinity is enforced within __irq_move_irq(). A vector is allocated from the new CPU, but if the old vector on the original CPU remains online, it is not immediately reclaimed. Instead, apicd->move_in_progress is flagged, and the reclaiming process is delayed until the next trigger of the interrupt on the new CPU. Upon the subsequent triggering of the interrupt on the new CPU, irq_complete_move() adds a task to the old CPU's vector_cleanup list if it remains online. Subsequently, the timer on the old CPU iterates over its vector_cleanup list, reclaiming vectors. However, if the old CPU is offline before the interrupt triggers again on the new CPU, irq_complete_move() simply resets both apicd->move_in_progress and apicd->prev_vector to 0. Consequently, the vector remains unreclaimed in vector_matrix, resulting in a CPU vector leak. To address this issue, the fix borrows from the comments and implementation of apic_update_vector(): "If the target CPU is offline then the regular release mechanism via the cleanup vector is not possible and the vector can be immediately freed in the underlying matrix allocator.". Cc: Joe Jin Signed-off-by: Dongli Zhang --- arch/x86/kernel/apic/vector.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 185738c72766..aad189a3bac9 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -1036,6 +1036,15 @@ static void __vector_schedule_cleanup(struct apic_chip_data *apicd) add_timer_on(&cl->timer, cpu); } } else { + /* + * This call borrows from the comments and implementation + * of apic_update_vector(): "If the target CPU is offline + * then the regular release mechanism via the cleanup + * vector is not possible and the vector can be immediately + * freed in the underlying matrix allocator.". + */ + irq_matrix_free(vector_matrix, apicd->prev_cpu, + apicd->prev_vector, apicd->is_managed); apicd->prev_vector = 0; } raw_spin_unlock(&vector_lock); -- 2.39.3