From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 5FBC6366; Thu, 7 Nov 2024 19:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006559; cv=fail; b=Ji+bLM5hyePrhh7xOsNK6nhJMnn7G+G4oDe4xqOAULDdrw5+PKTK7iZ4jLpvHDSwiaY5+tzzzLuCYCy9YZdimuEvpvyDjRIWs/1MhXEtsIBLGaWwQHPIABp0fBW+BZwTbuN1FBeKmrRx2j9rTkCjDB8Sb/MSar5cuHA5fBSYhNw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006559; c=relaxed/simple; bh=pjFZT0fb/gVn3I7dwMz3S9F9Z+DaEFtVfi7oVA/DSlc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=EqVcLI0uWeH3kjG78fnHgqk5KIXSCAsZMUr8iNf4ST1x3KcFWSpA06LJ8tVhLBr5tcRzi85xdWZM+TXYe56XhwG1tR+65Ms4kxNbzyREnrtm7M3lUKP4WT+1EKXYCS+nucySQt+e2IDelbpnhwc9S5Cs3ktrEse1x8n05/pXJLs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=KiV+60nF; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Y2mn5WBp; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="KiV+60nF"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Y2mn5WBp" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBfMQ029239; Thu, 7 Nov 2024 19:08:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=SXIK4lyZNeGwltLFKkc++ba2e94bN0lRjiyisxGBoFo=; b= KiV+60nFQb8TomZQHsqbvBMJwlPomeLUy6uIGq0x993TOGyTiwKXW1XPBSd0oyHk XEI66pQX2Slfa2hNpjEPS4u1m9tIEWkeb/4tCWmUpMPfVAdTlA5Fd/vBpDxQ3fgh SKERh+fvYH4HMH+RA1Z7j1x8gb6TUChQYyZ3GXMmJpr0psVUoCkMUz9zV757oCzH e1kaCEgHpkBrgFh/bNCh3Yk1RDXc7EGVwVLP3Yfz0k6O0ntrBrMP7USiNrq/xwAb NRw1fROetDjp6h8CLEl+Iws5BFl8ntAEwssbngiak7hWy3MlXx1SodUNYNmY45q3 0tRKXq0WQsQ2RizbYKGnOQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42qh03efe4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:29 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HotYZ031469; Thu, 7 Nov 2024 19:08:29 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42naha6c5t-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JCjwV1XWdeGHF8fkqRSHR14Ncy4JpJ8br8XA1YjKgnKbf4rw4S44zNZye6znm9zNwrz+3kIQGooMnKPPnuBo3KIBfYvp2lyBi4SDPi2rpXK4EUIBSHJJESjaVOYqVwERZGeMg5tMfh6tSyXCq7HvrxS3jYuwUOQrMy3LGoQhV+hXoseOWbzn4npgJRRrLdZHvOUNQ6HxjRnvxMnKuV6WWAMqa8hcgN+hgzNZu7+BPnj+HRv8m9T4aom4pdZeNKrYhNRrSMN2lzaoqJbPbh1r4pCTB7FYDTwCTQXWgCp81zkNGHyVZeqIuEid4LDm5FDW5a0znUf97EqXcygY1ed+eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=SXIK4lyZNeGwltLFKkc++ba2e94bN0lRjiyisxGBoFo=; b=Jp5eKm6YYh5Rf55QE5UwD0mFySc6NTK+kFGF++Nqcksz5yo9+wRoNrTV37tkVRX420+7BhQu1H5br9VFw9qCc61zOJiSYR77hFu3b8hXQxcRf/VtsdKUYPNCsZ1jSSH6VdelPtnDIvjrROgfGqI6THMA8cDLtBYdIcjd1vxLvJ9HwSK/1LC2mWR2MrlUqCTospBZ0TVKbEwkTY93n75tGSMPyv0E3dBFb0YlZtTwfiliLkNtsI647Dd+BoGYg9A0A2Du/tGgzE+WeBfGXl/58NI5RBUWA6dAEZYc1IccwvKetCUi1J8vSv5GV55LlhTNy5f5MSnV2/v5GUmHl0VM+w== 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=SXIK4lyZNeGwltLFKkc++ba2e94bN0lRjiyisxGBoFo=; b=Y2mn5WBpxUkO6JcXvn7rzxGVZMtu51LPqWM9w4DMFKX8QQPixzH84EFauqPMii8Z6iLM1PEG3DN9XckEj4THYvzHJCtWHhtqao3LRJaoMt2brvIqR82nIEjs28qi/u359efpvhVsGvJuBKtHlV4hrhb/a0rYfEjICNwe2fRH2q4= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:22 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:22 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 01/15] asm-generic: add barrier smp_cond_load_relaxed_timeout() Date: Thu, 7 Nov 2024 11:08:04 -0800 Message-Id: <20241107190818.522639-2-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0102.namprd04.prod.outlook.com (2603:10b6:303:83::17) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ff19b90-d2ad-40d6-c917-08dcff5f8c82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?UP5A9Zc/Q2hFCEIApnt+lvtB6z1e+vqNqZyTa9v5B4I4EvGuBGBu+7qdcmnR?= =?us-ascii?Q?UPAjBqiVtx0XQNl+fzQ/WmAtZvu/hNstFQw6eB7Z+qTSuyFLMZwIMpw9wd9q?= =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/rFMqE0QXRjxS+srldir39qWl7r/Zo?= =?us-ascii?Q?Opv+WwhGA2H6GZbaY6nuKMQaNFpmYvJzTbk8bSitiCElFNeBwmhI51CRXv9w?= =?us-ascii?Q?s6IiKLw1w3PX7eabw9sBsivQpjrrXLBLuJMnHW3/OnJu5wg1W1M3DNOuCE1e?= =?us-ascii?Q?G5dpcj4plEuoFhC8c5Dhjlg57jiZPvnLxYUfXE41PDuzFRSdG/iM5Nw6TQT8?= =?us-ascii?Q?qumkaxrAGPatPDfmsLgYliumk8YmpfeAjVqL8eS8shSzOeLMyaZzRELq1bUi?= =?us-ascii?Q?LJMZdpuKueMbP23SE/cAu0xmWV7YntQfuu/JZEhb6zh3NsOA09H7oSY2jFd0?= =?us-ascii?Q?1FQ16pPCScf7YK92LvFRI1sA?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?d2vo6+1ix52dNDu/gp/FtHrS08lJPyu5oOl6qZhw4/EwmgshDF6XxAiYp3vh?= =?us-ascii?Q?SZgbuAbrO9mKKWye2Af9rfUpA8zH63ODgImFRKuBNQG/T6psmAiozqTNIUAo?= =?us-ascii?Q?bnpsUAlYo9BfKuDXeoKuqIbZI2+BP0aahnXmBHHDMVWR2GM2iRsIR6JzSFcy?= =?us-ascii?Q?Q3yGv3FtOj5ID02BgSmYGRJccEckkwzCWcIDLOIs6WMpf+f5MJn9mWXSeQWb?= =?us-ascii?Q?m1sPV5AYMYH4cSDEY2DAJMblpHEQ6fUSUBFSPhMrISfWxNEXH5/n6+ikKkOB?= =?us-ascii?Q?LXE/RJbKJZP5AT/29m4jk14OU/YR0cBQueg03gsacyFJzM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Je1u/UbOJoOTVIBVEEimOIp0QrdOTVGjOZWZhYseeIcnzQWsGFO?= =?us-ascii?Q?y2w52EjktnPiyzsg3wHptyaFIG5u+4ODcgxOgmrkZwgJPXTZTungHHWCLLZ6?= =?us-ascii?Q?4Pd8aONt6v8ZKa8LVU/kRJ44qunVmvKidTi+C2qk/hZNRdhEWNm5fJ9UpkMH?= =?us-ascii?Q?tt9Z6V5rL4QZ2oEZgz3bbXp1muZkv710HX+NGxJZKXkTjC8OZJhE4T8WXdUi?= =?us-ascii?Q?H9y3r6SmoEKonXegKh9UwHXtRkAHv3fFYBBrGgcB/uU+kwCeGJiYW1ovGKzA?= =?us-ascii?Q?WElNo+S/+Zi5ymi3DTOU0iMV5TZKcVfYXW6wXSKTQb8CUexGx+eXukgv/dAW?= =?us-ascii?Q?VCD0rQ7W/Nde5RfaUqv+7WFuOnfPH6RzsPqIr+YHKa+Ejqq/3Z700GfL5TiB?= =?us-ascii?Q?VQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 9/oe2hRigAPUcas89QZvInW+mfaXFoh2SgeU24tR/cDeWsYmrHB1SQhJaMGJPhIE3cxgNogqZXru1S00Weh/Sc3QSHWZeu2036UViPNxoGMNXMmu1ztoZ+UKjQgHYR2Tz/ElchORfe0ZyppZyUWY0gVTcDRMAy/RlsnunxlEDdXo2MZNjBJbaNwo8VCxtkgy3zrq84EI50ciX9o+u5VWw0UDsirD5BVN+dwXoU9aaCXURwQYS015btqWXMShU6BFagaIz+eVOwAkFljgZp7XBJGNipikphWld6L86bQDQzCTTNwHWEuQ+C1DD/0OdDFuXab4kZIAwR0slvd1t1oFVy6+0cY9hKPrD5inEEOraT7AEnnjtKfEFLc9wT11ie+RLPmjf0J7TJuQg6sg+3KNt9S/UQtHMuxSjADlD3l7saiWn9K26PNmVqo9lINacDcxXe+F9CssmpCs4A82mJ7IGRTfzhwEdDGN1iXdn5HWqbs7yHaxo5kiPr10iDPdUI+ruoX/0e9pSdO8c31rmzRj2daN2O4aRRgJ68OwpxVkHRE+MgQvsF0hE2fKrQQdXD11/GO71NVTdnWoHHIEmkhjAZBUI9IHoKQdpv0pFrAwS30= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ff19b90-d2ad-40d6-c917-08dcff5f8c82 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:22.7396 (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: Gbv1xopQKs9qHy5z6s4drnxJssyJGNmBpKFMIX9k8rJ+YjVUA5X6sBOgjL5iigc/UJFU0kCoK7LG7ikT4VFIg75chaxCRE828ALkHzj1L18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: PywjNqxFCDylieKsOIh960Pv61wAvhaX X-Proofpoint-ORIG-GUID: PywjNqxFCDylieKsOIh960Pv61wAvhaX Content-Type: text/plain; charset="utf-8" Add a timed variant of smp_cond_load_relaxed(). This is useful because arm64 supports polling on a conditional variable by directly waiting on the cacheline instead of spin waiting for the condition to change. However, an implementation such as this has a problem that it can block forever -- unless there's an explicit timeout or another out-of-band mechanism which allows it to come out of the wait state periodically. smp_cond_load_relaxed_timeout() supports these semantics by specifying a time-check expression and an associated time-limit. However, note that for the generic spin-wait implementation we want to minimize the numbers of instructions executed in each iteration. So, limit how often we evaluate the time-check expression by doing it once every smp_cond_time_check_count. The inner loop in poll_idle() has a substantially similar structure and constraints as smp_cond_load_relaxed_timeout(), so define smp_cond_time_check_count to the same value used in poll_idle(). Signed-off-by: Ankur Arora --- include/asm-generic/barrier.h | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h index d4f581c1e21d..77726ef807e4 100644 --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h @@ -273,6 +273,48 @@ do { \ }) #endif =20 +#ifndef smp_cond_time_check_count +/* + * Limit how often smp_cond_load_relaxed_timeout() evaluates time_expr_ns. + * This helps reduce the number of instructions executed while spin-waitin= g. + */ +#define smp_cond_time_check_count 200 +#endif + +/** + * smp_cond_load_relaxed_timeout() - (Spin) wait for cond with no ordering + * guarantees until a timeout expires. + * @ptr: pointer to the variable to wait on + * @cond: boolean expression to wait for + * @time_expr_ns: evaluates to the current time + * @time_limit_ns: compared against time_expr_ns + * + * Equivalent to using READ_ONCE() on the condition variable. + * + * Due to C lacking lambda expressions we load the value of *ptr into a + * pre-named variable @VAL to be used in @cond. + */ +#ifndef smp_cond_load_relaxed_timeout +#define smp_cond_load_relaxed_timeout(ptr, cond_expr, time_expr_ns, \ + time_limit_ns) ({ \ + typeof(ptr) __PTR =3D (ptr); \ + __unqual_scalar_typeof(*ptr) VAL; \ + unsigned int __count =3D 0; \ + for (;;) { \ + VAL =3D READ_ONCE(*__PTR); \ + if (cond_expr) \ + break; \ + cpu_relax(); \ + if (__count++ < smp_cond_time_check_count) \ + continue; \ + if ((time_expr_ns) >=3D time_limit_ns) \ + break; \ + __count =3D 0; \ + } \ + (typeof(*ptr))VAL; \ +}) +#endif + /* * pmem_wmb() ensures that all stores for which the modification * are written to persistent storage by preceding instructions have --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 CF302216E1B; Thu, 7 Nov 2024 19:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006560; cv=fail; b=IjEuuhqSz4CNrCdyeoLDFkh8RI0fyLlGtOHfGq8vIyJSkKYGfhd/Y9ZK+gZmm87rcneydRieygVknDn1p1+/UlowUudo2UWKN+HDGR78a2wnlAuBuVpqjjWOly1SMV0iat7wpFr2NGBKtWrItSHZIZIKYW0VkbOf5OtOmwmpjd8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006560; c=relaxed/simple; bh=BDCl1MhsWON2JFvI4wmDRNJbrX5sZLWtUuDRbN1J3P4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ozlJc/QPDkDWiiL0bNJVIAfMywMaKWNrJvnD/h63rlJKy0tXLK4LMk6VpjxJeO8ULIcJ6sDSQ1NE/KSYPAE+excobQeudRABCl520OcibekiQmFpVBO3Qr58gXy9Kmf6HMxAr1xoy86Nbb1EU1Dl94UY6VEZ7wuE6TrI/6a1zTM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=Jr1gkE9c; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=ag+ycG2B; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Jr1gkE9c"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="ag+ycG2B" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBdq9002594; Thu, 7 Nov 2024 19:08:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=SHv9Cs/97issh5XVuPCDyjXjH4adZ/Hx6B4wv0PiYXc=; b= Jr1gkE9cOaR4qQqzPgjnBwV/3Oh9zPP5BsgI4jCY8ND3VUDvXMC5M9ywthr/j8Na 00iXnNy77f5GO9EutajSwqWOwx/skRsR8eiuSpdvrjY1/8ARB/xtyJCqycScGGW7 NyTprBfTKWDlOQDe4udbdi7vD7XCd/Uttppk+972776aNl+mC3B9Gnb5fMKfYeNs 47hCxXF4IKm6I9qv3f+3xpG9ADpkMRvUbfEwTDLow42jS6svYR8MXKk6FaXYiR3v fXy5+4LP3t5FU98NiKc6zgsXyFwwBU+HH9+n9KEUaN0oBiCNiO9pwHXjyK12MUJg QymoUaUtCUuIfqbGyT5rxA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42ncmtbbax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:33 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7I0lqj004996; Thu, 7 Nov 2024 19:08:32 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42p87duyxe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DB52quUMObLJ0HnX5CiICNgtgYfz6gDAlT7N6VNiwILbaAOZ2cLM/utqN88Jz/mQhfl/XJXby+w+gaGyMwC5ebhUzPkTNEPrkOuR2ZtlXw2RYtng9bb8JcMELmw2bfVfRLdD79MO1BGQUtviUQZ/O2Y3PsgF9ib06swKTcMEdXZfPZdhex7RPal31MzPUgHxX/2axPY1Yj6vsBuBvo8T+7qff2mT/TkDtPJQ8S/uwIPCGnPAkHjqB7CuBhamvpxDiOUOlpF/2IL8I//x0WVo7pDBS7FV07Ez0ulS8DuefE/fX4I/ukKK0nEIFl6Dj00r3uIAWpbKTBgODoh2p+yGUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=SHv9Cs/97issh5XVuPCDyjXjH4adZ/Hx6B4wv0PiYXc=; b=aP+j89vpfCBoB6/cMvbBea7N4DkY4XjVeY9+vJ7yyljBk1c9tr1/zZmuSHrYtF3BeeXuTEgWrWPX9UXHwZ6g6Q0feVtMTCEeMskml0h/R8DxA+EFOV2QgOcyK67qL7QqiJBETXLb9mUIqm0hKRsu5bMtKE663BnlWm+zC87Ql9ji7ILZwCRDLQ1gTyXI6dTWJG2xtf93FHoXSA/7nND1eF5CR8ayO3RoYW9LN2biKxu97KIEK0rdjledjiDmjBeUh2ZzE8amD3h8hDVQhPD7ovMQQJnMKqXPrfZdej2oLTb3t1/mWQ+DX+Sr3UPio3MPxyiSfOl1eokXIkI9d0mr5w== 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=SHv9Cs/97issh5XVuPCDyjXjH4adZ/Hx6B4wv0PiYXc=; b=ag+ycG2BuMOU8X1gHOl9+6jkaKoop6HyLzOPE3V5qRQ0YjZXPkMh3eQm1xpTjMqqy/U0fz+14nYGV3b6efaBPSbOoWWwo59Rp57R2xw92duUU/i8znnHhbvj6pnQpMTljlsop/rIskOPUdndXBPy+twMXM5OckRJmThQekuAuCw= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:24 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:24 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 02/15] cpuidle/poll_state: poll via smp_cond_load_relaxed_timeout() Date: Thu, 7 Nov 2024 11:08:05 -0800 Message-Id: <20241107190818.522639-3-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0119.namprd04.prod.outlook.com (2603:10b6:303:83::34) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 496191a5-1878-475e-e1ca-08dcff5f8da0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?0hgg8iECDlfMrJVT497GNuuC2359l9sNOBiOixGHERemZwXSvDnmzXyUDifD?= =?us-ascii?Q?7AQuGuARtou6PxTYze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A?= =?us-ascii?Q?rq6oa7WbYd5FsjTIGJKG1GkEmLgClc2JZAQgy3oO57Xy+4UyDIsyeeXR//Wm?= =?us-ascii?Q?GzwGu93k6dbo6fRwr3/QmDs5JDAttfXrBNZ0EeC7qoPcvcZzxklWWXUTkAcn?= =?us-ascii?Q?9I8ZkbVYvi6yjkp1cp3IFnPbqXmX9t5wddMlKCL56ZqzwZFrNiryF5GhBIJB?= =?us-ascii?Q?j5fpyg3h3Rn06zSaqZ+3YC33PVaEQSJbRAdKzRFcj0cHxsFHd2dA9OYf24Wy?= =?us-ascii?Q?5I7Tk8QEDgHvkusxiM528Q0p9AObfnLxqdKUs+KYYfEDXA/HgwvIZsWHV2d2?= =?us-ascii?Q?j4HOXQBAaLpgzPKhAgSiikuRB35AVPfi5wBLU7ail8KkFS3RLg3KU2hL/C8E?= =?us-ascii?Q?YxU07AT9I8G40TbuX+zJOueP?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Rej+Jse6ecDynO96bmye2pZSvmjMq9kAZJPxT/ncHRD5mQ6s9sVmmUUQICyz?= =?us-ascii?Q?l42aVZZrR+fbHLjiEAOrD0IDA3ZmnQ6vfu2E1Pjex6W38oAjX9ns/3Of3GfX?= =?us-ascii?Q?vAyhmz7+GxNBxbPMGsUUKyS5eYPLZ7oBp6UinfV7kI0XOw29BBStwEUBiatv?= =?us-ascii?Q?L5OO4SbTVeWD9VmaF4Ocw/qsNrIKKLDB4iOUTYA9yXtiVyvJrAvlX7U2FSKP?= =?us-ascii?Q?iVp8IlGvswSZAKSVjOZ2JWbOMdJJ+9mGDc373h7sNjI7EaGyIGJmBjo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V5iPQShNkoEZD6qNviRscCsrN4926m4V+XhKd+SVZvWaJDqWsARSYpFjVNKxTBlL+wHmrXGb7EhZU46186AdTE0OE3EO5u9m6QVdOkMt7rhVmfat/svyk6LHN+z6uvlf5fbjKbCfKUb8NNhAcN1aQ1lCj/JiSIjJsqVTL4FsDTNnwM/Z2ivTD0G678btK5votWkU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 496191a5-1878-475e-e1ca-08dcff5f8da0 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:24.4522 (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: Pzka9mZ6XuFs1pIry/37ut3+5SEkXymxlIydrJItch0xjJPbt6OBtgRa6xT9j2T02fBRE51rakmSdrlKf48FhbXxhPIw+1hqonfGWUL9P5Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: yk1XHf2qy2c34TBbM0O0V8qKz8aAcW-i X-Proofpoint-ORIG-GUID: yk1XHf2qy2c34TBbM0O0V8qKz8aAcW-i Content-Type: text/plain; charset="utf-8" The inner loop in poll_idle() polls to see if the thread's TIF_NEED_RESCHED bit is set. The loop exits once the condition is met, or if the poll time limit has been exceeded. To minimize the number of instructions executed in each iteration, the time check is rate-limited. In addition, each loop iteration executes cpu_relax() which on certain platforms provides a hint to the pipeline that the loop is busy-waiting, which allows the processor to reduce power consumption. However, cpu_relax() is defined optimally only on x86. On arm64, for instance, it is implemented as a YIELD which only serves as a hint to the CPU that it prioritize a different hardware thread if one is available. arm64, does expose a more optimal polling mechanism via smp_cond_load_relaxed_timeout() which uses LDXR, WFE to wait until a store to a specified region, or until a timeout. These semantics are essentially identical to what we want from poll_idle(). So, restructure the loop to use smp_cond_load_relaxed_timeout() instead. The generated code remains close to the original version. Suggested-by: Catalin Marinas Signed-off-by: Ankur Arora --- drivers/cpuidle/poll_state.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 9b6d90a72601..0b42971393c9 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -8,35 +8,24 @@ #include #include =20 -#define POLL_IDLE_RELAX_COUNT 200 - static int __cpuidle poll_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - u64 time_start; - - time_start =3D local_clock_noinstr(); =20 dev->poll_time_limit =3D false; =20 raw_local_irq_enable(); if (!current_set_polling_and_test()) { - unsigned int loop_count =3D 0; - u64 limit; + unsigned long flags; + u64 time_start =3D local_clock_noinstr(); + u64 limit =3D cpuidle_poll_time(drv, dev); =20 - limit =3D cpuidle_poll_time(drv, dev); + flags =3D smp_cond_load_relaxed_timeout(¤t_thread_info()->flags, + VAL & _TIF_NEED_RESCHED, + local_clock_noinstr(), + time_start + limit); =20 - while (!need_resched()) { - cpu_relax(); - if (loop_count++ < POLL_IDLE_RELAX_COUNT) - continue; - - loop_count =3D 0; - if (local_clock_noinstr() - time_start > limit) { - dev->poll_time_limit =3D true; - break; - } - } + dev->poll_time_limit =3D !(flags & _TIF_NEED_RESCHED); } raw_local_irq_disable(); =20 --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 788B0215033; Thu, 7 Nov 2024 19:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006560; cv=fail; b=dUHBn2+1WJRbDX5G7122xpspITBbAEVhBEfNMjGVQU/9AftPGhiTjBplTj33jxZkGR/xUk5PR3VAExauLnxrGw33GJ5+47mbeGTiiH4BmHicb9Ml5FFCghj2tXo38852GReTv6uY8MNPOSoG8n/8T61YOL+h95mLcSlifms/doI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006560; c=relaxed/simple; bh=PwVyUlZdbIDBF1/bUbXmwuOydrkBDC/BFxP00H3+CzA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fSmUM96+0o2yiSK5JK8lk3rM9YKtMziImOlm1udnRRXv6xHknJEAwN+uETJfyCdlhcV/1i88vbdemTpo+BaYama6982fSzMqqdvsZsOt5mKH0or2X16pHJjee95OhpiqGTBgIXRfk9mkXE03oxrhLY0GdXxzS2JcrL6jb37ISDk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=ZZL9Fo+y; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=eiAB0pCg; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ZZL9Fo+y"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="eiAB0pCg" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBgId004757; Thu, 7 Nov 2024 19:08:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=B6fLm9OqSkSyvw9TBx1v5GU+/szIZK9hzT9YLCixq4A=; b= ZZL9Fo+y/YCoZ/j4OwPmLqj6uMsaVW5oBJcabiIyifEi/tHcoJuoJCT4lmqTZtTZ 3occdQ1ijW5+fH6FZ0ZUwXb6NjXsobM+EIJTuXJ6EX2DVvDXMqzBtYObON/duvN0 CfNYO+St11386qvNtIMY8Zl3FatPX2lVuLMuaQQp4YpgD0gOxtSE+x93qEStvzWI mNj34pN9JmPfFfkrFJZA2+TiYC0BzV1sdcEKZMy7FTuTVetHx6gKp3ubC231WCXc BbDGNsE+if1JIYSC2x/Es9DA+9ArwGeQn0D0Xq6YuquDhQMsk+88sBmGVwiRMT2e uUJZS8fHEJ/1VGw0dceTAg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nap03d7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:37 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7Ivawg031517; Thu, 7 Nov 2024 19:08:36 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42naha6cbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sFMoF2hv8vhw9VEhzAu1MvxxUTEKCOHmlHotI6M/2s0L46HAr6fsekCdfZo/pCGUaf3v4ckMtLcPqXjZ/Xhn7549RcIFlpCtux2+eGnobUV4j2TdggiZGNnKbgqRtHeTbjUsGXc9ZwYun4SvAp1zdCa670pdjyTut/dca7HfpaZMf714SwsmlVLw8p9xUqEnDelvxWQ5dVkEHNKrLwZZpAgrIpq6Zpy//oNf4LJ68/RMwf6xuD3trXYzZYwLLlSxw1pwIbctmDXlf1f+2H8QC7/GugN3lobFGK7db+MBsqS0mRpmSzaK3lWAU7lnoXlI+bMeDxP1//01OOn0nUL+7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=B6fLm9OqSkSyvw9TBx1v5GU+/szIZK9hzT9YLCixq4A=; b=OZ9aQTskzYjUGIS5HWQJq0onngmrnpDzoeZ6V/3AGvD6pwgZxmnjq888bgFujP1tgzs3PeaStpF9c5eP/5uOHslLmMGgav4Tx0xoSCH2X10uWW3h3pn0IEww70rHcIs2cv5sW09qL5YTQuU7eFLToxHnNEpDnzWwgPdcEPdUaCk/DuFAVfD7AD/ZVvik57HC0tNbGq0jMQuSJeUFQEARrzov9vQsOfwg6upp6xZnxYXaOzIqJzQ08m0o49TtX1NnONmDGWbQTT5ZFctK43fJB975pCHWSIMUpb1gqBnRutPyq0XnNmICUiLXM1IeHCLQjibkm7T6GYB15e5bUHyPkg== 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=B6fLm9OqSkSyvw9TBx1v5GU+/szIZK9hzT9YLCixq4A=; b=eiAB0pCg5NpZZ3i0fF6j2JAXI6yV5YM2gCfiutNqnCPJPN/MfzgqGpdjn7siPbnJvsi9FexqcGgAEIUEMhXko7TTSNDni3VEDjAbWqbcARNTw8i3mreslyfR22a+z9Hetu72g3IdihbgMAMznoyKahyWnCGgcCSV483QQsdrf8E= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:29 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:29 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 03/15] cpuidle: rename ARCH_HAS_CPU_RELAX to ARCH_HAS_OPTIMIZED_POLL Date: Thu, 7 Nov 2024 11:08:06 -0800 Message-Id: <20241107190818.522639-4-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0091.namprd04.prod.outlook.com (2603:10b6:303:83::6) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: d10348a3-4941-4d8b-4751-08dcff5f908c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6MS+3T1y7OBib6UMi6vYmV9jZsQENBacWVrB75YeEr7Xs1emR3GWgGere0TM?= =?us-ascii?Q?IIEHC6vNawlAdfTK7ilZr20DBYQMeZ7hdalzL2dNvghLnlSg8F+IBGtIYvS7?= =?us-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D+Yd0N6txJWqim+tnpYt3b7G4?= =?us-ascii?Q?QCwj4/tyh+OwvyFbFkG1/a7Qvi/bK5jcJAS/RS5/MId5vKoujz6fJzsdKHU6?= =?us-ascii?Q?so/FPAPYbRYMQlaCcL2JjY4ebyq9yfwBMZrrG4IpRshZujd348z5bUJcT+Et?= =?us-ascii?Q?cefu0XpNA2Um7ae16i3Mc1VbbstBBLKCXECYnEEtpbtqrRZpHP4nL3sfqgXY?= =?us-ascii?Q?PkPo/bwjxUPfjDUuCS9x93LVod0j6qzrhYQ9iefnqkuea2jtliQt81N20pwA?= =?us-ascii?Q?enniMHVy1/SiNvnfROHFEBkysWMw+JXZ7zI8gT8SSboQCaNsPnO4VPoTTW21?= =?us-ascii?Q?O+BfAXKdra8I2f3a7VQ8NO5y?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t5xfwZnYZP65GigmSqa+A6kOkapMSk3PI4i0ePQN/KdpcJk0wJliwHAJdBzf?= =?us-ascii?Q?z0DKv/t3c5OwA9YwihEn5z9kTpX+wfR4wpmhxt8WKMBG1sdmm1N61Aw7jowM?= =?us-ascii?Q?VHvKqSUq1V3iGXEEWmrGTpYt+b2dErkp/nLRqRPMfrT6Ib0289KD5MyK0ZKa?= =?us-ascii?Q?d6vjmhQ0I/R5J+9i5iz3wHl/TgzlMZL6bikJigrAnjyIIfvzJir0yxENW1vJ?= =?us-ascii?Q?NoALRMV34CaGdUdnJnTKmgV61ILFEKW43rrC5/d6knCRKbu+SwRf/91mMaTs?= =?us-ascii?Q?zsHY5G1e0l+DlrgQh+b5n53XHpfCObe7KuS8GiIXn56zuh1mPmDT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qXYUkFlBEf5+i12ZrV4/Pwachx0PrJfbvUuCP1fFSI9ntT+zr2V6Bv9DSYr7GPPwEoz3jiy7Apy9+XPh4KkP8AkP08Ix7F1TaY0M4mEReWOuAoNJwSzLqRObv1w96hZSjO/JxexAxT9SNI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d10348a3-4941-4d8b-4751-08dcff5f908c X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:29.3375 (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: vAgJI52or50C/025PDhNpMrwka2b5uKHpatSoq+3Uv38hWn8A1KSiRMDpM349pC4cgaQnVqnB8EnqILw66WVyOUZzW6SM32NV5zbh7Kt4iE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: 9ej_sRjuyeQsq4-bgCB1cu4XLkKaJPGU X-Proofpoint-GUID: 9ej_sRjuyeQsq4-bgCB1cu4XLkKaJPGU Content-Type: text/plain; charset="utf-8" ARCH_HAS_CPU_RELAX is defined on architectures that provide an primitive (via cpu_relax()) that can be used as part of a polling mechanism -- one that would be cheaper than spinning in a tight loop. However, recent changes in poll_idle() mean that a higher level primitive -- smp_cond_load_relaxed() is used for polling. This would in-turn use cpu_relax() or an architecture specific implementation. On ARM64 in particular this turns into a WFE which waits on a store to a cacheline instead of a busy poll. Accordingly condition the polling drivers on ARCH_HAS_OPTIMIZED_POLL instead of ARCH_HAS_CPU_RELAX. While at it, make both intel-idle and cpuidle-haltpoll explicitly depend on ARCH_HAS_CPU_RELAX. Suggested-by: Will Deacon Signed-off-by: Ankur Arora --- arch/x86/Kconfig | 2 +- drivers/acpi/processor_idle.c | 4 ++-- drivers/cpuidle/Kconfig | 2 +- drivers/cpuidle/Makefile | 2 +- drivers/idle/Kconfig | 1 + include/linux/cpuidle.h | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 16354dfa6d96..3fa741dc0445 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -378,7 +378,7 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y =20 -config ARCH_HAS_CPU_RELAX +config ARCH_HAS_OPTIMIZED_POLL def_bool y =20 config ARCH_HIBERNATION_POSSIBLE diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 831fa4a12159..44096406d65d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -35,7 +35,7 @@ #include #endif =20 -#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 := 0) +#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL) = ? 1 : 0) =20 static unsigned int max_cstate __read_mostly =3D ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0400); @@ -782,7 +782,7 @@ static int acpi_processor_setup_cstates(struct acpi_pro= cessor *pr) if (max_cstate =3D=3D 0) max_cstate =3D 1; =20 - if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { + if (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL)) { cpuidle_poll_state_init(drv); count =3D 1; } else { diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index cac5997dca50..75f6e176bbc8 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -73,7 +73,7 @@ endmenu =20 config HALTPOLL_CPUIDLE tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST + depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index d103342b7cfc..f29dfd1525b0 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -7,7 +7,7 @@ obj-y +=3D cpuidle.o driver.o governor.o sysfs.o governors/ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) +=3D coupled.o obj-$(CONFIG_DT_IDLE_STATES) +=3D dt_idle_states.o obj-$(CONFIG_DT_IDLE_GENPD) +=3D dt_idle_genpd.o -obj-$(CONFIG_ARCH_HAS_CPU_RELAX) +=3D poll_state.o +obj-$(CONFIG_ARCH_HAS_OPTIMIZED_POLL) +=3D poll_state.o obj-$(CONFIG_HALTPOLL_CPUIDLE) +=3D cpuidle-haltpoll.o =20 ##########################################################################= ######## diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index 6707d2539fc4..6f9b1d48fede 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -4,6 +4,7 @@ config INTEL_IDLE depends on CPU_IDLE depends on X86 depends on CPU_SUP_INTEL + depends on ARCH_HAS_OPTIMIZED_POLL help Enable intel_idle, a cpuidle driver that includes knowledge of native Intel hardware idle features. The acpi_idle driver diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 3183aeb7f5b4..7e7e58a17b07 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -275,7 +275,7 @@ static inline void cpuidle_coupled_parallel_barrier(str= uct cpuidle_device *dev, } #endif =20 -#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX) +#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_OPTIMIZED_POLL) void cpuidle_poll_state_init(struct cpuidle_driver *drv); #else static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 B8826217F5C; Thu, 7 Nov 2024 19:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; cv=fail; b=uH8+TBHH3PoYp07ba2q3sKCPX4h4sWNPZcr6pjm2T9UQxcDB6S8TmIx/KSD8gB96VRGQ/XIcTD0XZSdTDOk37sCaG9+TsYC4vd+vOTr6+RteMctfCDQFnjX1IBjeZmKGeqBZcra0N0KZE/jsmodghQ6LEcBG5ykzBqmnSjC46i0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; c=relaxed/simple; bh=hfPYdh7x51+QVluRmrqoK23L2K6qNApoULYegZCT5I0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=qPs7rC5N9poS0jhdKcThslTspCbjLthriHNpDiQdHI5uAT+BYKkPlyN7i1PF+Sh/fqld2o6RIIAdINiVBxHy4xXTg5ItYTN0mBvh8jB5SFQ0iUQIs89xxVRqNA8KEZNZOoa9eUAcPKI3osreWXpEI5teDxFrNRCDz+8/qIldp/M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=Lt/tyFAT; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=qXWBKLjJ; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Lt/tyFAT"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="qXWBKLjJ" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBfIi004745; Thu, 7 Nov 2024 19:08:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=v/7lVyfIFoYvOw/bCZEaRVQqXNTqEcVFYh9ptR2EzVI=; b= Lt/tyFAT2WywQx13oK9zeshBd6/PhWBP4RzobJdrXq/q704g6RlDzbDzX8afVAIP J5fBkp1TX0Pgx2LaGiNSDm4hlVJd/NZ/97cQDntl9ywoKtl3tAEQ3oUudZnH7vev XOuE+kXiKMIv88PUK0yFIF71FGszqJqvaUNvTw7MHe9Xs6n4uBpvO2/gT3NXnRsr 1JGDEWgy9ZNwR8eKJ0KoR519/VjP0Vf50rMfHxyth826zd0JLSYC13hE1RnzZBu4 01u0ZnXvgIc6zZv2UUQg3MX17xxGYaJP8eKBCF+Mpud5Jw/JSjbrwZAc9fBFtIy4 2P62KP1NfcA4Qy6Uf4EcdQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nap03d7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:40 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7I8FXA036113; Thu, 7 Nov 2024 19:08:38 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgsuqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B9WanmIovLtlnwGrab1sDs195fePP7ctFCxiSjhXfUkP6a25TaxYMvoqXADCcZBgAhDyAHRNQbCQCQcXjTAxH2YibpM+mOYF43o+Ej8mTvv6KF52T9zDbm8cmpNRaffLgrmzn2dlnciIq1ZkFh0/x76BNV7206E+WjLbBKAN0b0BBQzTYZytpxhIswYaosiUGQG0EzLF1NY4pA8CAdCtlPHMh/ANtNURHOLENjinTfNhag2UL/Blzz+FNpxjQw4uCF9DNJdnkyfLa034j/Goh6mlRPPJ6ZxGdbAyEMpMVgRqqCvUu/r5ovhwcvFKDlNSNt82iJmBurgY7Pu3nk17rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=v/7lVyfIFoYvOw/bCZEaRVQqXNTqEcVFYh9ptR2EzVI=; b=kmp9n1qW72EtDF0OL1OcqW/JxKCTFsuB+s/84ldcf55nRde5Hx+KdpbF44FJscXvb1hVrOIXXhoUaefsoMNTGtEgVSFImtG5LwAARdDHSWBKc9vsZRQS0nrQSoZHOcXYZKfi27WK8rW7YSM1EE+5jBlKa2mWSZC2cL2zDLcr/4iw13v4JwBn5U7Q/HTeALmLTS9yXOm0GUrnA44F1F5vo19aT8gtX9W3K5KOwObO0ESW9fTJWqVS6joBzW0FQFE7lpQncx5VwrSM4n5p4uYRhx4MrVFZ23XpO2YRKu4aVxuDc9oQrzMclBVOkirTV267VWsrabdzybMory/jMPWFOA== 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=v/7lVyfIFoYvOw/bCZEaRVQqXNTqEcVFYh9ptR2EzVI=; b=qXWBKLjJdf1d0rDDBfp//a2wUcfsCK67fuiA7zAGV4d/TiCImft2JBxT4YVs/Fdx4bdDGxCQgGXu2ub2i8hBGsU5rjmwHpoY3QSmDgAzsEjDQR97A06D5YYsXIVKQmL8W5MZ10FR835MFyMDIQ03icB2F4XibXdG1Kpae/9gcRM= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:31 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:31 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 04/15] Kconfig: move ARCH_HAS_OPTIMIZED_POLL to arch/Kconfig Date: Thu, 7 Nov 2024 11:08:07 -0800 Message-Id: <20241107190818.522639-5-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0096.namprd04.prod.outlook.com (2603:10b6:303:83::11) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: d5ba2132-184b-4f91-0ad2-08dcff5f91a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BlWNPt+x7vHkxDjPY6q5KpTd8SHwx/astqD0kxR7jzsRr/+S6Wxmvm1Id6bL?= =?us-ascii?Q?5P36R14GkP4E9RhJaijmIbx5JEPL1GbBfhKXQD0aL+uvDoU23/P7TXCihLIA?= =?us-ascii?Q?eQKBni+lzvg+E4hD9FytSM3PVjToHhJsBEwOrLbQd+KsX3bnrAV5v0+GSEyy?= =?us-ascii?Q?tWnApCJUsqc+j6JCG/INA1jArhrV06gXqCBhlqiqCOR/iLncyqeXscdmWHrl?= =?us-ascii?Q?JB8cLIews1vsnd2iWUbYbZpMp/l/lhKGD7ms/AOVBaukvcFlM+cXSyaw4UPJ?= =?us-ascii?Q?+D5xEYQX2NBAYV9FBnAlqISHU/ZiM3h/ZJKC6OUePP8/7+4wJhsZJyjzWtZ9?= =?us-ascii?Q?OH519EIW/KkA3jV8h+jbFqZxscf/9D0O1e69RyHYqQgqOYdoN+eYgLVpIAW7?= =?us-ascii?Q?qxnmbKw2uxKzdNlVy5SIslbKxv3JY0yUqB+2uDrT0PHLdHdfIboGzlo/+tRl?= =?us-ascii?Q?wqRUjEESRSNUH1zI2k+GoE+JEZKVOeV7D5Lnhiqij/8fsS/lf6ihDqCWnTg4?= =?us-ascii?Q?ZA3UXF1rluqjAsYHbHBtG8A+WvtgHRqptNmYu9EFiIy84TjLFvc8GiZZW2aP?= =?us-ascii?Q?5hk1jCS5gCsfDLCWiIzegN2CRm9SV9fwyTDg69nlINWv0QqB76VDTpKxM/rS?= =?us-ascii?Q?xLC8lNFu/SFg7fhOrsrQky6bQfEd6yx4SVOlreS/v/xkoG3AMqNpc0swBUcw?= =?us-ascii?Q?kZ/nuX5W/5lqh8nq66AHKggys4vGF6k81agqRKD2UAN6kjF+2cDjeqQ3sWpo?= =?us-ascii?Q?mAuxagapXuoeK+6IalnFqH3skZ34cJ6eAfcV+81Ef9emjM8V2NitYhS3ZhgB?= =?us-ascii?Q?eujmbexZOUxehTOISY5bF1U9Ma6NwwYaB4z7N63ZkjLPfiqkKXnJczNJYBlK?= =?us-ascii?Q?oBzoajG0L39ihu3Q1YmkI/W83Ly8X6geUdbxbMWLCyXIBo+OTVNkR32SVLuF?= =?us-ascii?Q?pcZUcthfP6t9h/m5c1yWmGMsUMTWf0T0PmsGI++96CVCCIEJGS7NPgqCSVUu?= =?us-ascii?Q?XlP4S/caZVHI+j69Lqb0lTMoz+qFBm/brV+cTV/fRlbmB+qqlM5y6VisqYvz?= =?us-ascii?Q?HXJw/S+Kz9+3MNPGEQ+0QDzk3BaGLTQhUIgZLsHqLq1sBXLrm+Zo5LItmmAL?= =?us-ascii?Q?3Dyr4qCHcXhoMZz4/19gSIB2poCIAw5nY/GjmVCyRVFNaZgfs214pC180G2z?= =?us-ascii?Q?KArXscPdnL1M+FApVUOP2QUizoVdmOuBEwBxKV8r3FqDNhT1NMeb+oQiRV2G?= =?us-ascii?Q?rvz+kii8EgoBPLCOg0zyCldfjxHXmJmP6ew1e2t1GyymthPRIN25HD/Dk1Bl?= =?us-ascii?Q?kz3aQ7RvSO+y8Iff9clIljQ8?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aOq6QZbgzYmeh0c7AIBL+K2gHDeHba66gmv9B6BGb2mbtNzJIZDX+qMtOxBL?= =?us-ascii?Q?oUd0Gb49Xueg1mzk++lPdXSEBVPizDHDXVnnVpswfj17mzsCashW4VGYf0ek?= =?us-ascii?Q?RshpqZVMUEBzcktXd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WMvXpH?= =?us-ascii?Q?TrxTcTH+7OnuqKYmLG2++XtkqhvSpnwWV0G2gb4dCUVTI45+/+/ylX7d88/g?= =?us-ascii?Q?MZAxvp+XzA6NjarCbT4tVKfD70F9ulx106Qa6HdgD0rrCbyX4SyIUQscgsu1?= =?us-ascii?Q?snAGDiPi/GLh0PVPqUTiplrTzrg0D9EcOhSaILJI6V1tsBOjcv3BxQ+QrQMo?= =?us-ascii?Q?esZELZ59AVSIQ81DCQBC4wZ+ZWhDBSaEARLoX8kj3yJQDKsrTIvq+Yrg264s?= =?us-ascii?Q?hSxnnHNk7skxklF+wvI0DM3fhHTRiAwYSTtFHpIVIBOJSd3WXShEgA61JsJN?= =?us-ascii?Q?plqWojn2tBj8gLuOHIi9DlcG0LNSqNFWgsIRkj9dSOa3Zhw7OK8IyHbNwW8U?= =?us-ascii?Q?KWgsG6Y4dMBOCxSB1krN0lmrnCnH06tJtB8rcY7OgXzbDxAfdEOodP+tVCjf?= =?us-ascii?Q?GUWIFh/sVClMPPTkLN3gavEImcWOKdycqc3AXehFjEUn8mUJ9ZFFx7F8FYqA?= =?us-ascii?Q?xQPxeVqmHZoMFGL0mlsaZ4UUyT6M1i6cDHnw0g0Un5gOf7orzxYF0ok66a4d?= =?us-ascii?Q?Kq2t8ItZ7Yfd+wEtoef8pHIpfD0gueAfxDfLPIEs6Rq3e9oshqqi038WxUoX?= =?us-ascii?Q?yA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: He/+vt5GqqrpG4dJr0Iio3YXh6ABPaCA4hHgQfTQ9RsYzBZofUtHyLqeusgNB01WVHNvVpbfP72TkG7beX/7xppBA/fgNQK34ITx69F4NSKWCaVQZNZmT2GbAtBwHaH33nanj5sax4MyDo4H6WWDkLH1s4scJ+hdlWV6XEnDebOfvkaHz/ycKZ1bpkABSZmoXqNPEE0rrPpOu4ZsIMqbrsB+wZco/1bYUzgemDpmm9+4pj7XLb0r+4dZF25NLVpPxP+K4hgXrhnbhFreeZiGRQSIj3mBZmC43JqjCWJkmaLaqEmGy2l3GRORvv8h+nzjWPdhXl1oo2s6pbp28a/ScYmmOw7RL+b8+xhNR1yDEY/zXvOgTgDGIDsDrly8ZOXbOr3E6qOPByLIpnxsSPTme5+xdVzC+Ehs2nEWj0r+qHS0ThjF0jsQ4H/7aVyXHI5ictxWfwwZfF7UZweWxJJgzePOr/10R9bxrV4+90fa/3ZSfS5KEtAly23FaBw5I9xUU/Uxqn6iF7QRuzrXxMSEB3rFQwY4b3N2baL+mIT4ha/p6TLymIBng214FgCtk92f0KQo5iiv60o6YUh4SyYym0NTs2jCJReBd+CyOxmuubI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5ba2132-184b-4f91-0ad2-08dcff5f91a4 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:31.2781 (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: ar3g8dVwZCfJuo4Ria3tNAzYUoeR8DYLWTbkvkulhacLP50FEX2f4G7HCHwl2k80zSK1mvUWKZLRiFFVCB0iWHRzKotCm5vCtAlYJPUUlAw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: aq1DsHo4V0hYNVc-lty7h9dL8F-XcWNh X-Proofpoint-GUID: aq1DsHo4V0hYNVc-lty7h9dL8F-XcWNh Content-Type: text/plain; charset="utf-8" From: Joao Martins ARCH_HAS_OPTIMIZED_POLL gates selection of polling while idle in poll_idle(). Move the configuration option to arch/Kconfig to allow non-x86 architectures to select it. Note that ARCH_HAS_OPTIMIZED_POLL should probably be exclusive with GENERIC_IDLE_POLL_SETUP (which controls the generic polling logic in cpu_idle_poll()). However, that would remove boot options (hlt=3D, nohlt=3D). So, leave it untouched for now. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index bd9f095d69fa..c3a9de71c09f 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -273,6 +273,9 @@ config HAVE_ARCH_TRACEHOOK config HAVE_DMA_CONTIGUOUS bool =20 +config ARCH_HAS_OPTIMIZED_POLL + bool + config GENERIC_SMP_IDLE_THREAD bool =20 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 3fa741dc0445..df75df8467d1 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -138,6 +138,7 @@ config X86 select ARCH_WANTS_NO_INSTR select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANT_OPTIMIZE_DAX_VMEMMAP if X86_64 select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP if X86_64 @@ -378,9 +379,6 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y =20 -config ARCH_HAS_OPTIMIZED_POLL - def_bool y - config ARCH_HIBERNATION_POSSIBLE def_bool y =20 --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 834E5218322; Thu, 7 Nov 2024 19:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006564; cv=fail; b=onsHGRd/28nsU3NTYELPaM5M3oENjYk34MApNzWmWBt0HJe7rJinyvGa0MdTSW32rjMh2QSe6jafwbl2MBSMVRAnnIsD/zvjpmAoMY9BJL1XZwbOGzI+b/sHTnSNLfePY4mZgFYfxl4CtigMDwcKwiDNIUk7lL89wyawl+Dw2Lw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006564; c=relaxed/simple; bh=JYn5wVW8/k2YULpQUQWZW2RCzfJBbpHpkZ6dIdagIZI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=m3W7hQq5hw1xijKyp2GRDBHyKbMMKfNci8Sj9cKx0sRImXeYUaQcEcASNB4m5mlMm+M2YLREiVP/vR+Wgj7Bwq7sWSOw6jtUYJ/v3jL5moUAUOqI6YfNy1XXiv9U/4fyVwxTbtx+BaCp35cuhigU3g6KGeL80MuZGAzwtr1KTBI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=EFDl42AA; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=FRfcz6Rw; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EFDl42AA"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="FRfcz6Rw" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBd6s002605; Thu, 7 Nov 2024 19:08:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=QVSV206N3GHQLIOxxufrNmI2FZJL2ktslxGjHp7FL+M=; b= EFDl42AA8IEjLuJqGFYM1drzrCOKXvxNhmRAaNbH61BsZZUmU4p6kiON623vSN5m eUCIKKCeXsU9TsPWIt8xQf1OgkzafzNcIn4Hk+49e5bWF2vw9PmOPR3DoxdC0MxL ZGfRsOAp9a68a7mMpgAgVNijs0ER7GQRMIduYUzVWcb2Btt84xZE0R3WujU84uQC VIf8Mbw41CxJkDrUHT2oAQzQwce0XHplxSxwM56scvZsUAZ1O9MVZyDt/2wDu9Ig RyiE7bs0h0viKkOmObKllKdtQ89Fht/Gxg0tgfrMF4sjSDqi0YxuYf5LuqAONCv8 YjzO4+VOoTx/luTGwRbBDA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42ncmtbbbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:42 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7InMAG036151; Thu, 7 Nov 2024 19:08:41 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgsus5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=seHSIipGPEQhS0/xIvBxEDaPTFGeTjMVFFukR7UAMzxT8djuIEpTKaabusYyfV35PRwcw+HnbZHxW7tO9KAezLdyzpo72D/+/UELQC8t0VC+mDdFTSmHfdxf4kziJ3lIY+cIgrZU+XEnuekAtjwYHX8tDz3qasS49qvr6pxrcDeFRqAchjl89H5jg7LsgtSZLuQytEQLjrl8iQRWEx5rW7FXnjNFhKHTk7jrRoJ5XNv+VCSZpscrEapY3QqafU95JHLzFHy1gsdTbzpHuPWpnV5fzY/zgt0pEOhipTnMZJ03VKW51EeUn+xQ0/ieK244p0t44WqO+XZMUs0xMzER0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=QVSV206N3GHQLIOxxufrNmI2FZJL2ktslxGjHp7FL+M=; b=CkEsD1aNb5G6NeTy7/768rpPkXRGpbK4+c7EFjCFStC5IdU9+Iwkq1Bvn8CR4GPLJP108C21JaQnczJJExsGDrh3IhEAs6Z+RR51xYPc8zQ5c0R4Wu+hwzjgFCpFgdZAjwATX1TDCRvYTTkeyCcU2f+2zZP4ES2eRyvI83VMXrYCrevsZucxEQKTJo6eeZpRd1WSJCfO+V+oUtUp6apfWi/LtsDPHGQJBaWyEWlM9wjbhxVxaT3sO9vgLJ5BkRl3WB+O1joVmEjnIvjU0jvWBQo1zSYqFXvvr9urbybIBZ9jOMfJZhfb3D2KDg++L+qi7jh0q2l7WSxu+f7jhL3vhQ== 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=QVSV206N3GHQLIOxxufrNmI2FZJL2ktslxGjHp7FL+M=; b=FRfcz6RwAismBljLE0g0KttETzFHAQHEPzfQW7e8EcGY2BXXLVLGrfEWAkrPcrqiDFHYTgqFZE4s60xbha0ZYrr9t2FRxjGxXDlZzdAywwQ3kM9nqgisZxYpbHQtuKIq/uRAkvKsWiqP6giLXyrAx96Hh/cggU9pL7mqP7SH1So= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:33 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:33 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 05/15] arm64: barrier: add support for smp_cond_relaxed_timeout() Date: Thu, 7 Nov 2024 11:08:08 -0800 Message-Id: <20241107190818.522639-6-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0093.namprd04.prod.outlook.com (2603:10b6:303:83::8) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d913a48-1157-4b18-8cda-08dcff5f9312 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Y6eHZHFZnflEs5voIF/jAN+045gU/c+X/ZcZqtYiflo7ekrFdlPhAGSnXamQ?= =?us-ascii?Q?wUY4DR+pEgI7SnzLNDkR8Abi8jG3qFyxyApsD63bpd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CbGcZwcah+G76gZOVSOwjAZjZ3aOI65iqBffGfG0AiXvBn5tf6V/?= =?us-ascii?Q?m/aeyxd3t56fI+2Q63zk1DfunlsAJv9q8SLxFo9RW+qPwuJf1DVkRfyF6Ixx?= =?us-ascii?Q?EVphvZJ1SplbbDdhSQbftzrF4BZY0jf8t9mA4ldcls/CmEIAcx0INYIxYaV7?= =?us-ascii?Q?CFNWQyUYu0c6a2g+h00AdqK55NnNpYW7mZ5NYYkJ2h9uhG8aCd50plWgQeVo?= =?us-ascii?Q?4mbX1/S1g0Nql7p7OjcO0ehYVobzoNGGCauxRYXh1FP596MirNuJTpi/vnpH?= =?us-ascii?Q?tCyJZAXhIMwDVnvDPs5iwBLAPdSPd5uTSDKTVgPhy6BYVvwS8+nM654R3U2Q?= =?us-ascii?Q?pbM=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7W98LfaNJCkCUYu5vCJaKEUyTYtdgFs5M0o6NHd5ZghjYE8srNmIbdof9dMn?= =?us-ascii?Q?mxY93rGIv+JFRNAuQbItT+ZMDpDuHSvvHP4rKTfXepXZ7ZiHZczFGYVoaB+3?= =?us-ascii?Q?SYlYVHMMpnI3WQQ6+s33fxYUMxlqMkwYPdMdWMYhreFOoNZad9P6xOvFXVQu?= =?us-ascii?Q?OfqFOy6LKdDEYqHA/ccjx0mBcA4UAeuN8nqCgHK8T/6hwcsHIMJRt9TkUZuH?= =?us-ascii?Q?QupQ5r54Q8y8IIcEtxfasHYB5jyMWMYkbCureTAfKx7auaByMfn1Nn5ssw8Z?= =?us-ascii?Q?KIFb3tN90qOTlOd+Xbj1BUEBn7zhH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Q02ljW7NSP1J7tNU9LUSvrzNb6Ibyj217j1bXW0xwKjxW9S2yQScnGoLd50RXTnnSXsY0GifGKxEfuMItuhTNZ2TjZLl4g/3ylG3/7UBWfyG9QiOW/j751+dnSP6wUXqY5FKnnaVZEjsSa+Ji5qEhXXzd+lr1miyo8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d913a48-1157-4b18-8cda-08dcff5f9312 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:33.7386 (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: YNe/rJaMsvCPSKTYLsm4zVnH8jovxrVFYCnphYZLll9JsE4NW00GBkYT92YhYtzjN3vDg//q+BcKhHa0Od8AmA6ntvT/F4sUQJuODg4nLR8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: -IyB3pGUmSkPCHRc5sUAyhKL3GwhKnnk X-Proofpoint-ORIG-GUID: -IyB3pGUmSkPCHRc5sUAyhKL3GwhKnnk Content-Type: text/plain; charset="utf-8" Support a waited variant of polling on a conditional variable via smp_cond_relaxed_timeout(). This uses the __cmpwait_relaxed() primitive to do the actual waiting, when the wait can be guaranteed to not block forever (in case there are no stores to the waited for cacheline.) For this we depend on the availability of the event-stream. For cases when the event-stream is unavailable, we fallback to a spin-waited implementation which is identical to the generic variant. Signed-off-by: Ankur Arora --- arch/arm64/include/asm/barrier.h | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barr= ier.h index 1ca947d5c939..ab2515ecd6ca 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -216,6 +216,60 @@ do { \ (typeof(*ptr))VAL; \ }) =20 +#define __smp_cond_load_timeout_spin(ptr, cond_expr, \ + time_expr_ns, time_limit_ns) \ +({ \ + typeof(ptr) __PTR =3D (ptr); \ + __unqual_scalar_typeof(*ptr) VAL; \ + unsigned int __count =3D 0; \ + for (;;) { \ + VAL =3D READ_ONCE(*__PTR); \ + if (cond_expr) \ + break; \ + cpu_relax(); \ + if (__count++ < smp_cond_time_check_count) \ + continue; \ + if ((time_expr_ns) >=3D time_limit_ns) \ + break; \ + __count =3D 0; \ + } \ + (typeof(*ptr))VAL; \ +}) + +#define __smp_cond_load_timeout_wait(ptr, cond_expr, \ + time_expr_ns, time_limit_ns) \ +({ \ + typeof(ptr) __PTR =3D (ptr); \ + __unqual_scalar_typeof(*ptr) VAL; \ + for (;;) { \ + VAL =3D READ_ONCE(*__PTR); \ + if (cond_expr) \ + break; \ + __cmpwait_relaxed(__PTR, VAL); \ + if ((time_expr_ns) >=3D time_limit_ns) \ + break; \ + } \ + (typeof(*ptr))VAL; \ +}) + +#define smp_cond_load_relaxed_timeout(ptr, cond_expr, \ + time_expr_ns, time_limit_ns) \ +({ \ + __unqual_scalar_typeof(*ptr) _val; \ + \ + int __wfe =3D arch_timer_evtstrm_available(); \ + if (likely(__wfe)) \ + _val =3D __smp_cond_load_timeout_wait(ptr, cond_expr, \ + time_expr_ns, \ + time_limit_ns); \ + else \ + _val =3D __smp_cond_load_timeout_spin(ptr, cond_expr, \ + time_expr_ns, \ + time_limit_ns); \ + (typeof(*ptr))_val; \ +}) + + #include =20 #endif /* __ASSEMBLY__ */ --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 88FB1217F4D; Thu, 7 Nov 2024 19:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; cv=fail; b=d2A6U/55Rzo7SCD3mzeS359SOinwf7PAvqifif9oosBRz0VsbCgwge4apqgvH1yLQpwmf1Yo+rznD9eDYPDNnj/ZtKygAhob6m/O5D48VMRH7sE/zM9JzoqtOBPTAZeZoBeCS70DmZtiRQDzWDkyAd6ItKstz1S2i23cvqCUqnk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; c=relaxed/simple; bh=v3GaWP172XiLqd+rXefIhasC9+l2FDu3nt3uIc2bu4I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NRzdyuzsuQJzxk3A2IvC7CbM43dK9BUMnbKIx2sGd5kqv31Xm72jt56bbzGs2xF0g464ZWM2wsVz6luzoPM+izD+hVDymsjDdBd+rFrrBUpk6Q/PyzlX1/InMU2zJfFOjFDsuYsFCS1SBFanJFoCQ//isnZEVXEIswd/5gxJS88= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=k4X12CpD; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=PZBpaYqj; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="k4X12CpD"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="PZBpaYqj" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBgIf004757; Thu, 7 Nov 2024 19:08:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b= k4X12CpDpTZasbBn9MvgwceXLIz3Nlh6eyUr8gV7rjiVKpMi8jiuTVPr+qZ1y85C XoJ9OnFs2baNIcf0NAZdg/jS0RwrdYmBCmuZzudldrimecXbsy6IMyYxz45EwvK5 UWucS9KNvbJPVWSKl9FpN0IpjcXdtUIj7Cj0ZbPLtFxCexB2OSichUyfWiGjegnY yIPZEIF/UDxa8JN1HF4L/a4TF6J/8DLShocq6RV4nBNQnAvpwydqVOgGO+9ti2ay ggRGfsa3bir7HGqmxWKia9BVEI1eT9jXXY1A1UVDsEWf8pB3Aul6LHv8uxhump0D 9E/IDfpEPj1WqJlmzDTzfQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nap03d83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:47 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7IMK31036797; Thu, 7 Nov 2024 19:08:46 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2175.outbound.protection.outlook.com [104.47.58.175]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahakgst-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AwMJ8smE67iUD+wDipq49H+nrGxzpi6+HTo6Ho4K/FOCY86OMAXknNOB/rxwsWWd66n8NIOxqyr80vCnsrAZ80sEu3ZObswEaVLboBl4zAlau6mUtzPG06mtVZEWUzT1z5djhv1N1NSVtrfPScrIhAh8DT5XXAlvFrBzZOPgPIWFY6xM7SkqwptO3zf36NGsmG6QENuJWiL5fhpqThaww65akBaOhu1b3vkPEKd7RzOAL0pdEECYY94Yhiy/TPuH8FLLyemUgUNBf+Cn47KCB4SPauIW/NRjBu9BdPPF1TMugbZmABwnhtBlhMLm/gmXIuF+4H3xDVNSAt8XiOarSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b=T8Fy4cSgGHYvjhTjOSQa12z19CtIA3OIicfeyoiW1lOIgRpb2YziNT+z3iBnAYJfLSqgFqFUb9SEVYAtSVGUjOtYREN0ts/5i8iryxR2HkZhBIQ8t/ATUD3Ngajzmx16WqDOqwRtNqJuyu6v92T04dZjOyNH0rEYsx0QKm7NXXlXFdeMDrCkwjz+x+6jHvnsx8YIf2DTqIn2KcWVGSg+xYKJdwht9gMD4qt2X7yqLuk+F3hTWbXsAziv6WNl7dIfFEL2WZKkkfJgmU2AkfviYmWlNEPwp67mR+g20ZkyzApjsdYiwljrNYVvy8a90nxl4AYqgSpXeEYMza+p4yxtGw== 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=z6wAIv17lLsyWur2fP5H/w7PeJyNJoRHHA9dyx1YnpM=; b=PZBpaYqjdI5CjpM3Qi1oxmsN5xEByknIEHdVpU2NxTjMDj8GpOe3oLcN3xGB4ri7+rBudtlHdmtSpqQvsKRF2SHSzxIbSkCVM3AyZyzsftQLNeJD5MlGhGo1PpC4z8N1v2rhvztqZhwQeBuMtQ7wH+RpNZ7wCZYpvZc2e/Cl8x8= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:38 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:38 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 06/15] arm64: define TIF_POLLING_NRFLAG Date: Thu, 7 Nov 2024 11:08:09 -0800 Message-Id: <20241107190818.522639-7-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR03CA0153.namprd03.prod.outlook.com (2603:10b6:303:8d::8) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 274aaae1-98de-4447-113e-08dcff5f9615 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8BqH3T+VmMDVBdI1v6k75XDnTSQY6SgOF2NprQJ8iJTKRHDtz/xZXKI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4KbxxbQPeCHhemIZlc0no8p2jG4WNxBXf6UyZs?= =?us-ascii?Q?CvAxrSp+Adu+9PcilUOCorP1wZ4yCiqPa+UhxtTq9dPNvGuV/DDRj2knzkCN?= =?us-ascii?Q?iqklrGfhGF5Wi3E5VPmOsG9L5GnoDwPCy5gXAfOgekemHqO1vCzHQRLRlsyU?= =?us-ascii?Q?xYBYPzQcE24UlGLNEXwBs57Mk9xPMbPdnyHTW3zoXdBv+JB3Mu8baEC+r5nf?= =?us-ascii?Q?Oq+xabv4ulL0O43idwU+aOW6EwBjwQqAyiKyAyDLCWj8yjjWz4snQJ4m8Bod?= =?us-ascii?Q?j8QXisYuCazgCDsL1ph0NJZlxc00ZTGzKkHriSvjOL/F6rNtUI2PlUxnXyxv?= =?us-ascii?Q?qh7F+aPXJrYqehcrsU90jLeXTlSu36LyyCuNn1cjsN7qdqmDAqtCwevV+L9r?= =?us-ascii?Q?c1O+ddLqzwKXexlRKkgiuVtC?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vPR3I6XZHWIkEvOjzqM2rif9QDju851I2/3BNcINuvWieCh3cV9//xGTJd4i?= =?us-ascii?Q?b3YY9vOmYTw4YwWL8/Kv3WYUwAvjDWBsNIM5CqfDF0oG+gX20fYAoAeYS30j?= =?us-ascii?Q?4jpQhgbXPz/iLzFX/xmBnSSajddV8SAKnjdGfqW3R+Kh0W48EZu6lsKrdEGq?= =?us-ascii?Q?Ww2Ajx1wXyvtYjsikYzLkm0S1ZBBnvzelzzTA7/R/V9S6EO8oeLPUBQgb6oN?= =?us-ascii?Q?kbdXuoyn/0xv7eKpCe70mWmcxw5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+gfW?= =?us-ascii?Q?7kM0JFt3U53YhYi8jdUe9eN6TKDWQFqLEjSDXbX+tzfXn1npP7vUlLIO3JeQ?= =?us-ascii?Q?+714ZYflc0sgW8+DZTgdake7qkeI6lGsbzJ3o6gB7UeSDiE7ddUHkcm5FJ7M?= =?us-ascii?Q?yyXGb/koC2p764miQoQDtajRM+TdsAVliSFK0F3Dj2SjwE82TDhgEa6IGDM+?= =?us-ascii?Q?MG40vweQEdNSS0RR5EQiEHDVM3miPbE9J2eWSIgFyNPwA3hZwDS7kh6Z1iHn?= =?us-ascii?Q?cSowv3Bj9Azmntv3xpwZ/Iqg9TVTbX+m39DR5sNaBN9Zl7t7IGZ96HY0OhfI?= =?us-ascii?Q?0HaaVXzXX6uywoCfkfM5PLyVKrwmBpDoEp3mIabXUU/jYQNuRNCko1Vt7ckV?= =?us-ascii?Q?3TXkNYvge8TgCs/kVAi8sWnc7q/fhk0cq9gtaB1/JzjXPu9ypAuh9fAS/Tbf?= =?us-ascii?Q?m+QS6mLiJyLMXymKLfigY3WlxjwIgKuSA9XBJbigOx6lfqyMTb7jkikSF540?= =?us-ascii?Q?rQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xLmdFhwze+aEM6btMhrCKcJK6wHOF+eRci+gX3lB9BDNcKPzKYKjOyKSf+31wpg5hjePzZn0T0JI2+8TN+G8Ddlnraa/4UeP4T6u9OFUh7LxIExYj231oqrz1hGAZsF8dsasUn2o04w41/8DN4Dc+QTnpG0CId3EpWyuGqeIT7cvXNcEnYomTP1oubbpDCG3sKosbbhw00TFDLjRMeO71DGVtocb+w4g6+pDHDgVKsnLvcqD2mLfzvxCSwnGO/SsoKU+X1uSBiNObrUIGBnYAEqbdkNNySgpZg42UiwRK6xpPy5zcVGUCZoxIhxUVQYAzxfhP3VYUQqJtkgZ8Q9VX3bg/RcybzN30sUzD5ge+A/Q5PZcqR6dgQcBlOJHHv/w/yt40j53l0SDHVnwcmQp6LzBxuu/ygvZffqxZaqjoUEYksycWA995/z5b7vHILoBYsilu/9q6rEgcGVpPMx4eTpjF0KiVDkYU+2Btu+N2OLrXEPIXqpUmWXcOwhZhp5KBHAfO1YFRPVCrOh9ibrcjNmmyq5dG/9MFW0Ms7tRIW3Rjk5HO7pXhE6LrWHLjLV3WFpfHUG+p1rudHUvYHhmKa7pphjhANxp0eZSSu6qroY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 274aaae1-98de-4447-113e-08dcff5f9615 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:38.6715 (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: ghJrKFmvtR4+H1jRqX2ccPJ9WK7Wrb2evQWM68OXNohvins7Dy8Emo7hJfatEZWWi7acIQFF9M8aDBoiqnvmpTWfp4Fj9bJrxeMe/ti6X2o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: fpVnkxKb2ohbrqN5l2HpxxZtXsrLB_wX X-Proofpoint-GUID: fpVnkxKb2ohbrqN5l2HpxxZtXsrLB_wX Content-Type: text/plain; charset="utf-8" From: Joao Martins Commit 842514849a61 ("arm64: Remove TIF_POLLING_NRFLAG") had removed TIF_POLLING_NRFLAG because arm64 only supported non-polled idling via cpu_do_idle(). To add support for polling via cpuidle-haltpoll, we want to use the standard poll_idle() interface, which sets TIF_POLLING_NRFLAG while polling. Reuse the same bit to define TIF_POLLING_NRFLAG. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Reviewed-by: Christoph Lameter Acked-by: Will Deacon Signed-off-by: Ankur Arora --- arch/arm64/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/= thread_info.h index 1114c1c3300a..5326cd583b01 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -69,6 +69,7 @@ void arch_setup_new_exec(void); #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ #define TIF_SECCOMP 11 /* syscall secure computing */ #define TIF_SYSCALL_EMU 12 /* syscall emulation active */ +#define TIF_POLLING_NRFLAG 16 /* set while polling in poll_idle() */ #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 @@ -92,6 +93,7 @@ void arch_setup_new_exec(void); #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) +#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) #define _TIF_32BIT (1 << TIF_32BIT) --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 B212B217F57; Thu, 7 Nov 2024 19:09:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; cv=fail; b=Gp5jcYVNbzzufnO98LYX4Hq+tL8yV//3Z7yXC4eS8JT1w/8rN3Xu2xgz7XQ2owi4bdUKw8zGuaP+lLh6XwWFYtYK2rz1Ca6GOK0zVzolz5KLVUpOTf5u5LMeIBBhGqKl2MUwmigqt+J9dh54gM7rj4qVAydMFlLTut5iYHJpdGY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006563; c=relaxed/simple; bh=P5KqMCBbw7Tz85lC8YXD6NTkITnpZKTc8pnpXCGWWuk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UdwQMDFivPCz9TJgQ3RLJDv65CtoeF80z9oGtOoo4tVxn5pUIY28MFSYJiHBud7Hb1ayxoR4PkBbGaL7wlEZ5mOLO7T259J1WOa6lCVEj4DPBFl/zG/NJ4b0ahmn4WwVtJT54mAJ04Jq8R1s33J/yIS8RFBMSLnpqFrTeP3tPf8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=L2nY6Q5m; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=snzK18tM; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="L2nY6Q5m"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="snzK18tM" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBdS4002626; Thu, 7 Nov 2024 19:08:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=1q6nQeCGiOFRAbGCFzLJlaf/ZZKfw59FJgWWVjOWKfY=; b= L2nY6Q5mCh2ASIpbSrsIl5C1tm9qw9KS/wAxgW9WqQSbIQxC0IbS6R1cL1utkbEO gP7ffyqyV2pP8qnmbi661+TrKNLqhe7yfaWl9loOzSV3Nj5Og6R+XI5BUy46q2hh CMzioOpZb8ZiWAhL3SZ2VsWXALPz8U0RouZAqhT1uxOFZhS//v66lJ3sU5SLAYD2 sV5GUw0HDtWvkO9keZ9/knckoHJygU6qIaQopgjMPn1WqR6DC5Pgql00VPdCGByZ fN0UgTH+J9dMpqUB4N66n/wsORimaWaogWjTAs2FoPIcY5KToBVSICxIPVgX42vT E4uxFfsaUfk8XVqSEWGKug== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42ncmtbbbu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:49 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7IKU0T031448; Thu, 7 Nov 2024 19:08:49 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42naha6ck3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Sv11kPNPNnInttMyjpZYHgZILHvtPrMFQC2IEnfhOtqZaibf1xWhF3rKZPlHPurGo1LEVJbv4wkFEfLzRX95B5TJTaap0IRhe2JsGctXst2N/u+PQ2wS/uCSNpVzWe4AGPvMkBsPBPN8gYtQ1DHD09JMpfstr1ovYoHXYiWRDUELHbda6qGWFiokJTVWK9J3Mh/DiYD1ge3BQVe3z1z0rzO/4fWcr+Lj+uF8uv7GaR5lO3cm/DhvQuIiAksLopliNl6S/J6BZDI0io/wIQz2ZKO6njygrjaWKFfIYUaf0DhwoIjDgBn094P+c7SOzcRzaZHGScfZSXAnVRhe3Db/dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1q6nQeCGiOFRAbGCFzLJlaf/ZZKfw59FJgWWVjOWKfY=; b=AvQmpOVl4EaXl0CCqIIXiDkLOBVSng+8W65pXNMLx6OQw6jq29hLr4uvmXw9w+W/qtYxnY2fz+OGFXhE0mit03Gg92m7z74t4848HEKaVh5XJY6ebsw2DGsp1vuQOxH0lG6SlZWNVSU46jJKhqy7gnt6il/lAFO8SFBm/M2BYIuF+4X2THhKW7rDkRy97HqiN85poM55W1mgHymQ9Hpb8KwbklVs9RKtKgO4I2v1pS7b82Gs1QgtFNZN3FCSGjXkjBCfUiRMCu0eWreHgDThh38YfhN/MjAO8mCsjQjslMkTeQIS1jpho95j3gA3XAKDWHdY7JWlCeKWTXGh/cs1Qg== 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=1q6nQeCGiOFRAbGCFzLJlaf/ZZKfw59FJgWWVjOWKfY=; b=snzK18tMOOscgG710bofND832iTgMMUR3hQ8MXj0vohyE2lAirtyyecGSa12UKn+QQVPduYYNTDOhkaBIS8WD8OazJ55VxZ2r9XuVAlyZnKDTyhCo+W8dtq60q0drdlwpSFU8ajDfMyKYZIqy7bPskDvOSlx47ssofF9ZymUJwM= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:40 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:40 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 07/15] arm64: add support for polling in idle Date: Thu, 7 Nov 2024 11:08:10 -0800 Message-Id: <20241107190818.522639-8-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR03CA0113.namprd03.prod.outlook.com (2603:10b6:303:b7::28) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fdccd6a-22ac-455c-255d-08dcff5f973f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?UIAEfUKHP9zdcN84Pg5Gkq8jqqlCOOt5YI0UvBh+fEfWA+g+chZ6V5HnrZ2v?= =?us-ascii?Q?fxwQVfVEoHJeViXQu3ManJ8iOqM0bHG5VEIM251NQs+wWryEPFR4yArwwFtQ?= =?us-ascii?Q?66oIDhbJn00cqxQfTkQ3/McTE972EjhUW1Gvx582EFLjSlXJXrgRGgKfURhd?= =?us-ascii?Q?LI3FtqBEvapO8wfatKXJLU6Gj9hfVJtw+QUO9coFbGOHD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lJgpBJJUGwSfMYyCtDOLFDIIoVaryMd2Lb8kYok/u9H/Hu?= =?us-ascii?Q?mKvDU62gz80rX6lLFSVyYCMSoriY7OXzutyKHBqxMx4Umq5Tf6ryGLzIpNfw?= =?us-ascii?Q?AhgFfNfhNLjyxR0CGGMRSuA79zjSiWkCWFTm/tJfO5SmSx7GCGK0Ogbl3086?= =?us-ascii?Q?2fIrj8BP0JzX0mRpCNUUDpk1SX4jFWp+zA8q+vjyKh4HRY+UNrNZsxYIRIHf?= =?us-ascii?Q?CvcxriT8bpaqLWU+kQRvtGtC?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?090xko0aO6/3GjyHJP4DmDf1BlmDNwuyFpctgVLaX6x73KoeGdN4/i/IEhuO?= =?us-ascii?Q?kKzcbSznsCU56b+lTgI1XrFKVP3ru753UqqbxH7JjqhoV7zDfsKKl2SIvRrQ?= =?us-ascii?Q?Jo7Xk5jHIoM2ejhSqOS+RkjfxdcAlbxZqd7rXguq4lX1cd+Ek0rvyKIo2wgO?= =?us-ascii?Q?Ge10fUp81ER9UmlvDdyHZhljEbNfB688h1iiNSTw302TBBcOCp3/bUOypp42?= =?us-ascii?Q?AU6dzWIxkHqCTEWRVHJUeCgmH9LBQdgkTWxMCN1JlQcMO5QK9L0J1puVimrQ?= =?us-ascii?Q?jNj9DTq/gUTjz0RJy+WB8J9ZTnz5Uoc96D0Ips7VjOYEhTSei67hRvElKDBa?= =?us-ascii?Q?YLRPjmlxr5XxUUJgr5Ec6G8EE6UL7283yw/AkWiprx0/TD0JVpVU1x5gz9po?= =?us-ascii?Q?3p/LwAKYLAWceJfGBsD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us-ascii?Q?ABGgPpVWuqEoKYA9ViMcZUMiCZsGbuxgLjH/4x5lDRRJ60L2+tKDbaWp+XtN?= =?us-ascii?Q?LXSGEnAjcJ+W4yiEYF/AldzrD6Mrk0BFvvaOmqwwDPmzI+l45Wlp8pwrgyFf?= =?us-ascii?Q?CtOAI0ODL8IX9YzobAzS9Kjch4jkQnqtmsH2eAf5OpnrAN4OWnEJlzFwtAJO?= =?us-ascii?Q?Lf8xo4FA03YLavZu/3SwJSRAgR5LMDC/I9xzsXJazSHigqT1jZc+eEEbilyE?= =?us-ascii?Q?eTq4CrkTsAKOT9Bt5Xkq7M4SAXgEBKhoG2jWrgZFIS4KIPrbL9bwMdDP802M?= =?us-ascii?Q?XA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: hRpdB28O5yqGrLv8XlrpRK/u0OYuTywmKXTQO1kzrYR/umjg/FLpST7nmaKsGFZegu5f1nA/nt5/zjUJqEmleI7ZT71aDDWsoj77GK+2oeKnV2WLqOJJUh+n5KV4tqtfvdMJOoHHDrxuCJlUPYffHDsb3yDIIDH4C5SRJ7SBBpsv2PfqOaGk1cj6trTsVnz+DMME2EZG0U7UGDhuDg68op+Jegc4pQibSIgUZMYxxIkbGURh3cLuoj3FWADLVv2tvrLrKxzNC41Jbmctl9Dnvgrz+x2QgWFfxsZeGriXV6+ZMDZj15K7DPjYRoogZIwEZtHXEpy7lIOfF0a2pxHqDOYUFcu/UE87lggamt+Qimou1mZDx973LTJUN/TV3x2ZoBnMlLPxHl4GioWitQm0wBe35RHiF6WACuoI3ijTOelksPBdl4Alp5FumhH+YqJAETKEiMVW+CDaT40sYD0bepF2SWu+3M05x7RhKvlBxgp00TgCJujedsyFap38R/Az4cEvA3PSNYutLVu2D6qrxpQLsuWIYjvZLS6EQsi3ZgifKFvwx/BwDw8ner+qCgM3fhSOcEwet95RXtMQkJsqefNTUnsdNDnf3qAHw7y2E00= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fdccd6a-22ac-455c-255d-08dcff5f973f X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:40.6121 (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: tsG+nL1mpNC6JOzcLxyUaf+Bg2r+tePj8qImxOB5wCQt7XMWzokHVOx2mm1NIeX1vWx22aRkKw94scgd+j6DMYjutXKyiRcOAismtGT/05I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: q-ZnQTNtF1NGdKq2LF_4BTj-hWqlLicE X-Proofpoint-ORIG-GUID: q-ZnQTNtF1NGdKq2LF_4BTj-hWqlLicE Content-Type: text/plain; charset="utf-8" Polling in idle with poll_idle() needs TIF_POLLING_NRFLAG support, and a cheap mechanism to do the actual polling via smp_cond_load_relaxed_timeout(). Both of these are present on arm64. So, select ARCH_HAS_OPTIMIZED_POLL to enable it. Enabling this should help reduce the cost of remote wakeups, since if the target sets TIF_POLLING_NRFLAG (as it does while polling in idle), the scheduler does those just by setting the need-resched bit. This contrasts with sending an IPI, and incurring the cost of handling the interrupt on the receiver. Signed-off-by: Ankur Arora --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd9df6dcc593..43762c68e357 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -38,6 +38,7 @@ config ARM64 select ARCH_HAS_MEM_ENCRYPT select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_OPTIMIZED_POLL select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_HW_PTE_YOUNG --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 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 B5CB221A71C; Thu, 7 Nov 2024 19:09:33 +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=1731006575; cv=fail; b=VJF2Bq8jUjCWEFXUo/z4SFiFBv8OTvK2e32ZWYNzYYH6IogfWZUPIWiLqqdkleKRgY9SmjGrqLFxkDnGOde22GYXurXV9udjRT1UU0GZjWitRex88ALBeCt+0YkDi5Aa4XTnXeQeAaSeHJ6RoUkq/ppYW9X03l+1pgrU+JLoYEY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006575; c=relaxed/simple; bh=Yyb1NPNDFQmIjFeFqIjoUZ3foLaSLksfAmQDnFnTm10=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lTYxDHulwFcFQzJVSOjRsAOyb0EEzenvnWXypyvhKAyA8dSffYKDdo/lcS+r3rIzIO3drc3f60423DZWKHWMhfxymPY/jpPOIQsk8b5X3LsmTjqEm+luNc+RCWfEJpOdqH6pA4rlOcbY6Cj4p4bamCgBO8k9C55MtwJtVJmMBik= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=gqNQqGAq; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=hPvGv8nW; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gqNQqGAq"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="hPvGv8nW" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBaMF025221; Thu, 7 Nov 2024 19:08:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=H/q7eDW/ZTZz/lYx9cMAlhBkSvRSCxOpz53k9yto33k=; b= gqNQqGAqt/CWQqJQrHRIQsR8WpHPMgup6OqdpcQ/E+S1lnEtI2bw2yIIimTHmP+U rdWZeyixBD3qfzfX+/BPpEh+1iamVjkg17vGa3sdxfWwrN61mlwfcgVOqZFTbIIF SCdi1yzjpWMLqQs2l4MN8Zu458fIg1EhzA3cijxvEXS9PNrmxmsAqSEzw8aRS/rm gBIO6PwDS5kFjWizTopG38VdpIjjeKOy6jmCzBjuQM0SfQjb9ra8DrKXTV3CxOBR m7IgHsxNgiyD25Bbcf/Gtz4doa+kmuEV+ibWPrQ5Zu0mPHb/q+iyl1HC5kfYUIyQ Y7LJvaUkkTUBY+jZATQ/qw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nav2beda-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:53 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HwLT0009736; Thu, 7 Nov 2024 19:08:52 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2177.outbound.protection.outlook.com [104.47.58.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgt619-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ru5VmeB1QXiwQ2l5Ms9NvUVnSyBITbafE9LrNplMygIdq5GRfTFeu2GVsurbKHBXnicbmVeXLijTGR1LbHJJIzf2XfPu6W+fKzTdg8SKmZqDiukHr+82BCBiXggICmJo+qJm3Uj6nQ3L2BmsgMXRARWp9RuW1YlWkAeI7NBYCNx9R9BGAq7mCpREf47M0yoqdnf8hp2TSWwcu/06o5a5vzjOUGtm57jO1EGoqUY7x6tApKnToUivhVwLHesWWbeSBRAhUWHwJjcsz4dB2VokoXxfGe/zdxdy6f1s0+nAElfStCj3LWIgI8c6Xfv2zlLHYosmGvK9DxMmnmjlURudkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=H/q7eDW/ZTZz/lYx9cMAlhBkSvRSCxOpz53k9yto33k=; b=J6zK5KDniGABtXlE/o2mSYoENzbRS4hb8RrYek2m+FDIEiSpAZUXxl7iL7f25Od/VyAYaZ8Uie4+RtN2zvxf/cL6tNBmteMn4QY0DjKY3yRZh8VwAZPNEXu1P2s0Sx9pPvB1IrVVhHUNJGBbH7IjCxSZL69Xsv5ENsunPdnHcg3EIgf3xQ2KCOCD5XNcjUHUl+TJU4CTa+3y+o2Sb8dIhjDfHhLKKD8QYs2/KO3MnV6l2dHrnT4O8+TG7vjG96AezHhkURdFn2iwWihhNqbynrCWzWDU55i/W7BCOaw8oXpXhASmaTlKSkKxIvGD5oulCnT1ABfTF9zFIDA8S1Axjw== 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=H/q7eDW/ZTZz/lYx9cMAlhBkSvRSCxOpz53k9yto33k=; b=hPvGv8nWJ8KpqUuf3V0n6hTvpaepgjGSvcVkkWQUw5OOjPeFqwNmQuO6WbMg0HpPNCJkfQymGyxHjsBPxZUnD/JNr/H9rJmtKB/MdNXHmShLfGbDVu1SPfJOmhcebBlpM00om0rd4iaEoKFatap5sNvJwy+9p2o/nihIq0vHRww= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:42 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:42 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 08/15] ACPI: processor_idle: Support polling state for LPI Date: Thu, 7 Nov 2024 11:08:11 -0800 Message-Id: <20241107190818.522639-9-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW2PR16CA0034.namprd16.prod.outlook.com (2603:10b6:907::47) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 6521b7d1-605f-4d09-4b6f-08dcff5f9858 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Okli0EHdgFuCgTYIDNkzqSi4bYC9eHI3xBxNU1kyA94cfJqRkdF912aYIV7h?= =?us-ascii?Q?2ocJXtYzwvsIG1FntGi+TsZyP1qouTLvQ7KOEq9RbTD4kt1QUT0DQJfdoXc3?= =?us-ascii?Q?k6d8LVgugZWgPpW/Ct8DdQoq0sjvkvM7sto6gwCyMKdy4sVO8KJW176KU1j8?= =?us-ascii?Q?YFShyvdX8p4sGw/2xHb/vgF5LErQdeFXw5wHqWdekjV7quwEJ5Cy8IN4GJuj?= =?us-ascii?Q?VhD2KgJa7dJvGqahYfRhLvFvm1aqds68NxXL8xB/L5oKBVvlZIubR8RI2bAm?= =?us-ascii?Q?ozqxpzEDvAM1RKd0qWMlJfsY5EYm3xzkE8dykBxJmLIAgRlViQag/suP9uvf?= =?us-ascii?Q?mKqAMjWHLCuYEk8LcqXHhYCvJk0OJ2umv0tpDz2iBiWvYiFXYzD720pjTQTw?= =?us-ascii?Q?nl3qhiDyxhFWGYuxnV2A6xXcq313+KP53cUK/tOLDXqiMza8P1bLkCXuA5d/?= =?us-ascii?Q?zRxLp/djzXvld1CfODbhcndiK9t0m2dZess1JGUyK95OqQE/km3UgpHWw+GB?= =?us-ascii?Q?VHaIjMjR2OdqPopQgRMankUj5OYyG7lDGNKiuemtRIHSpGQQ1O4uj2MNGX61?= =?us-ascii?Q?hUdujBCPYMxMts2NqMtr4rErjh0hDXqg+LX9+KUT0fIYoL98CDZwMlvEz4Z8?= =?us-ascii?Q?TSfKWE/3VNGJFAqbsq/jrjqI+skhqNbyf7r9cqPgo6LQ4OSbaTCdQp/ITG6e?= =?us-ascii?Q?NIVqfMAfQQpec/ieSLNUu+ddFHBk8kfKEAJfhJ+9N7IppXuiuxXgn6nBeEN8?= =?us-ascii?Q?2pREGtFabSyKBuRb/D4lOvbZWqzyjrmziLNw8V5BRFWg1jgjk8XR4Qtt5aw9?= =?us-ascii?Q?c/MdNvQGt1pn9V62zeHad7vSoMm4cIwM7vHXKL3jmhJ5SGWYsS4H0UTrQmON?= =?us-ascii?Q?ud4eIQz8IZHxHe6vbxqDaRe2SbjCK7xik+6MMgKPjSbUUxiRLRRu5F8IuZQu?= =?us-ascii?Q?SCA7VRVLkfVVJSTxwLjycXYxs3HfKrZMPv9vkLGRP89GwGheJRq9hActK58V?= =?us-ascii?Q?2JgZaJyidc32BruNXjgvZCc+S44kOw17xPoMO6oNWYuLt4OPbr96iDdbNa+z?= =?us-ascii?Q?3aIdERHmaEXbOKuC79MB34oRsQp1jpv8/yGER0hPfi1xmSz8TmT/EOh6FfnU?= =?us-ascii?Q?Ii8sVyPz3WIbQjFcmsCEB7wJSUNhQdmKA5MgOsqRcbwCeQjc+88BUlzhvgvd?= =?us-ascii?Q?Yi/OM0zWh4ODfcU7wg039XsYYMbE3KGzrgpjC5bthYDxbvJ/uE/JCiwkJAPa?= =?us-ascii?Q?xILAExIHvaceTIpwavpMPsy50pHHyJmTHQEBtfE5uqEt3pDtkC48q4gZNpoK?= =?us-ascii?Q?H74pdRAt0j/qVpruvQgkvqz/?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9hK+gYJZhKt12RKxn9waiHd/dO/BUGDxTwqxozldiXpkRO1os1qNvOL5VMft?= =?us-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Nb5IEn1/4BwtC+lW?= =?us-ascii?Q?03uZkxxCVviHwohSTyYKiqc9zwMDpOaIV60iJtrOv/RC1mOqIH4qAUDujNNN?= =?us-ascii?Q?Xh1PnjEm+wygGBNzSfmYPENCXEMveMe7oiHbL5qBRAMwYqs4E8u7mEnPjkEe?= =?us-ascii?Q?vJg//aULX9mBBPoM6nH6QEvVG2Om/ML1o0MctnWscQ0gwsz7og/ymwFtExkb?= =?us-ascii?Q?zWxcPtezIe170PhnD5Eg9m8BE3Q2QG7W7vDQl9pmkB0oatLcWiuBjRP/6uiH?= =?us-ascii?Q?X76O4MMl599YzGvgkmxsmU5Udt0AGLCYZ6FATJzL0XLFUIL1S6de3V1HoZ4H?= =?us-ascii?Q?f0dJLEEfZPCfLxLWNYFpd1COhi9Iv2L8tlFajB5aWAA2BKiaH8wg4mtdF9TG?= =?us-ascii?Q?P9h3EXH9bbHZSIANcdfG+PujHdQYCASduTa6mFVPnqaNomvDLneNLq7K3jr2?= =?us-ascii?Q?30IXnlKFce2D8uxHtW1x/rf6MZ3Ck3G/pGKLUTmMBoJrftiiThf5gWoZkrZL?= =?us-ascii?Q?9DFPSurnCfDCF3MQVsAYRKUcVizQBehF42yJVVm9eiEZXo8yykad52yBlflC?= =?us-ascii?Q?wqsobux0uuphDDillb4uJNdgmWZ9NG40suKrZbKzilz4h3Ys+UWO9wOhZLwS?= =?us-ascii?Q?ZlcqB29TZ04bVSqTfOR4PSS0jNuSzAhkD6nGwPeBPa38Nb4oHJGHqXdB3KGR?= =?us-ascii?Q?OA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: BZfo9BVFIqKOttCLcU/7w4SLlogvRdktllShf5AiPTNtnyNF8YwNVBFZxyzVEO+AZmpcvKsrvZ+lbJnQCTqE3CRaBTd02Oilq0S//dVZQTF3nkcenGtSnf+9KawmqwViQxbF9BJ62v6y45IIozYrJXJ7jnLkwWnRjA5BvHqbcaLzvfpqK7Nm8mP1BXL5lhQ3cLf2b0TC/vbNXEJi1DVMlw4fxpbZ82IndjO0/Ia3ZNaTLTypcML+xrId3RAiMPkJJ1W22/ITe6InB1xqbQsYwD6jm1hmtBhfkZcAwrByNTnjhzjvHZ5jP3z6ThrekR0JoU1Xr96fjuxID839mK1wP5XBzHBnJP0hONXG0QwmBqkK4yNq3s+n08o+yXh2fuB9xWmKkBWUrB0TzWGLuCh+1G5N5dah7jUQlUBG1OsY+Z18rYnuTUL76NMluo77xu7unZm7C8V3hsb/XQj/1iHJLb+PfUXlYmvcjh0AL4m6mqLuNYxMdgG0EdR/sLbtCH4J1qDWPF9NOkAAr6v+p/1Eif1lbnWkt7KFCrcUPkk0y6suobRtR5tCVtnjjKiiWG7lrUf04ryuZirq1dESek6DCtpMEGFcvzxkv18M8u+ZO/I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6521b7d1-605f-4d09-4b6f-08dcff5f9858 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:42.4259 (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: uycSn3V+2FW5WwAvGqWc65I4Yo1/aLhf71m+JxipN/UPqFNii6veaRydg1jdwpQpRyn0cl6ou5jJr5ADS99JrIw7fwmkXg1kYgBCNNF8LAc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: M7SmEWZiPkj0hDBLZYlG7S7Y98kPcCId X-Proofpoint-ORIG-GUID: M7SmEWZiPkj0hDBLZYlG7S7Y98kPcCId Content-Type: text/plain; charset="utf-8" From: Lifeng Zheng Initialize an optional polling state besides LPI states. Wrap up a new enter method to correctly reflect the actual entered state when the polling state is enabled. Signed-off-by: Lifeng Zheng Reviewed-by: Jie Zhan --- drivers/acpi/processor_idle.c | 39 ++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 44096406d65d..d154b5d77328 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1194,20 +1194,46 @@ static int acpi_idle_lpi_enter(struct cpuidle_devic= e *dev, return -EINVAL; } =20 +/* To correctly reflect the entered state if the poll state is enabled. */ +static int acpi_idle_lpi_enter_with_poll_state(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index) +{ + int entered_state; + + if (unlikely(index < 1)) + return -EINVAL; + + entered_state =3D acpi_idle_lpi_enter(dev, drv, index - 1); + if (entered_state < 0) + return entered_state; + + return entered_state + 1; +} + static int acpi_processor_setup_lpi_states(struct acpi_processor *pr) { - int i; + int i, count; struct acpi_lpi_state *lpi; struct cpuidle_state *state; struct cpuidle_driver *drv =3D &acpi_idle_driver; + typeof(state->enter) enter_method; =20 if (!pr->flags.has_lpi) return -EOPNOTSUPP; =20 + if (IS_ENABLED(CONFIG_ARCH_HAS_OPTIMIZED_POLL)) { + cpuidle_poll_state_init(drv); + count =3D 1; + enter_method =3D acpi_idle_lpi_enter_with_poll_state; + } else { + count =3D 0; + enter_method =3D acpi_idle_lpi_enter; + } + for (i =3D 0; i < pr->power.count && i < CPUIDLE_STATE_MAX; i++) { lpi =3D &pr->power.lpi_states[i]; =20 - state =3D &drv->states[i]; + state =3D &drv->states[count]; snprintf(state->name, CPUIDLE_NAME_LEN, "LPI-%d", i); strscpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN); state->exit_latency =3D lpi->wake_latency; @@ -1215,11 +1241,14 @@ static int acpi_processor_setup_lpi_states(struct a= cpi_processor *pr) state->flags |=3D arch_get_idle_state_flags(lpi->arch_flags); if (i !=3D 0 && lpi->entry_method =3D=3D ACPI_CSTATE_FFH) state->flags |=3D CPUIDLE_FLAG_RCU_IDLE; - state->enter =3D acpi_idle_lpi_enter; - drv->safe_state_index =3D i; + state->enter =3D enter_method; + drv->safe_state_index =3D count; + count++; + if (count =3D=3D CPUIDLE_STATE_MAX) + break; } =20 - drv->state_count =3D i; + drv->state_count =3D count; =20 return 0; } --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 70E90218584; Thu, 7 Nov 2024 19:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006565; cv=fail; b=itANnSaj8InbV+cFoz59kej6PeLR+pUSkGpvIaoTE3dkmvOyRmvfgGzd8sUPiL6LS7jGn/zD3676jr0Xipu9ZMX5BYO7cvi+ZWI0wjftczpCOYxY1UMgEvDRBgkX93DLYLTPBBU9ahQIdTCevmuLI0p6Ui6x5WQ8mR78FeG31Bc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006565; c=relaxed/simple; bh=fIkKve3d4s+tARoLQIvmf1GpLWbBKq2gD7ZxonS0CvU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iP2qsJ6cdg3XaEc/deL4ZkkYa/VwWI4SZx4LhMIuwHbUiCB34v50jhN3MTy1VfXP5MZFYqtDI8DpOaZnqbpsgCP5W0sW0HcA6PflypO+kgfcwuFerB4crToVwz0dmuVmnqqwfzKgoZQAUKLuDFmPkvscoGinR+A1kmtCStAuJUA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=kwBb4JhA; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=GR1K+NBa; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="kwBb4JhA"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="GR1K+NBa" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBfNe030873; Thu, 7 Nov 2024 19:08:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=OsL8KmZV0GZqBzyYAkuNNp3MGpfw0D7lahQORSbuV9E=; b= kwBb4JhA8GvsC1H+/U3RBBE6mfigdBt8L0XlPfiClTNf2Qm1j8w9RyjM63xj1wRh d6IRmSVp5JPXxiAdATaded9E1GIN1o0SYxVRbq/XCD+IRgTk/0+Ki95qIHRlwXrl GIeQ/XzBOu/fDvHbsz3xLNeMOoiq9xuV8xTlCET0twotUXEI7HoxdE+LOUL0JTgO Qcwkg3DNrc7uDVTW0/Gw51WSSZHyExAyMP+3naKaT6Snikz0c6frB3egjxHLwXvK gdHsf8cdubvgOp0rT9nsdL/Nn3qPEjt80VEETTZHX+rcCP9DyxfhGZVlCxrslmy3 vZ9bbYCZ2Nk1FgyBDvyS8A== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nb0ckd8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:55 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7IeIrq008595; Thu, 7 Nov 2024 19:08:55 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42nahaer6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mrR8MBaYID4DHRAxpIkdHtygrLcxjyPc/Zltc7O9XiGRsGp9e9NEyx+4zBTz3LQeBRzdn7u/EGP1/512lRQFR9d22pDy4pK/GH0hiwtn2cwVtMqdKdqTlR8+OQDdh/bqjjyoPh3PO/HbvqzBmCzUVFBJubqoM6Doa/QX0hJUk1rUjexF00SfQWUOwtIE1JY24HJL3Na6TVVfgaYK3dbf1GR0eEUNmBYYjwFBa/JlZuHXeBg377IqqJ+wAoK/CUHVuqlA+QuxpVp9E0JmiPvvNIOC3hZiJ0wXavRXGpR0mEXziwR7On5J2Nx4oJ1KNI31YTJDlhX6tuMM8lPsB+I8Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OsL8KmZV0GZqBzyYAkuNNp3MGpfw0D7lahQORSbuV9E=; b=qgu8cuHQfECiZrUDGxcy+U+Lkd4m2V6Y6CapChwPHyi3dfsF17+XmIt+3WErsolG37mMZ+DCTl8ukA3RGQm2VTq9sy37HmWSQyZ9YPaRXCmzavmbfSdzzNNc5mOfui0+b77cNk7OJIziV0EzxCQsBadC8u6qF1d7CwpyfoGkP+rE6JBwbX+L4uYJkYC9lRZK4B7yHJTFgUy75ATQqUbwUX2UllY8BxprKtt3kJKKdSp6By7eh8/ibztpireWblJKo6Srmc0auaxSMq0Vs7hX0sphLRhj95KNjQNSOtkpv+zMvBPOxom0CRAXVkyWjltE66zwrSjW9P7gq2bcEMZEaQ== 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=OsL8KmZV0GZqBzyYAkuNNp3MGpfw0D7lahQORSbuV9E=; b=GR1K+NBauDmKgSycHvWOQ7h1ncvsw6u0a5ku8Ut7imPlxjxtaAuSb8X+Cx7M56SNElIYmnOIny6Rn0ZbFeIcbv/JzZ1vNipA5/njS/9CwRKiFXnuAmkNqTvfiApID8VGWQbCbz5HNLTdyKqxNBb3S34o9YvqvoD5jvJpm9KZB1s= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY8PR10MB7148.namprd10.prod.outlook.com (2603:10b6:930:71::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Thu, 7 Nov 2024 19:08:47 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:47 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 09/15] cpuidle-haltpoll: define arch_haltpoll_want() Date: Thu, 7 Nov 2024 11:08:12 -0800 Message-Id: <20241107190818.522639-10-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0119.namprd04.prod.outlook.com (2603:10b6:303:83::34) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|CY8PR10MB7148:EE_ X-MS-Office365-Filtering-Correlation-Id: 24d18dd9-c2b4-40fa-46ef-08dcff5f9b5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9weBdsu/RSPJPCIw79WjHRb0Nd/RJJ2uG1qMjljYoQ8WDv0a8uEQ+KicJb2V?= =?us-ascii?Q?bpXxhuy+nYhlUSYvzf5t7j2T1vOwFHP3Sjn9xkzY2kNNyW+eYNdYgK8Ojncs?= =?us-ascii?Q?dTLwnp25uPHb+BFLtHvrCF8vRRoFPuZUvKmUgxcVXbWojI/fBsXHNSGehY5i?= =?us-ascii?Q?iz1o/GO9E6FqIzhPfU46QR/20wJm0svOSihA0U9QNn5IHgNQzb0Mvl7qGDFt?= =?us-ascii?Q?qXfFNjQjNIEvGZqc2jv/p1+tPvlplX26Oa12jqVBAEv/+bRUJ+lOwzq4hWwb?= =?us-ascii?Q?UgJumYzsU83/uDng5UDr+B6LHpEEh2lVy6jlkxp+uDvvrBTkNuJREQdGWRTn?= =?us-ascii?Q?CB0Nk69VWwECOgElX0GUisf74lPkd3PA02g22ectVAh/lW0xjL+V/J55Ccjw?= =?us-ascii?Q?Wc81PpLicgToGxuqhk0jOEZqzH1os59mW+6QP/9YR+ZugTVAXmhAgQayI5z9?= =?us-ascii?Q?qjSRt8yg4fantO4MgmAVmB2szU8cRmWm85dVY6LtzKb+tBAkj2ZRgAKqX1mX?= =?us-ascii?Q?sMKl5h1nejika0kCEJodGsdarN0CJKucPSxXiN6qetTEq4bdsRAXPSm8h4ZR?= =?us-ascii?Q?QK3IC69NIY+eG9OF/yygucHaHD+LgFc2JGT4scdg8hwWA1icV3E50dj0MIkE?= =?us-ascii?Q?C5h6sPFgbLDxKm0SGDFfVu+qTJx1IQHe6/5TY4/TY4jbTBkgDgrFq1ZhSjnK?= =?us-ascii?Q?fd2FuHM5utM9UA4/F4wsUXaoO6VR0MhUH0/zcGGNEJDgvWZW8Sbin/C+txeL?= =?us-ascii?Q?EdFDS07+b7OUG2bs3p8bhaHEJKSRbrPbYk6HzES51JGXQ6z3joR0UEnySmla?= =?us-ascii?Q?iTMy09Xjwh3YZYwfSl7qnV7libdC9gHnT+QO/TMiF8FIGlGlQSCwraxzEEWD?= =?us-ascii?Q?jb7JuXp4Z2xNzxlPY/LeEyJCvMOZ1v1+rkBMY5LvIPOPpw5RSDLTIryj1Gf6?= =?us-ascii?Q?vDYsxg+Bu6eosj+oDqdxuJNF1DMJ6yeBNaXXVJN7QpeVxnAz2KLMG9iftYbw?= =?us-ascii?Q?NJ7wt+Rybf1We7CHQM0EoSnQefNEjWkRYXKm12aZLQ+M+Kf+wHjMY8btmIv/?= =?us-ascii?Q?FjqGJN+5eZvZOGZr6fetPGhs5Ioe0Y/yK4W8Y2QNrU5E58VhhefTVa1pEPiL?= =?us-ascii?Q?77I7NBfrw53zAfX8Y3i/wGSFN8zwSg8MFfyNEhDui8T8BGScZ5GnV0S5tzGP?= =?us-ascii?Q?LeHRuaTjhJpl/RV3h+dcGhqVhCqpD/XSRG6L4TRvo7XwbnmtVkjrWUt9H1E3?= =?us-ascii?Q?vZiVqBUzubU+F+du3UyV7FzkqoKWmZNJjYapBP5wwQVPJrD/PYG/03UOvd9z?= =?us-ascii?Q?EStkyOHKe32Lguyy/OZ99Vvy?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EkpEPTkH4eotBmxx0YGb/vWvzQdNITKPA74meeUZmdgQ8YJfxteBoU9QbG/5?= =?us-ascii?Q?FJse/Eifq3tEozNoRjpPhWwvolwgbeFNDB7wzawjH45r8AVsbpoNIauJtGFs?= =?us-ascii?Q?KDZAEdSOHdVP9S5Ovg2pZDxWz+v/12XdbSjv8lL2j0FVMzKHJpLAZoockkrn?= =?us-ascii?Q?GmwFXL3CVbAjJ2Bs9gL8oeFfW8M+sw+kI+yzrAkDfVlIL4NDwBeZH6OfyWV7?= =?us-ascii?Q?Dp6sbrtttbUPXyOhW4O6DXnhJcnvYLUPwvJQtDx/rqHM7rUDAHeTiJXVsR/M?= =?us-ascii?Q?gSXxuVTYrLTyUT5i2JPby+wDTUHUHOEKj9Je5BFxZeVGkxG4hg/7POFLu97q?= =?us-ascii?Q?7eYvf4oz4nWvBpApMcGo4IySyn8V6BJkuLIO7xwS6sQcZH88/LxQTXBH4gNw?= =?us-ascii?Q?dzxqVFBG1VN+5H1+eYWWSIMFuNLi6psutQLmj5uAzZbrMATFcnAZJGJ3oi7B?= =?us-ascii?Q?A9H67RhjW4fPdFXFF8AuvZM0xlIPC5rALoXfxWVtZ5YMFo7abtLWJnlHE4xP?= =?us-ascii?Q?cI8E0/Wn/cjN36E8T6e7sQfsE8712C+tb4ClQqjqmdUb46WxyxbVh0GbxNvB?= =?us-ascii?Q?sMzxS0pWj/Z13cPj/F3vyvblwobmRr7LPyOwSWuuWLwGEcmsMcc9BlSuTNOk?= =?us-ascii?Q?oybyn8YAbYucP9tBayGIGHALGMBWmD5oKG6Dn2r9Qd7Py2ppsToEkRNV7NEJ?= =?us-ascii?Q?bOwHbvnLh6qDmbRaizn1JE7yHdWKr10J2DGZW4Z71HhhZ/d9g9ejzRJx0qBO?= =?us-ascii?Q?U6N+UIH9ATq76uZ5pVxPN30Fl2UafxihfmKooTcMbRgqJQMrBj9TWKL87K0a?= =?us-ascii?Q?lF9kQXOkBNpOxxMyqBZqhXNg80sQRHMAn5W0vv5U+EI52VC4bkW0OljaMSBA?= =?us-ascii?Q?rSgvkYlVvyGTGwQwbmkwm+zL4yD+YugJItSNHlphoZEC1hcLzhj6g/TEsmRu?= =?us-ascii?Q?rS/1D5k2E+z0IG4cPAIUwvykV9QaQH3XTSOSf2IXevqrXmKmYeyFDW0XX9Sz?= =?us-ascii?Q?KVG8J5vKXasX3law36wDj8ZTIx1Ln+vehTtpsXkjMB32gM/nX9V9+mBXJpt8?= =?us-ascii?Q?kHMj50UyP/IXSyuEQinu/iCybsC/zXSZxYZdspCRcXUIVjWNgjpCuNT8If7t?= =?us-ascii?Q?s7pDCTMlfkZ/o5IwsJkQFQq97T+gPG+rD/taacztA7OAt3U8aJHTjUZxwval?= =?us-ascii?Q?7k7MSDBDPubPVYzEOjUUSgaFmAUJtPAShAEEdrSaseh9dE2Z8V8RTM/Ck+zZ?= =?us-ascii?Q?uCyMMNZO0G09/oQCJbvslMzLnnDNMAs66dawZOoElVEY/Kyezc6wA0B5af4S?= =?us-ascii?Q?J2AC2PEDm19jPIVk4yFPe3/yXPAO/Qf1Ku6bwzS+giBoMciSFTifWMrnMdI+?= =?us-ascii?Q?DcTGlM6QkoXgGYJVfdOPeq7j+vJVLuTIlcttAiItE1ANi6gXHo72SyCprOxp?= =?us-ascii?Q?aTZOEoBD1iYujAMtmyQBHtVwGm40IBDZHN5LbgtZy3cq2RMUkl8r+UyVyXVr?= =?us-ascii?Q?+AXi/7U3AmRPrpBZIEQAxGqnOqWLz9tbIPGFc3NEAVhkyeOVOlApMatY5L4o?= =?us-ascii?Q?1Q9IXuPZ9QHbrxcpouWJ3UT47iMhVmqyVMbsJiAsUpc0cDs/rQPiUrEi+P0n?= =?us-ascii?Q?Og=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3GolPLKazFF67xNstX2YP0o76YxxVlBbB4DA1iUBMtrrnhsgnWPCJdDHzN2ilvv2IGnZVqxZJlFqZ99FgaQu2FwfrMl6QWsE/TVol8pLOFiBwUYdm3FwMXERPzIKYAiE6Ffgk7e5eZQQ2fGOzqqVrV8yiva//xTArp3EKAkHwJhM5ZATwKIzjVNPCn30e50mwwDRppcCSvmHqu1xpBOWTZQzXoqppDXf8Fy97cQE3WJRfZK3SZEapMeKMGjqAMgx8z0E8mN6PLmDkGpbhb+OVfg+WlBF8h/3tUb5HJ1IxdTmhazYyHO+zM/cXmWx9//oQZ5jZ10Ql+JgqH9FB29eomElil26LLRZ6H1zJLm6r78J0TaOzVlrARgSiFhGfPUY95MAP4HSjmop+CHKFHfU9ww2V85M0Syw2TLPtda9wee76uf019bIzcq/F1i9hkYOU4MWTL0ewGpRKQTCJPO8L4nKheUlfaly1Pivoqk8bHgLYWM2ekyj79GJpZL0B7btGuCpKflVDv6uozrjqpiA17oUpdD5Pfu+ZBl29mXYgjyM05OR9KXwvVIMwXpnXQhKMs/Afo1Vh71MKDuh0dhke8zKEQ5XwZFEoymOj1XhRlw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24d18dd9-c2b4-40fa-46ef-08dcff5f9b5f X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:47.5216 (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: dFu/g1zm900r5+s9LZa4/ixwEbWSYB86dhlHoZkmD1i6RUaNJ5fjM+PGUHpkIr/6r88Jv+6MSRwjrBpkiozPoP3+5E1A3IzGCCQu61ebHeA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB7148 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: rB57-W3UuIomLuCMMt7BWnRyBUZpOG0i X-Proofpoint-GUID: rB57-W3UuIomLuCMMt7BWnRyBUZpOG0i Content-Type: text/plain; charset="utf-8" From: Joao Martins While initializing haltpoll we check if KVM supports the realtime hint and if idle is overridden at boot. Both of these checks are x86 specific. So, in pursuit of making cpuidle-haltpoll architecture independent, move these checks out of common code. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Signed-off-by: Ankur Arora --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 13 +++++++++++++ drivers/cpuidle/cpuidle-haltpoll.c | 12 +----------- include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/cpuidle_haltpoll.h b/arch/x86/include/asm= /cpuidle_haltpoll.h index c8b39c6716ff..8a0a12769c2e 100644 --- a/arch/x86/include/asm/cpuidle_haltpoll.h +++ b/arch/x86/include/asm/cpuidle_haltpoll.h @@ -4,5 +4,6 @@ =20 void arch_haltpoll_enable(unsigned int cpu); void arch_haltpoll_disable(unsigned int cpu); +bool arch_haltpoll_want(bool force); =20 #endif diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 21e9e4845354..6d717819eb4e 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1155,4 +1155,17 @@ void arch_haltpoll_disable(unsigned int cpu) smp_call_function_single(cpu, kvm_enable_host_haltpoll, NULL, 1); } EXPORT_SYMBOL_GPL(arch_haltpoll_disable); + +bool arch_haltpoll_want(bool force) +{ + /* Do not load haltpoll if idle=3D is passed */ + if (boot_option_idle_override !=3D IDLE_NO_OVERRIDE) + return false; + + if (!kvm_para_available()) + return false; + + return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; +} +EXPORT_SYMBOL_GPL(arch_haltpoll_want); #endif diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-h= altpoll.c index bcd03e893a0a..e532aa2bf608 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -15,7 +15,6 @@ #include #include #include -#include #include =20 static bool force __read_mostly; @@ -93,21 +92,12 @@ static void haltpoll_uninit(void) haltpoll_cpuidle_devices =3D NULL; } =20 -static bool haltpoll_want(void) -{ - return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; -} - static int __init haltpoll_init(void) { int ret; struct cpuidle_driver *drv =3D &haltpoll_driver; =20 - /* Do not load haltpoll if idle=3D is passed */ - if (boot_option_idle_override !=3D IDLE_NO_OVERRIDE) - return -ENODEV; - - if (!kvm_para_available() || !haltpoll_want()) + if (!arch_haltpoll_want(force)) return -ENODEV; =20 cpuidle_poll_state_init(drv); diff --git a/include/linux/cpuidle_haltpoll.h b/include/linux/cpuidle_haltp= oll.h index d50c1e0411a2..68eb7a757120 100644 --- a/include/linux/cpuidle_haltpoll.h +++ b/include/linux/cpuidle_haltpoll.h @@ -12,5 +12,10 @@ static inline void arch_haltpoll_enable(unsigned int cpu) static inline void arch_haltpoll_disable(unsigned int cpu) { } + +static inline bool arch_haltpoll_want(bool force) +{ + return false; +} #endif #endif --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 AE51F21A4D4; Thu, 7 Nov 2024 19:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006573; cv=fail; b=VUpIdq+SA9nBB0UofDKU863Wj6G4BdkLF9+QUhM7PRm1MXONKlY9xJfU3ZNbUsLHBSWJZfA1iWPPjAlG8IQ/I5v/2Lvyv87OjV1OKcs37n72TaUy3LOWB5kx1Lzm+LIaIlbVjSRnuvTGDZk0pvcSOoJyXGA2e8gUxH1MhQ1JPXY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006573; c=relaxed/simple; bh=DVVhYd/WrhOtb8aUDHlylIdNS9AATp/2thz35KUD9e4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=prH80AJKEM/IN3AwBMO/XdA4Anya6h5WazGlM8iXevt+HwCQ5UfA4HZeuqJM+9ORh/VvKEk63MwUDCVzBB5Ti5dWkEYQzs/9D4FJOaFPJY0MlqIhd0qcarq4kAgAXjuhwdo0zKGdYcMju4fzxcI57Hlylye5x+oo8qDCUFsPJY0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=JvyugIT6; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=QYyJ0E0W; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="JvyugIT6"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="QYyJ0E0W" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBgoh004777; Thu, 7 Nov 2024 19:08:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b= JvyugIT6yY5ZJv4nZ3OuS/ze3NLtBbSumtYaJweln09jFkKGoGNbSyN3QTaF4LmJ pS9qmCURkTsczP6mtoMNJ6gbhT39QTeF2h6zP2pB3+I9gkaKm9iNPSAitCvelVVQ kX4aPujzJTtd6NEK9UPqiZyddGhaMIQ0CoaqxPWywT+/7ZiLU8SlqHq6mW0O/Kzo SkImW6rP00ukU+euCtMvrTgF9x4AWaZTpkb7+fttnE23pKFZYHcQf6HLIFqxybRu pXOULLIcBnV5PqVn/pyfRSJUf7291K9DsC3U+jRO4oHRlj3KDIcic2HPm/ICP7xc dVg1hISwPIWxVm7712Kvug== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nap03d8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:57 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HuoFO031413; Thu, 7 Nov 2024 19:08:57 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42naha6cn5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jHYU7SuaOZjJrvGAewVU4vHppufYR7+3ucTqKmo2RJTOlrPEmCSVvopy0BA7XtMPXCKtmNhV63ODn4Z7tVWLb/xK453vKWT3OEnmhcQD5pILeHnXAgGl2q1+D8+wnI4BjV+0/SzHhfRG6ve9UQUdPOBi+BMh9oYlo/cU0/o/vTlEiZjXj2IQZQLXzDbX9UUScdUa6YqIGPHGp3FWy6DM8xYC0+xZVa68gcvRcAendtkoeyJPp56h6M9ln+xYsP9KbGv7FAhYzKEUH1oqydOBNzeB4/Ug80CHRb8t93lLmQ2aUC2BMSlYPXJAcs86riZHVL9otbihCiwsUPpRjag1lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b=XPvrIIQQV+w2g39xrH/bUZByDz8GyN3inpLKCGT1sxGUkQDkriVK2pYhm8w8zM2BawJ1tzPr9GP5O1Nxy/0Frc2Pp1Aqcemp58jjaTzXFlrSIDh9qZdvJjkqgSmVi8SPi80We4LVieBllknWHVsiCsneOwlEyWnQRxQbzv+XXw4LtPN3dU6I45KmOnI+R6ni6t7zdRAqB5++0Hjeu51+J81GexO0VYL/zbVpAEgoa/Je6y5cV5hqIeMhrgtpaz1na7d0nTytcFjdcAlTkTwpfVh86b71wh3D5rk9kUqOQJKDVb3AdFAI5mxheAPnig11XY4ETRlfyzCGgy2ES/5EVw== 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=vbxLcRDXwMau6ojZuyq/zCmmjpfyFtoL4t1auecO12s=; b=QYyJ0E0WWrNRvrGG/IcZrrpd/vB57sE2K6/4J+t8LjzYAk6FBT8fqzreHIqPkFg58LHojM1AYd0SpveMnVnFlmDbq9+H0jAaWJ3os7NWw+WEMHFwUTijTFROnPbAjNDIorXgCgCLJJzcYMf9wsiezSPjiEAdDY6o8tHocw04yA4= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7736.namprd10.prod.outlook.com (2603:10b6:a03:574::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:08:49 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:49 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 10/15] governors/haltpoll: drop kvm_para_available() check Date: Thu, 7 Nov 2024 11:08:13 -0800 Message-Id: <20241107190818.522639-11-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW3PR05CA0021.namprd05.prod.outlook.com (2603:10b6:303:2b::26) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7736:EE_ X-MS-Office365-Filtering-Correlation-Id: da8681c3-1d68-42fd-cafe-08dcff5f9c87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?p7DBvckTMLZ0nFbzJij0clM6HDhC4QGIDzXzGkgPZAuwjLKkv4VrdTjqs4MH?= =?us-ascii?Q?wJxE8mIknSQASV5hnL8/adaj8cSJrg2th0KoPFA/dIG4NtsCrhickFp+ij1C?= =?us-ascii?Q?bQCt/INF9LeMwyFJbGFLQpuhcW3qnZpr1sjt/C4uv94KDsFjpyX24QhcYPC5?= =?us-ascii?Q?8RFx+yvrdSE5Qmrs+0BhH7yydbZb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?us-ascii?Q?fjFF8NF1T1oSnCkrc/13Ri9etOlYxvI2oJ7QmKXPUBdCFyiGafPyPYhV1bps?= =?us-ascii?Q?zHUrEMQO23BlBdUvdaHSV8uXAJ+FacWY9iJVG4ogyU2uRRePMsequqshsgY+?= =?us-ascii?Q?zEsCY0d7fFO35dl9uKmlxcqYRDq6JtpUnK/o00cI4egTqfCKEdkBWMasx2k8?= =?us-ascii?Q?YRK/GaHV0oMv/50q789CwidhYziGbh18Jrk545YYTd3sjpASgk9tDT4gYyID?= =?us-ascii?Q?BQ1qWAbecHtU2Lt0TzGLdmIM?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4kgiDIvdF9LLBnqtepMRCwW3usphjX5b8PP7zYT7/2lxStC8LRvDG/8mwdyD?= =?us-ascii?Q?0JnInhkRBY1nAC85CYtsOQ2sP6QcfcpJmim0as69R19dq5gUUwyUYIit/eaW?= =?us-ascii?Q?ch8qIV9xqSs2EOxrgnFt3nL4sDKEUiacMuKvd3t1sB/OUlSHkTlqlyMvjxLb?= =?us-ascii?Q?atuiKdeDvdKdBNhM0LIvOP3iHaRfx5+xGrvXf/knFkpzJ+KMgSvxubmGKRf3?= =?us-ascii?Q?9QC+5MsqZTZhqzyQ5RoBGRXWP4MG8fWbfevSv+2DeuMnW/kgsDM17c/N7VqB?= =?us-ascii?Q?1Hfzfb1XvpX3sDN7XTGLiugi/3YteyXgvAMukyZ3V0qJWEYQRWoYZU9iQUA4?= =?us-ascii?Q?mdwJTKLj1wyF80BlqhNKYG6QPurOI66E5gxlGmtB+Enz2wBNOOTijD3eHDUN?= =?us-ascii?Q?CT+/M0WgJh8Q30Q1NcBvcE32fGqe4aJfj3918RtT6hlmPrK/sgO1KkciAgoE?= =?us-ascii?Q?EgUe1zU2gEclGE1sMsgqKAi3FmOr19DbJY52MhuU5RBKM/ySG67K7XlmDMx8?= =?us-ascii?Q?+ttf5iKIW82jWmlFEteD4yVpFZGCrCsULyxEetrV3FadVWBcgmWYLea1QI1Z?= =?us-ascii?Q?BTG60viSvoFJ5PbM818X/JwT54SoXMzFJ93vqi8K051+J2XjKf5xnPO+njB0?= =?us-ascii?Q?0R9G+fDhvSXpNtLoqU40dJdSuQYVsEnFv6r+dePocNXtwnxes5+mlW/KEQAS?= =?us-ascii?Q?+fOjL9EZyFdP2lEClS951GVgv32An1X10jmCpALamDG/y9vw8OHr7LXh9s/P?= =?us-ascii?Q?IVhGyChwaj9gawA1OcdcqhdM91vwI4WM01HIpZx57RCs2HfE6J5T1ikIL7zT?= =?us-ascii?Q?dAmUH5MAUD7n+46BFkSZKGXPevtQmnx1VyIecTPjIHQBRGBYU4uWlmrPGuBH?= =?us-ascii?Q?KLuViCi/vnO9n5szCP0M7V17OxIXdAW/APrusHkmlpqb2UPfqq96okNugvdI?= =?us-ascii?Q?0kMAaZNU8hIOVXv7nSgyqG1VBfEQqdFYghFk81L7tcPV4Po8czoPWdtRJ4Lw?= =?us-ascii?Q?fo/eNK+NWID2+7ypYMlJZcYT9DIEGm+i5EVi4lIn8UxOE59XNZTsaf1xnstr?= =?us-ascii?Q?1IelgcDh1nuKsUePcUJOS21b5oAauBo5+c1Q+6iEGlIPu+ZAJiIx4ykVOjdt?= =?us-ascii?Q?kKhccwj0yeceBvi7rbjuhK80OpI6H8thAPK3mZtZzKY25UCiH0sy0q0nAgRi?= =?us-ascii?Q?FboPbKc+BqQtjeCVBpadTGxgORdcD3a7secoXtkYPKzTkjlJIkiNKNIlCLeY?= =?us-ascii?Q?IDU+9AO6yc59DdkbNw/ciPo/hQGNL0Bks3twJ3oPweM0U+GWXCM8Uv0qXCUs?= =?us-ascii?Q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EbJY0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: da8681c3-1d68-42fd-cafe-08dcff5f9c87 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:49.5254 (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: 2qpYzJIW1GWJt/qteBKNw70H8Hi2hXWa0C7ZuhvBbclxIfJwxWXZz7ZKMeHXtE8Vqwse8T07HhtzsPZD9mRkDYK8Sywlt/wzMgGJ9/EPJ8Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: mvbRESuLZ7okeDC-4lhKifUqEaBRIEns X-Proofpoint-GUID: mvbRESuLZ7okeDC-4lhKifUqEaBRIEns Content-Type: text/plain; charset="utf-8" From: Joao Martins The haltpoll governor is selected either by the cpuidle-haltpoll driver, or explicitly by the user. In particular, it is never selected by default since it has the lowest rating of all governors (menu=3D20, teo=3D19, ladder=3D10/25, haltpoll=3D9). So, we can safely forgo the kvm_para_available() check. This also allows cpuidle-haltpoll to be tested on baremetal. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Acked-by: Rafael J. Wysocki Signed-off-by: Ankur Arora --- drivers/cpuidle/governors/haltpoll.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governo= rs/haltpoll.c index 663b7f164d20..c8752f793e61 100644 --- a/drivers/cpuidle/governors/haltpoll.c +++ b/drivers/cpuidle/governors/haltpoll.c @@ -18,7 +18,6 @@ #include #include #include -#include #include =20 static unsigned int guest_halt_poll_ns __read_mostly =3D 200000; @@ -148,10 +147,7 @@ static struct cpuidle_governor haltpoll_governor =3D { =20 static int __init init_haltpoll(void) { - if (kvm_para_available()) - return cpuidle_register_governor(&haltpoll_governor); - - return 0; + return cpuidle_register_governor(&haltpoll_governor); } =20 postcore_initcall(init_haltpoll); --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 E600221A4A6; Thu, 7 Nov 2024 19:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006571; cv=fail; b=fCfAndn+bnkQe/KOvNEgpxyAiO6Cfopct0tQ90N2+WlqglFZfskQoS6dNtqeTh0VUzkMmxQKt4POsODWn+4T6Y0a7JC+ONC6gzbb+txf20I/ty9w2Q4LtYPbmpcDuXBw5nFHs3DR/KyhDz7P945VZfwjWwyPDlglrFYxuLlueJ4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006571; c=relaxed/simple; bh=0gtg5I8UrdEFmGzwwzLhTkyuFNRE9cj+/5Nj0z2oeWc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HAefGlgYeDW48QtSldqVzh6m9rrac+gBmHgUJR4RwsnQIqe14Ia6nUVz09kNMq2GkS2+2SMu4Ioilzf8MhGc117xzVJ0haiVerP0nLpmGURbiBbt9ePhAs50SdLhMgz9plPgwYeEsHgC7UHvsCFoyZw6gLrs0d7R8aZ7omz3CE4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=Se3WNmQi; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=RCNqlWt3; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Se3WNmQi"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="RCNqlWt3" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBdqJ002594; Thu, 7 Nov 2024 19:08:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=X/9z53ljMQ/NRHaqaOXAe6l0c0K+wzupeQNkRnwToPA=; b= Se3WNmQiSwdq00UpLaauJk6b7UpHJa0rxQaHC/6Zsv7xmVenIOYRqNISMyQ/lwkz Lq4t6Fm5xA84PMSzNIeR62lyqyKrT++o089E3H/MyalJHaH2W+nSXmH22p07agvC hJG9Pjt435zNUH2vhFFMPk02H+iMqo48CGM8dLZ/jlTHAUFQEgUL0MEWIcXM1lCL flixrt2s0RNccOuauhm4MEyCJM+euRRIPgHWSn51FOqx+YJzrUNX56AA42+SdQvn Bk5fsSwP1IdbQ0na1WOQNbTziYWrtJ+X/gtSbKdFWdEqVnxUqQT0wiNHCB2eyoLN Uh8nTKCnTHuJqET5aiJP7w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42ncmtbbcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:58 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HuoFP031413; Thu, 7 Nov 2024 19:08:58 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42naha6cn5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:08:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zGfDRcmkq/U9/f+HaHkJqrXCUu4B5X/sRVLTJVzStN6WmDxGbGQcDDI673GEVE+MB3mJx2SMyQBgkA8uBSfDvauEMvexKIffBfS+75n02znAesLZ84iuhRMSr3nJmGbElj+YT2OVH6DE9qh1xmpQqdpCnaks5nlurgN3KMqSKfSFTpOoJ1ofOAEwepHSBLqrjxDLhG4J+hyKj4TcLd/ltgDIMhUPmR7CPXbXGUgiAG/lVLhRZTVy6YXblbk/oZTNZ/bYDh9jYAvZs/CyjnCjyeyAy38pQwperY/s6tmSig6AcAWhZqO1jnijNUWKzs+GOmXX/Pnevkia9xp1VbMubg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=X/9z53ljMQ/NRHaqaOXAe6l0c0K+wzupeQNkRnwToPA=; b=OhvZ91JFuZAiJHf75tyYgZ7BbZg8HMQcjNulSaG9iR7HOMsFky9EJU2Rxtk6sFsKgiLzMwgxsLkk7+7N4487fZjs+M1a8Bs4liz08ubJm2WBANL+Q2h1XZNu7iTJWNmP549kMG4VIIKKsLU82DPUACizlSSMI8eopGCaP+QZyEVBc+3WPjAUJn9CF5zavM/fu2YyruVeGWj27uaqQ3cyP7+H0x7ldphZwsNYi5tFmfL8148CIy6xSU/NsEsLx5TAFL+YbqwOkYBMtHDiQPWa3ZiwXXwZwaIVXixPS3dTiyRpof0a66PhpdepIetqEgRaCFC+eidpdqzrMlXvnYG62A== 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=X/9z53ljMQ/NRHaqaOXAe6l0c0K+wzupeQNkRnwToPA=; b=RCNqlWt3ruoMgxjj1nPT2YtKy6Rb6xpa8rpCTHG98BCzQ2/rKOcKHAgSNoXmwVt/HGO6Q8euTaYTqsSGnMbKEHPlHXMSTP22vZB0AZN623zJR4j97vb0IJARKRghiO3TGkIsx+0Qk8dvKQwuOFsVdftuZa9DemSy+1YxrtIowRk= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7736.namprd10.prod.outlook.com (2603:10b6:a03:574::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:08:51 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:51 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 11/15] cpuidle-haltpoll: condition on ARCH_CPUIDLE_HALTPOLL Date: Thu, 7 Nov 2024 11:08:14 -0800 Message-Id: <20241107190818.522639-12-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4P223CA0023.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::28) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7736:EE_ X-MS-Office365-Filtering-Correlation-Id: ea711910-06d4-4d83-1896-08dcff5f9da9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?U5oVryzgRGpXD7NQaxH+pmLNxrpe/HjcY7SYT/t75Is1Vab4PWZWVc8YOhXQ?= =?us-ascii?Q?NJjB7UO4zjA/HvOzHW5wJ6m8DJgxSuS+u00/9YZdVwjUc2YvxNLgoF0D5KZ3?= =?us-ascii?Q?AI7pa8V1tiZnRm9ndurmlvc4Xlp1RO/dqwayxXXEjTvrgx3ZsD5KLNM+IsPz?= =?us-ascii?Q?u9gJFpkqXpNMwAmlAMxXJZu/Koc22AsXDheUI1TZ7DCoQQMNGjovn3LL/HCL?= =?us-ascii?Q?Ky6SRKDJj1jtldeqJMl7Xal4sZhyJNqdyOUs3Y2LhXmiO1rmPTD7i52jmGsz?= =?us-ascii?Q?WJtJSLYutykfG+Mt+Jn0WI8IfQLg2lr6CUfVRscZm8nWPBSNoMDzAshhEf3U?= =?us-ascii?Q?usMLaJ5Gy4piy8te7X96Tf+RlXC/XYBircIqgqygqC/bAYDHJlo2w8ptiXbB?= =?us-ascii?Q?OD5BjdY9oNJFcsVsn8KigLg3olQLK/ZwgNXta5IQrzrgAXQ7uiKN5NaIf7eg?= =?us-ascii?Q?7aka1LvJmfaeOMIwvixUVwdPG4lI46HV0fa6I9PcnQhZPdp7I2JAgQJnfWQy?= =?us-ascii?Q?L4WlcWiDhk5XuZ6Fz2S17rhQ+XsKrL5MN02OhCgGEBEFStID9v9NCjseg46q?= =?us-ascii?Q?GJ7KpQWQdbJxC1LrakzMJEElMdwuV7Ic6m4m9cgT3uVSXLchnNlrHpN9etcq?= =?us-ascii?Q?CoEbhqlOmA/RVb0vEtDwtebi5kKVlM8lGsc5lR9JbwiliYEtwO9U/SoU5DES?= =?us-ascii?Q?XWhybur+STbGZD5m/wcyR93kKrxDTZXS2lxecTqeS3pewvpQ3rrQ/0k5ChKW?= =?us-ascii?Q?wiUkSGldWyEwN7ZN7/cjiFjHbHkr9JcaOwjm9Jiif5rqg8s73GfiV7HLN1rX?= =?us-ascii?Q?uuzqY4lMKX4vessAe/BfLmeRLy0jtvTBNa86jQbSpMphVKEipDuB46pelXZZ?= =?us-ascii?Q?KzrG7BQ2OFyel/Yi/mqP1ennsw+mbTkSJrXgnpNUk6kYuhf5+ZabTuOcb60j?= =?us-ascii?Q?UMxuhvbJIQNF21FGfOmbwFGkSF03sNHzRqu8zVs7zc0SzT3oQmytxMANeNvL?= =?us-ascii?Q?Plr0BhRfVm/eCDrgi87k9+OtjvbOlmI3GvwemvNrrmWl4TGkz+U8eJ5hWeIS?= =?us-ascii?Q?g1w/Fq+iBu2hw3UPWhEpwVBZPuopraGGaEoxdhEYQehGO0y+BnYhTJxfBeIZ?= =?us-ascii?Q?GdytWXLzr3nVSUp66D2nASjxVfkZ8wqrrp/WH6AqM/IUyC2GmNOpYJP+3WN4?= =?us-ascii?Q?nFFll8rjPskLk1XHfLITJ5YeS+9qlJHMbXdmoQlHyHwoi8qBwnyyQDEdI/KK?= =?us-ascii?Q?aLfu4MAWCZFwdy4UPcVGAtUUvm54QnFm5HJLhwm97FDKmzehf1UJb/9TiW4b?= =?us-ascii?Q?Atvkcvf7ul0msTET4CtFlz0T?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nqJPCNMIWhzXuLalSeotGWwJJIqMpZTppIUXmsN8d9araHuNs0c2OINslx+q?= =?us-ascii?Q?qqALwncaXb4U2pj86KxMWxixaer0esmglkuFYX4at+IWliU9Ho6xHq9FH2tl?= =?us-ascii?Q?9DQaywpE6RQe7+fbnMemoJZj5yWNr/Gy/u+7lebfM0T8SuIGnkrEVlVjp9XE?= =?us-ascii?Q?I9WWABGyRFCCHKk4cndP3EPo5qKFlAH76gJ15lcOvz8d5Dg5hA2SzN2uhxp1?= =?us-ascii?Q?Cqm7D/9MWJ2dJ0gd+j6k2pOShxo6Z4cphyGpQIUnveuhodjgBEn+HczNLx1W?= =?us-ascii?Q?gNdDVWTc5ZXHL7RLOgmpi/SQ1EzPikYHNb/7oe75/2mUDV8PS0aVmZ8s3RCr?= =?us-ascii?Q?SMHyTY0PHIH8CfkRUvxyFdKR2nJN09FYknjE5g91GpczFLifXiin8uN5DGUX?= =?us-ascii?Q?smO8P0dqt62P/iZm98jMZw9378IEP2JyGWCGBUyfp2JjvOys4MXNirvLNzhC?= =?us-ascii?Q?MrOcD+cnowXVjrhE06Hs/XEcT8KhV81LPYcSelUieFKTPvW0Y61GBfF4w7A/?= =?us-ascii?Q?6wxq9BldExnCoL/Tia8IemvKZuh0hIV6b6s7lsyxIs0/kF/wxeAKs+xqxV29?= =?us-ascii?Q?ujJPuIZRbOtadsdE8BAUC3gG8h7HSD+fGfuvg1UlDDmjD7iG0AJDqaBNQyqV?= =?us-ascii?Q?Y+atW2T3LRf0f+EVo2fIQtXezcsTTW1KYzxs+M7lKORTXqUmeRPIO3az5hrf?= =?us-ascii?Q?hDHzTJa4AP9ZaTm1M93YSFDDkIGzjpcvWtp5ZC30TvautzwslQ7fRQT7KOMi?= =?us-ascii?Q?FIdSXE+Cx7K4TRU/48O66pT5FWRvRcW1PAy0Wgc2zzKC7wHT2O13cxHcDmVK?= =?us-ascii?Q?e8xabFDL+kArwttrh93XlfvKBHygJNIg3teg/Oltwc1WWNlnQLiven5/GLSj?= =?us-ascii?Q?Rqm/L2pKkAY7Sc/sKLEuyzO/DUnrcocTbJxqoq5Nqyc3+P3wmbq9ajOb7gDb?= =?us-ascii?Q?grGQa9ViI0kQjBiFjpG74fHQr93LT8ukfoYZ4XIdD2RpbDWJewXu8VEO7QWe?= =?us-ascii?Q?f5VVix9LL0eF/HFSI7CwlJx6sDnXS2Qq8SosV5YG/t/z1X1dCITKJ379ikuv?= =?us-ascii?Q?A1s7INm2iE1gvEtB/X5dgHXRZYXztaCCDSHgMA5sZxQccCTFpP02L9Zdu+6J?= =?us-ascii?Q?VxJhebu1wGt0lDSVyFmz4cdsH1vtJz8q4exbzn/gDoRiINHhZ3YK4n9xWAB3?= =?us-ascii?Q?wYnnOxhEgUd94tHhLv1cjNrc3jqqwTncEjvHrw6PIVNrHQdwt9Osx+Oh3HfZ?= =?us-ascii?Q?kAjeXI5AwuOr33FNEUpanlhjJBjAhERE8wJ6qGBLBG5uGKvahMExwIDVjzQ2?= =?us-ascii?Q?P3JzZCW0d+t/tgMa5j7MHIAtV03XhqRUVOdkwZIXhVghik2cI9PjmUGOD+RR?= =?us-ascii?Q?2kayhv2hwmv+NnPBXaDGQ4wP2EYVeLFHFrrYZy1/0DPLu/qgOPdlpvS7KiiX?= =?us-ascii?Q?0f7SgzRAY/xLKq9EgAdrvPGcjj3cjjvmsVjsqBAOVGFaPMW9tbzD4w5psB8i?= =?us-ascii?Q?yT2Bz03xKrxXB86rJHoUxAxUB+CaS+RDBzwd4np24PXeqg/knHC/Kmn8KSYV?= =?us-ascii?Q?711/bp2cShbS2Xs48OCc8CZuOh18ccQ4XkPk/j06/a7MUQiqQj4rV1Ia8Iy1?= =?us-ascii?Q?tw=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: EbCIZDdHc+XzpkGVTjoWRvvuQ1mNY5H8Y+059JSz52vTmfPmpmdRYSbLY1jO7hYJ6rbyfyYaOFWKgpp2tpPQjVU7OLXqKlTX3d9KtuTGfum6XxUFiO70WHb3Id6oVod5DKL6WWdzwaqCxs1/+5244tZxuy1wptu4qAO/+sQS8Etbg5HP5pKRnrzbDY9fAjvO9lsGCr6oKA/K1hLLj8q7kdoxkxjKjkE+1a3Zg6RlO/kOiWd2G6fXlltlS5ipDqMZldg7l2LCqHZm65CeK0g7h0iF+f4Ht/vBVGulMEPZ5vouqRoc2kcg5fSI3K9GL/KHCoss3HhyeXvzUyKXRrcWGgADfcqp1TPWN562AyLWR+qEJmKazK1k/KplTq6+/wC2BXYBTbq20yEtWbPJuDGXF9Q2W27dXHwReT3+4RHTpkM0dPmm4RUQw3NW+Yf7FK7nA69AQM9FFNBU/Kem+4n/YiaT8ogt5Pp8AUjq/GmdWHUzGZ4ghjw8NDC0/F0ImXmcnwccCNDOCsuusHr+FeuJshKSNlNFeq+Q2dyefhRtrkNkACQ1Zdhpq6dzPCv6e/qmPM8UISnrlHl1gkMxucf9iO0+TgLkWXnB2ZgyFkjZaYc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea711910-06d4-4d83-1896-08dcff5f9da9 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:51.3401 (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: y2jzo8vWNJ1CfWyp+bHGp3Z+zKtt97RpuHoJf3wY3O48mSUBteLIYAoVmjih3hOxDbcipaA/40EoQO0yH/VQifBgiYEMwtdGnvDdJ6Qo9Sw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: VnjQweMphPRtdwNHdupaFgJrYu645lEl X-Proofpoint-ORIG-GUID: VnjQweMphPRtdwNHdupaFgJrYu645lEl Content-Type: text/plain; charset="utf-8" The cpuidle-haltpoll driver and its namesake governor are selected under KVM_GUEST on X86. KVM_GUEST in-turn selects ARCH_CPUIDLE_HALTPOLL and defines the requisite arch_haltpoll_{enable,disable}() functions. So remove the explicit dependence of HALTPOLL_CPUIDLE on KVM_GUEST, and instead use ARCH_CPUIDLE_HALTPOLL as proxy for architectural support for haltpoll. Also change "halt poll" to "haltpoll" in one of the summary clauses, since the second form is used everywhere else. Signed-off-by: Ankur Arora --- arch/x86/Kconfig | 1 + drivers/cpuidle/Kconfig | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index df75df8467d1..fd0ff83a84f0 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -844,6 +844,7 @@ config KVM_GUEST =20 config ARCH_CPUIDLE_HALTPOLL def_bool n + depends on KVM_GUEST prompt "Disable host haltpoll when loading haltpoll driver" help If virtualized under KVM, disable host haltpoll. diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index 75f6e176bbc8..c1bebadf22bc 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -35,7 +35,6 @@ config CPU_IDLE_GOV_TEO =20 config CPU_IDLE_GOV_HALTPOLL bool "Haltpoll governor (for virtualized systems)" - depends on KVM_GUEST help This governor implements haltpoll idle state selection, to be used in conjunction with the haltpoll cpuidle driver, allowing @@ -72,8 +71,8 @@ source "drivers/cpuidle/Kconfig.riscv" endmenu =20 config HALTPOLL_CPUIDLE - tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST && ARCH_HAS_OPTIMIZED_POLL + tristate "Haltpoll cpuidle driver" + depends on ARCH_CPUIDLE_HALTPOLL && ARCH_HAS_OPTIMIZED_POLL select CPU_IDLE_GOV_HALTPOLL default y help --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 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 2F30121C17A; Thu, 7 Nov 2024 19:09:38 +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=1731006580; cv=fail; b=XnDaRD5WdE2TRD5H0e0L3NR5dHDObhT7yshY/C1hS8+m6jikfTBHy2f3Nh022Sx2Xf3R6zXTpEInEAX4eZJLCY4+kIPZ4JcMnH6EuNDgkJaD+NFvFA0wN7sOc1ik+KuSYvXDLiZtHe74qoTUwM2C9b0CyywKW8lc9oiMzXRDB0Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006580; c=relaxed/simple; bh=h+s0zPrbvlVnDP7LgdMF6n/gdbD2X+UkkYRVL3akutM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WlrR2tWcQCbokWYhXpXrVwqn5SfMQ8yh3M+8qVNOA9LSkXpYGxQ9bHenbDTpW/tSI464k1tSkywnlsmMt+8C4mCcvB2IF6pKmoo8Be5vZcQaZJKsKpOQFnUR959i7hAhFV+gv+mt7qxynGD8+ZTenke08EdrLb9vxk+ojXdBv2w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=iyPh7D+X; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=esS9d9Fl; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="iyPh7D+X"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="esS9d9Fl" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBuGY014259; Thu, 7 Nov 2024 19:09:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b= iyPh7D+XfdSmXL5vEqE4RjOvI+aKuf1YY9vOd5FcxQfz6wsRsWi0L7W/1rQCAo6K HkZ7MmR4WftfUNKX5flj5uBtCOelXPwBhwRhUGX2hH/oQi/Ll9EQcQPzHhUa3p9x Y6h3mcs4lq6qPdD55dbVPZezB90K4WQ8atUgl8Xqwz0sfunpOzyh/5PIxtz5ZbVd ORbG+YWow8XqWlg7x8ZrDwaSRwVVMG4zW1CaxssqXNfPovU+/2T5MMdQET0Sf2uF Pco1nHlS1HTSIC0yTC94uFDu43jy77qwjXiiUiPtqx4cbqlnL8VUoYZDleq1FfMe uV0HG/mCgi1wreJNbQQerw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nbpsubqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:09 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7Ho2IX009141; Thu, 7 Nov 2024 19:09:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgt646-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xmO8yJWn/dV1q+A3Dpc1yH4IRrQBV8h/S6g134SQuo5K2OdgdVEpW6oR7OJyMkOqFwqXtYzHrT70Iv5aS6pn/hPEA8M6ZQx/2zKM5Xe2zUa6XrEdE8SBpO+KScppl7FuzfMR4/9kCFp1eINrZkHG0TzbEC+NjyWw0f9unqweeQ55eccxlTIiasHzMGG+JR9SB/iDJb0z8xyUTX4xsY5OAJ95I+zmbo1kM9gLVjAyGvJ2lEeu2w0aOZyZj4X/NRwAOAGPNbPuheKmPsHrS3izwqOSnlTTFs0rzuVLUdHTXj6H3o6s4JedPrbMHG4RpCfquy/hxPR1OnP/r9cA0Nxccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b=yMscsV9bK8SiUWzOsQce1Nt6Mf8pD0cMnV7mNHbhR+zN+9kXP0KqZ+qzo7UPp+0ZIUU2JotE89T63Ee8kd0oU8GsTtA6zJp14BNApTHcxat03tpBGvlHPsT7pe79K3aKCWnXDgJAoXE2Hc4dYNnfWOZU0P+twIBJsDDqtsSDFyTFzeccSqmUIZWE2d/Q2iNiWpipsiD3f705Vb/hRZoO2Y57DNIeVbSUJoYu+7anjCHOymnIV14Y0mKvxwxNT+PZL8B+QgVrvPMTDX/cq3k41uSZwS6QAFtvYD3fcxo0zDi7wmWyBlEfXvPYAkVrX8oJ3vQNyoqRcZLp/nsodAdCfA== 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=tuXMmugSwWVSw8iGwCPMmmKPajF8YRsj8SWgseskxsA=; b=esS9d9FlNE5+Y4uGf8bveVrujUN3Pa+hdNmC9YHDe2Kxp86xUJDUe/J6LMPZq0E4Q1VXW2Uvf/G3X5GHMcKG0FeCZcTK1H7hAEZc+EQpPp5kZbUk/Ziu6uETF1GQYiOtTKlVivdvdL31VwNjTG84jq79yNFTAFl/H18Tbr/gCP0= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7037.namprd10.prod.outlook.com (2603:10b6:a03:4c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:08:56 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:56 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 12/15] arm64: idle: export arch_cpu_idle Date: Thu, 7 Nov 2024 11:08:15 -0800 Message-Id: <20241107190818.522639-13-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0096.namprd04.prod.outlook.com (2603:10b6:303:83::11) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7037:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cc7818b-9e33-4e83-9153-08dcff5fa086 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Se6ZZ4UkrdvOLIiyN1L1xwF0U4g8UG9oZKyKOu2af6xI4TSMRyOuM4NBl1pL?= =?us-ascii?Q?HWlcYqIwmtzIYmDMVlJkucGkO8tkjZoyb1aenbLzjE9rOSTr/zPnYXme0r1T?= =?us-ascii?Q?sspke9odvtV1VHFpuUQwZ29WfYqyVo3NoxWtcsc+xV8mMcpAgIl+kE4CBO8n?= =?us-ascii?Q?arfVFUJ+gj/ChZdgjJCNKrwFZeVOhXPCxpKKLHS/x97OE08e9Cub9tx3gCUt?= =?us-ascii?Q?4vOmKyY9NGxJVPyDye4QHImgoRfFXks7x4gVcqPDS6aPQf6Y0vLXaCObCi/P?= =?us-ascii?Q?X0yrC/LFfD9jBaTSFfba/5H45TYJTsjpEVqIoIpuH0gQU8yj05pV1UVxNo+4?= =?us-ascii?Q?W+WJ1IXidP4gZoBhgWnpZmIphm5H2Eu/AaZASYlRl+gszX/zTOXn2pRVy51B?= =?us-ascii?Q?fTo5YmJOLWzxnhACozQGkAi57atCARk84B3DVhnPD1iKllCAuNjF0EpRJvVh?= =?us-ascii?Q?zqGutb6Z714cRfAuM9APnpOR/XnOGXkq/2Lz7D7YsVeiVkbSl/0OmfJyQVJo?= =?us-ascii?Q?6iGy9kQx+ourWZIwR6JXLzedEzet7Ts48w66/9SKGmX6lSLI79n6hBkC0at8?= =?us-ascii?Q?g7p9wtvjyjNT4/n1kIWP/rxEbYFSPUxdc9FnlVaeJrUpG8TerMobOkRooPQu?= =?us-ascii?Q?Xv9hW7NcrsH6P4rNAKKAKGigLyoWft+3UlL7tYn44RuPyRL9Z4L9TBEGPl4Z?= =?us-ascii?Q?ikIXp+suUL0N0Kf5qo4i+nj6+Tcjm812yzSi3k/VN7tPNLNAqahV62m9hTAM?= =?us-ascii?Q?0ZGTubDPKqQgEKxxy4oVTdNRZGwOxmnp9bWRVAPmlWW5DjYEO6T/1IFVajvp?= =?us-ascii?Q?RbBNP8hnFshgIoqGxH6CkQIYHiHKkNfK8SncHd07sT8BenkpwpNh32uOEpET?= =?us-ascii?Q?qpnUzm7/pE2L7JnnVHjW2+71TaHxFPb7fSQNEIvpXk7I1UVVK3j99o2OFPze?= =?us-ascii?Q?F62mjwt+SBlf+J8/USn94Q7DN3ARfFrZlx7p92Eudzbq/yZEgIbuQJd+MGeE?= =?us-ascii?Q?AjLeNYU1g6CNEN+fA/F7C8Jye3pch1f7l9a1eQuB8Uz5E6ySU3BUq50kn/gM?= =?us-ascii?Q?3nRgfEpA9N2JwwjsGT5evtd3UaAaV9YbUS0S7TBzps5s2/Ta6ppsB1oj6k+r?= =?us-ascii?Q?HkNfyejW9jGjlAQeqTRdzS1Ojo6vcDIt4AYpUvE42pFGUSxMgCalXauZBxUZ?= =?us-ascii?Q?uzz52XRFNEE0ynbUWHNhSNv+jB8/v9gbOh2v2GLqcfkIZTQ0sCau8rQtgqvZ?= =?us-ascii?Q?8DjAm9bNvJ+kMr6Yz0oE9itNekOxpopJ2CM6TONE8ld+Dolcm14ZwEuGAepl?= =?us-ascii?Q?4PVuycpLXAwYssgslq3oUn59?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bAfNrhJZM61sSHpAadMW0Yh2czrUvcBMLZJ7K3qXIM1OADn+zy6AWSbBo6qn?= =?us-ascii?Q?7FY1b5qbUYX1uBKZHHKSx7AwcvieHXOw0Y+U8R45dgX53Y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ecIm3uavAuUu2R2wff/1qHR11Ka91ZNSRn?= =?us-ascii?Q?wj0UFMqFnN9O2GL84cuI9QCZvSbaRk35BewYvaFxOFaCwchAh37MkOSGt2w5?= =?us-ascii?Q?5UAWzzcGJIypweOIUg5wIOGVp2xZpP1XPggO51fKIS3TGNRk0xTVZ9eO80XC?= =?us-ascii?Q?fbaGtbnc74w4/4ZdkP/VWFuO9MRNmxwNQELu9c6Otauxj7Wiw2Wmfm4elRxT?= =?us-ascii?Q?Y8xv2gu8kBhO3hfq+hdcAntXolHyhbwb2okW98Ffr9grdaXFoGaz+XdAPFjY?= =?us-ascii?Q?3hU3m8RmHbOgctjXd2cV/BHYKOAY8yFRcxlwJWKTBuZap+Wamp9gnA3FfaRT?= =?us-ascii?Q?L/AiQT0typjbfOvCxjbNehM+k7kEriuMOeVFg9G6ngFtf4EeqXeOCpx0+XDi?= =?us-ascii?Q?XXac/veP5gxbEX5Y9qvbWdBntQmICsS7vWhGEp2cj/its13GFQ4Flw5IqKbD?= =?us-ascii?Q?tmWVzw9hVbowmylpOfHCXYUjiElMSy4RjXBVVsSqj2fPgx2MmzESUBRCNZ14?= =?us-ascii?Q?5zItOJA0ycp8sua5LMUyzgCeaRkH7wroPC0wF53dnp1iT69WZZwLnxeDI3bK?= =?us-ascii?Q?MVIuMnUwdGAbaK3NfYXEXynDjQwGG+r1xUCZGGFzfmSaQrThG70QP4svjvye?= =?us-ascii?Q?Mw=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Pfm4z0eCiTr7mH7GDKXhSYwsFSk//D7cZiXQ3T3ARLGSl9BT8xwvX/AeNAdUbF4leezO8y1U1cp+BmrW2xVWIw3pO0dhHGzSa+4AndETBvgcdgUVSCq+jm3XIs/FlWKmPpxYRm4bb36o+tMkifK6lrrR3l+fC0xO4CBmlJCqlojJBcYzuCxzfHlYDEH3nmZimRMLtTuHsdyJO875ed0W0RKJ5QLv5R8PTBdOGoY7YTTHuKDJfjja3aYeIxLTX+9BiGXzZeEG4NyO6R/9nXgj2bQezwTbEJouuzSC3LYmETmiFiKuVuRTA83rlyMjFGzPEOBlzZmgJMBwF51fwgi7x6mPYr8uTipzPetKPUIc2IDoQgBxHbMGizfwjJyYr1DyaoWa/BwcB4rHja4nPdTCj8/bC1UzsTDKxmeF8vOARcXKJbmbfSQd7JkQoWttHnQxyX0KAtyNPbXd/5/kgmJTrgH/7gI12f6r1n6rTaQ/iaW8w/TH1Wqfg5jkquF6OldBo9cdEm7ZZYmtV28MsYs05LcJ0R56vKJINUKQ2F6okuNxL3UCkvTVo5tohV+RH7Tx9dFwMKAFjecy+c/5BaXP0xphgAO8Srqqodljw+IEqKo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cc7818b-9e33-4e83-9153-08dcff5fa086 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:56.1376 (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: cFeWGxAFpwjkVqT//IzErFNAc5uyRn7S1had0WbQNF9PmxBmbfuyxMRUJjqUPrKSXMBEB72d1w2sczYEcKci9eiAQCCccj28SMSjtuGzJqI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7037 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: frYy-i80U1jkbQ5KgQ9xaJEDRX3lkJBb X-Proofpoint-GUID: frYy-i80U1jkbQ5KgQ9xaJEDRX3lkJBb Content-Type: text/plain; charset="utf-8" Needed for cpuidle-haltpoll. Acked-by: Will Deacon Signed-off-by: Ankur Arora --- arch/arm64/kernel/idle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/idle.c b/arch/arm64/kernel/idle.c index 05cfb347ec26..b85ba0df9b02 100644 --- a/arch/arm64/kernel/idle.c +++ b/arch/arm64/kernel/idle.c @@ -43,3 +43,4 @@ void __cpuidle arch_cpu_idle(void) */ cpu_do_idle(); } +EXPORT_SYMBOL_GPL(arch_cpu_idle); --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 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 3628E21F4B9; Thu, 7 Nov 2024 19:09:46 +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=1731006587; cv=fail; b=eXGODySaYQL11iDhpiEInpjIio6RBdBzi7xe+9TAicoZuqHDyEg/+VSXUh7au+Y3TBxPQSz0PcVux64KPzsOeFGr9IES7yHuavQHY3V1qhVsGza70Af8o+5ULbK8rstN0+9/MhLLKloaLBW4itnoxbe4FQK6G5Pj2IHuLEWvJGc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006587; c=relaxed/simple; bh=RWXJsQAWI8E4rVsNQMLP0FS5DAXuJLgRTPgVysLDiHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UCZa/ISSb0raT4p7WGjiu/FfjBax4gvydjzXsbvLZtvoV+mEiikKuax5CkbH05xUR4BkNSsZ7Y9NfzBXNIdmYhSCXqcFf9onFlmKWuckUpjzUoJdHhsQhTyCTXjmgGn24HLL6C+P0zJlxcK7JGTjOFj9/X3uPiZnqXfkoKAPb20= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=RnhO4b3o; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Bm9LEFFv; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="RnhO4b3o"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Bm9LEFFv" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBWB1025022; Thu, 7 Nov 2024 19:09:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=fakUqzDmzaD3RTe7NO+yLwk8t6vTIFFk5+sqvN+b18w=; b= RnhO4b3o5Qi3hQFKGNlmNAaGBhDEMuizAQtwtgJqrv2m0RLdYKUdJpfhDybJgR0e CAGhI+bKrRvYdBcbSPW7wp9K0tsqToWDks/FV2RTym64n8v3+YFrryPRdaBvHr5T 4dWOoaxT37afxq+tOeldpURsEVPGRqyGPF5WRlNgEBDlzGYGJ1I2SzV9pc24BwAW hDBSZYlI/nk9kyOQPibqJhomJbpH1WnxqV+1I9+Ex616Igt6Z9t8evjVPFFZrDJ3 IisMf4Dp1IHep1IRWw/AxiQlV4E0EO36KnxKZ54IPx47SNWxKCzxhEkwo8GKlbsU 0M0rfadmg3/zYxtqIKCqog== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nc4c3g45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:10 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7Ho2IY009141; Thu, 7 Nov 2024 19:09:09 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgt646-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dvrAVstRyQg87Vo6qlf3PIHPCQsb7G+OYpxIQJS9Hur828scVHPoB6Lh1idmHatSbQHIKDpZUHzkvl2s5avEtYnjkj/YejwlUeoyBHwFO2vaaffHPLdPo/lQAgvG2T65NaeyepeSAwWpaM80/kxILls3fqNLcn4FMx5G+u0LmXP9UrxFuI2wJAODAheG/9zEQRDqwQinKhnl1hoM86t0Ho9fRCdkVM8gVgWyH3xy3ulp5txqvUQ0+/Tw9MTAbrpRM7chotAnCGt9wv4Zw0u2qGfyS0qqhTmCbVymLhXcPZcb2cALH61CRSDk8CYZqvYWHJgZaWNSkceYIwjesjEM6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fakUqzDmzaD3RTe7NO+yLwk8t6vTIFFk5+sqvN+b18w=; b=o8vqaFcc2Oi9U/ZT5Sh46IpIP3fZCfEFrxWxitKHXr09ASKGr/J1aOhuSkqAR2Ca/ET9lzKANyz1JHNYTrzTlTXlv3SFbW6Q5WP6Z/JXkn8YYJ+VZHtg9dKc+wQNI5FQJrW2uDNpjtfAfRZyDaqZSRDTS6YIcwlpiL3sHr6pWKCPBb6bjzHjYQQLUs3Y4necidKigRO0TySOV6AOINsKAugMvtxWMTPp7qFp/4F2aBRP4kCpj+YXoAy2h7ohjy7H7qLQJ6za+q8r+JVsFeh5jQZ0VSkPX2/EJVmQUj8WSHmGCRgBRvk+WUxE0pEIbcWWGhZQCwuDyBrXF8AIFG4Z/A== 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=fakUqzDmzaD3RTe7NO+yLwk8t6vTIFFk5+sqvN+b18w=; b=Bm9LEFFvMvMSp2OiQDmiStSQ2CbCdNaAagWSUiVdFXsUYutvIrBAQMKdfm21wUbN+3neaK5n0SKnGOujkKP2R4wki4kIT+aPtKHJVzhd2Q90v8PuX+dpS2ljd31hU0titZteMWU39xWOaU+z9hnzUHhWUmtzRYGDdfTHImvkZpA= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7037.namprd10.prod.outlook.com (2603:10b6:a03:4c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:08:58 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:08:58 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [PATCH v9 13/15] arm64: support cpuidle-haltpoll Date: Thu, 7 Nov 2024 11:08:16 -0800 Message-Id: <20241107190818.522639-14-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4PR04CA0097.namprd04.prod.outlook.com (2603:10b6:303:83::12) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7037:EE_ X-MS-Office365-Filtering-Correlation-Id: bca9db8c-87d0-439c-5148-08dcff5fa1ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZhQTkKcUC4Td7e26bSH3XdKBIVO5Cl2ODNeSUijfkipAlavkwM32UAQjgUc2?= =?us-ascii?Q?yvckvNmKqDjQSHw62UOU/CJAOa7dFNvlHKUY9X0RG9As9sydu7ti7xnwPoUv?= =?us-ascii?Q?9pnaLYjCP6FRo6qu8UMe12qswUgIjir5ZtQLYw3TZC02oWKhSq6RGLIkrg8d?= =?us-ascii?Q?BI7Ej1MGzqb2tzoJ3lgbg/VS+9c411N92MHluGTNIWEvvtU5yXKJ+rSD/iLj?= =?us-ascii?Q?JYyIjgSiQveEC/WYsfOVRyVHX99Jqnlw+uxC2rs7MsQhXARUIQAbZ6exilQQ?= =?us-ascii?Q?dTNuudMWZEKJ61mO1JK7Px7ZmD8tE8WjOx4baraYxKZkEVLkbavvDuEUnEUP?= =?us-ascii?Q?IemS6gO920Dw4jB+4FY5Q0o3c0qwfpVTggACh7Swd7BgPH4CZEIwU8d0ZJDi?= =?us-ascii?Q?fwR6A/lxZwC9kNO2BekgYWHrjEM7EMRu24rKaiWcEbeTv7fbs2OOlPH+Xi5A?= =?us-ascii?Q?WJerfpYK085xadmwoDaF7i7ZtGSr2x3wGLg+ZlD06HpDEC20xbJfCzPbOJZ8?= =?us-ascii?Q?Vxxi63fdb2GDlPgSwD4Egoznv3QT1HW+lPtMbNDHrXMuQj9Mw/IWUI8rlr+O?= =?us-ascii?Q?IfMSR/5AZgh0LjdgMKsXH9/jorTn0FR+mBMyAn5eH1xN+8naxXosYnUoFCtb?= =?us-ascii?Q?fSuu0YFdLsj5IuihjHky1i7jbB+Fu/mkBaf5HVdjsTaWlPN97VEzguIKbXXx?= =?us-ascii?Q?UUEpSEYfMEyGxsDTi5U68tyM1EoOLSWAz/4L2VTYSFLcQst02Yxd1BNHukik?= =?us-ascii?Q?e8omoZe7G5Xo9IEKJpQRGp8a4A3h4685OcGpDt42/TtgUlkDUu3RnCvAkRl6?= =?us-ascii?Q?JMH68ZAT3MXQa+UeZoupWC7s4LJMR2BHsDj4UrHAJDACsoBlkHenv0nhrsq/?= =?us-ascii?Q?jpd7Kvcy3gUUqHTajg93WiZrVVCdxM7XDLGa9Vk51FmjG4BPdZsMsKJctTj5?= =?us-ascii?Q?8SdY0oPbwKkDTv/lJh3pbvscE6Pi9LqwMVQEFzBbRWg7qif8AgTpf9ypLjFL?= =?us-ascii?Q?qC0d8xPj+kilrk7r/os/qwOVt1NQ6GeHuH/cu5bUug67ABcEL3rr474wlUYs?= =?us-ascii?Q?BQ/tT18DeMEDLTyY8aDfnD6PSXlVhJECJj5xgHiJ+s1uwzNVJvMBdDtN6/yZ?= =?us-ascii?Q?2c5DKuNu27cHEaZSxToIH5x7EMiQyi+G+/GFOvfqKnsOla5X8ogZQQrngB5h?= =?us-ascii?Q?xp7UD+al0vdGQsipdYZ5Vgqad38O+6tbEBsT6C/5gWTrf8TAiEjnduDcJ3ec?= =?us-ascii?Q?Kj7jOgOsKVrukCHjFJ9OY9OfQGbRbqCCciJy2Kr72D6RUnzpMfIUtyo/NJjZ?= =?us-ascii?Q?Mao=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Kwkcu8nAI+qsTzzlYybgNe2cEDwHBE3rbF3n88dG0/C7ZUh2mQrJ9tzfiSo7?= =?us-ascii?Q?yL8ydx6gsRtY7bolm65Sp8GcxCcHMlIMJQHI9ySQdoh5I5lrICoTGIUJ2bVB?= =?us-ascii?Q?mnVtl7Fj1Ko8A4n/jbhUgVoH01j42UB4rFSwDhPahxMAHKrbu2qG/rkh4ta3?= =?us-ascii?Q?kt5IXpxheIaPnMwekSAF4qb9wryhzOvRyarAl1BpIoezalnSzck384mAwTYr?= =?us-ascii?Q?UmguG3OKKvWZAzrrq2y0VLs+YiIJSSY9fYidFw7ShfRmuHouALP5EO5baLDQ?= =?us-ascii?Q?YpbGI3arVzAsN8572e+8IzxgzmJTnoJL7qkPeHu5F9v8QM0E6bgRKBGYZSlA?= =?us-ascii?Q?AhMNpCyyJTgRcTNkEcqdTMpyxA9GE2HbiQchudUQzT+Tx5DWA06lDX77Vs6B?= =?us-ascii?Q?UteYqh4vRSbWfWpZ9WLfll79qrjLBXoxRiPe1lhF8XcmlAOD4lemPg96KHWP?= =?us-ascii?Q?UuEoAbvfte0aHzE/UNa+qSCA27dgXjjyK7+vLE9/pCCXrPef8oS6jj/zJeIU?= =?us-ascii?Q?QajftGN0XERsFTB0WbpJurs/5vDH8fwtH5P1bP99bY440w5sIwq2tnGBfALk?= =?us-ascii?Q?LUX0iz6b7BTYrrO3CR+GOPW2eo5sUpp9dzhGw60Y1b3MNqgTOBCUi/ruoISJ?= =?us-ascii?Q?yJmhYY0i03A0d+ZF3PrY9BpnRwOq52A9F8xGGZC9Vv4bW0ScbvX+Pau+/yJD?= =?us-ascii?Q?MRS2CFIIlGDihW7HvZW/ovN6p8jKRY8iJslnuo5BqbVVGsCycBweyH6dynJl?= =?us-ascii?Q?mQp01zcGn09GOE4foALEKWoMbiHMwFEzSk7XklknlXckyr4xB2yREw65bZ2L?= =?us-ascii?Q?ZW6L6VizzGWWVIPAqtIk+vAzF8YkUQYnkvFNAX+siPG3SEnElwN8XSwRwZBW?= =?us-ascii?Q?BpxbcqIKmWVAmFg4Qtxg8vl60T9KWAIT64Ho0/DPCmKKc/N7bis1aJ49i9jH?= =?us-ascii?Q?Z2GB3U9qzykn09Bc0WDIt13AAxVyq1Zh/DHh2EehPMiGbKFWBmYJAcBkuI86?= =?us-ascii?Q?mmxgEIK9YQT7dqOyIlV5oadT5zlP6coz+rlpsKPhar3cc5oiXyCN9Rf2jRbb?= =?us-ascii?Q?9c+2nPz0tLNpoGIKmwfTSqx51b8Rh5rKcxuJEWj3rg1KosJ2wtNdpIxLgeWF?= =?us-ascii?Q?t8tRHdCOfqLQLmqLbXFLvSxz8hyBOFzHXXW9QadHVVWqa8qe+UF5PJKWDHVk?= =?us-ascii?Q?y9/3kF3JJuOztCl+DREOnfOp9gaAF7+MWKCKg+ugdI4E46+Si2BVjqlziIWb?= =?us-ascii?Q?ScjGfyF/wXiDLxvk3UvDgQ+E2IMjvDYIoRSNYkHDt48ITOtMaR9CPa30ARxe?= =?us-ascii?Q?SYSR7ls3N/dkuoCMJMn9CHkfR0iCZvxM+MlKIK67t5kLKbBiYIpQU4AQ+Peg?= =?us-ascii?Q?lkvdmSSXE7tKiEdGj1hCrgk8pmnf7RMy+6BY/c3R20izKTaSQyA4a4+YrNeC?= =?us-ascii?Q?YrAkhWhSpB8OH+mfW6WmCW+lpR1hoW75LmFRX11R4+ONIQlFW8ZR7FGeZalt?= =?us-ascii?Q?1zuRgQbrsyypgQAUuRk3V6quIUiJbH1Y7wEsVudzaeUemV34XWskMlzJM0/j?= =?us-ascii?Q?UMcNs4ETIfQ+DnGk/Xzmcdfe81dBxx62AuVXlO7E6MkHf7czJDe8CsZK7qSc?= =?us-ascii?Q?2Q=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: HIGWv/xm1U6W9CfWIA6P4E2Mon7cJGYYaWGXp5TblZbRgDUVtAQX2wQdWzCnhYnx21xWIhG0vTsbxhC4tZHMherEYtSnYfIk1ev9FdBsFLkSYqr/5QitpixF1hGCJPh1LgLWPELeM6jRTFOnDyPlUJHQrzLPTeU1d/klbecQ8udHPayQTfOPhsj3C2R0MWP1odGaoDHx8qXSHQsDO2jA5Kq949EFcWuV43D1dGEIU+NCEsB1c8y3u1LC73Mk0JlKdyaBWO7JL5kYJyvAtyVa1gZXS1VfPPF/zzzEK/8QdVP6zADAnXPWJynWqhGXknwMx2WUu1Df19GPSukecZ/zt9C+5DaJ1i4CxVYuTK86SSStL5+2/KJw8scV7P17VSsIycf2xJv7yVXSBMlk71Z8RZh6nkHe+xqy1RS8VBakIeKswf0EUSRHoE2kS7LNhD16kG/Ad31HKL7cDvgO1ziGwD305oCcR52KwBuy7tUiuchofLZbpEfxB6peJ3xqotXTy3p4h7RiRGquDzCsnQLppjfeh+f6sORBscMWBJJBV5SZe+4PIAUBXWsTAgBfjjrHes2UBBfKlBGt/F2PFNS4ueuhuHuP4bL6kRB1438Ui4A= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bca9db8c-87d0-439c-5148-08dcff5fa1ae X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:58.0985 (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: 2sMZfgTFZxtVnTX56hkvD2RHeB70+o7S1t8NW1pGweB8qLmuVChcbGCJJpiAdIS7k3pEVrebB3s3Zx2MTOdCL2Cvfu+DAZ1sev6im2Q3Rtc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7037 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: lnBww-DGDsumJYMSR3YzDvrNzQ9WGIfl X-Proofpoint-GUID: lnBww-DGDsumJYMSR3YzDvrNzQ9WGIfl Content-Type: text/plain; charset="utf-8" Add architectural support for the cpuidle-haltpoll driver by defining arch_haltpoll_*(). Also define ARCH_CPUIDLE_HALTPOLL to allow cpuidle-haltpoll to be selected. Tested-by: Haris Okanovic Tested-by: Misono Tomohiro Signed-off-by: Ankur Arora --- arch/arm64/Kconfig | 6 ++++++ arch/arm64/include/asm/cpuidle_haltpoll.h | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 arch/arm64/include/asm/cpuidle_haltpoll.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 43762c68e357..bd00647f6013 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2428,6 +2428,12 @@ config ARCH_HIBERNATION_HEADER config ARCH_SUSPEND_POSSIBLE def_bool y =20 +config ARCH_CPUIDLE_HALTPOLL + bool "Enable selection of the cpuidle-haltpoll driver" + help + cpuidle-haltpoll allows for adaptive polling based on + current load before entering the idle state. + endmenu # "Power management options" =20 menu "CPU Power Management" diff --git a/arch/arm64/include/asm/cpuidle_haltpoll.h b/arch/arm64/include= /asm/cpuidle_haltpoll.h new file mode 100644 index 000000000000..aa01ae9ad5dd --- /dev/null +++ b/arch/arm64/include/asm/cpuidle_haltpoll.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _ARCH_HALTPOLL_H +#define _ARCH_HALTPOLL_H + +static inline void arch_haltpoll_enable(unsigned int cpu) { } +static inline void arch_haltpoll_disable(unsigned int cpu) { } + +static inline bool arch_haltpoll_want(bool force) +{ + /* + * Enabling haltpoll requires KVM support for arch_haltpoll_enable(), + * arch_haltpoll_disable(). + * + * Given that that's missing right now, only allow force loading for + * haltpoll. + */ + return force; +} +#endif --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 7216821F4A2; Thu, 7 Nov 2024 19:09:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006584; cv=fail; b=jlfafymkNtg9xD8e/nJpix9x50MGKWwhWQftIEHN0b1jrAZZOK+8R23GfKPcCrogjolsktSfReJW14fmmzbb/05F6JYG2p13VvecV0XA7vRCAQOf0L1eLBZGlINZqU+Ss9GR7wk1lHTyYBvCk4V0B38vpohoRzKOt6HNOBefUgQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006584; c=relaxed/simple; bh=NFQAxLEueiXIS9IF5F2KOhCX5nISajYBQNj8JAthBOo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WcqrWM2V7S5ANMGs23BojTTZCvvq0Z+uxFhIXVcjV7g0OCuUKlctnMsrB66xdaLgfspvnW2tpDsy8bwmnPJ4tAY7hCH3OnG3ujkHgWg6O/47Ec/pdxxZjepMOdASKCXoMdCDMxK3ZBhck0hlPAdewzC3doW1qGYyiRw6u89MKFk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=UBpHY7cc; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=tSU+emuZ; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="UBpHY7cc"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="tSU+emuZ" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBfAa029219; Thu, 7 Nov 2024 19:09:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=JRdc721AdJuu/iQtWTcIC0D/C8doc1qy09Cu9dA5yCs=; b= UBpHY7ccDjoBdafhsv4VKv9XG5U8Dj3zIlJ0O4ftUEr+dN4IipCYU6ceG9vXcLR/ C/xqWFG7tcTrV6JU3I121kG465npiS0T6nFRx8dg5NrLA+CXJSv0hovMVOhKQOke FVPZYZroe+3d19Hp5006mcE1rFIlBZMBHvXl1cTHOnDSnTZANFH3fcBtsn3fH7g4 MXypC8cn7rJJ1jWJ57gEeNSj7n/MM92ul/+i5LIhbUm0otF1JxiLsQs+G7goXlky cz12aIR4XoYWfm2yftPR6wZzjYOIFTcW4FXiLenUcbr8xUpxIfODC3rVG7E9u72W GXXALKIAx1noZPRKxrz8hg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42qh03efga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:11 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7Ho2IZ009141; Thu, 7 Nov 2024 19:09:10 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42nahgt646-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kb6hMV5acQBYf5jgoG5ZR6GV64+hS+p0gHPWR2f9afteijgHgxo7GaLtJZR2tdxBDcbMZElZ9Qcu/ZmyUAGHY1NSDSWGiWr+6c1lzglbiKDGtwz0aKsAIO9Hoarivbs1QzltqnCAENZTsMs978hCPUzT7SjQnYdH42ketQdKrtTADihv+2PxtChNDxhG57Rb81Wull7qdo9V04yE9zAk4KZjdgKMSfciirH/dxxMvqnaOLp8AinRGB/xrmPBpDMiHeEfErPGIzp7H6IEuw36LGVO53ZSDbpHzI18og2/pIjjlZ3JRg9BBbKGNiju5zrJafcYWhgX0CGc7jNJm0aa7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JRdc721AdJuu/iQtWTcIC0D/C8doc1qy09Cu9dA5yCs=; b=ClIUvPOX3xZOfTlmmOsM3x01urtWju9BVp8qoypxoF7AHuTTHa7Q9HKDhcQ7ov7b8VVYiZege6tQrXwCyr9vLWP0Ho0V648lkesI3ZuVDjLOFgI696qRPo3SP1bAUe8qBBDQEnWhCbax76tgwh7AjZcWuPAXDK98JWBtH7AV9YBg/1dyYp6tc1v6wLBTra5bOZxL1baQb3aZ5pjMDsRx/Vx21UurGTEmHanX1ducEJ3gXw1gxeclejfU9H9SLvcgnBm9ghEEgmxyBEt0qvDEVUmQAPMhUOWmqyKsiWAMKltQasQluM7EfSaPSnfv3x6QI+pw8zd0qdKGFsfV8PHV7g== 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=JRdc721AdJuu/iQtWTcIC0D/C8doc1qy09Cu9dA5yCs=; b=tSU+emuZPG3Jdn+A5KrXQ1TOqdciGrcu76NZ5UiEDF87GGyd75lEd/I62+p1MrSE315FWXkhmwne9o2EwKGAlg0kDsnfyTQvtuEBN3Q4vhNW5C/7QpLsmpx6ID+Uh2AsVlka4WlxhlX+wQV1qwhU+8kdN6qRfr6XLWZgpkSsPvs= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7037.namprd10.prod.outlook.com (2603:10b6:a03:4c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:09:00 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:09:00 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [RFC PATCH v9 14/15] arm64/delay: move some constants out to a separate header Date: Thu, 7 Nov 2024 11:08:17 -0800 Message-Id: <20241107190818.522639-15-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW4P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::18) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7037:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b99ad31-b75f-4263-b685-08dcff5fa2d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?0HiVPkCu9esO3NbmATu7A3/YGgI1hYtLLr6FdW9oFV33egNler6pAK3+Q9Cu?= =?us-ascii?Q?cZqczSZw+w5uvTq3tOeNTfqiA6l/7zfbpSyqsDgsYALGVJjF2+u0mi4SPNfa?= =?us-ascii?Q?gCW0ijTFwokeapz22cmZZQtuc9/eB0dCWJeoUKPlovwA+VlUwriQmgZ2K99d?= =?us-ascii?Q?DBCIstm5rLfFwz0AhC8NqgJUGMne1FpFP7D7oCJWX25QqYaCb+5sMA42T/eU?= =?us-ascii?Q?NHLJEi3FND/3i4SaCZRJGmR4KtN7qx1uf8Ebo6jlcsNuGNVbm/Y1m8C0ENrT?= =?us-ascii?Q?BJbDhjW8K08T5HD0lQ1etisn0OVILx36B3DJUrY8XQ/Blv5OIrTqxepy65pL?= =?us-ascii?Q?WvZQhpH4FzwyWJ7wu/s5jL5zTczhMuEVdAKOkliy7uyNVcNmELhcsYIJdM6Z?= =?us-ascii?Q?DY7JH1eEKBbT6///C7KAo8GPbTjJN5wYq6nAc7y5XZk15O8eoYLJa3tR3koI?= =?us-ascii?Q?Jin5UROHENlPn481K9tfroeMZ9/fda5VwFjHzji8O2o1ZZWcS7CLpwZhUTcj?= =?us-ascii?Q?Q9RfvSXugnB0LjROit5OXofO927xM9TbAT6+w22u5i8zXxmFvOrJHWYGJhJp?= =?us-ascii?Q?JprC7pn8Wosmn3rWGAf25wIxLZdq/3uBE17JBxOW5G6titQSSDGQ2EuWSe0f?= =?us-ascii?Q?nxYZsJvxfgag55OeDyAVSsk82pkjhIOFw0EixPpmOEdBpA8aYfeJ0fqFLJgm?= =?us-ascii?Q?9Dch+HJQ8U8m03qrzQU5td9tGjlqYIGn4HD/1PVs3XCbwUQ/l7EO2LYF0g1T?= =?us-ascii?Q?Vtjt8b48VIpDNnPEqrL/NvsBTnvDeuMpenlnq3q8ht/NOPxOywg3e+Ch8Ojt?= =?us-ascii?Q?u0szJ4NlfioJ+f5CeJLUs6qGLFN8/XjI5ZiwCxUs4NymHENwn0zDoinQG5dZ?= =?us-ascii?Q?oZ1561fhQqIpuM3SHC9SRJnHAqLWbaZb0sD3usoVUgHG4Y9D3EXbBWVUVDjb?= =?us-ascii?Q?j6tuzSsxJ/yPCgPR4uAyiQ/iC1fs/U+cC7F0wrhEcYeX4q8RNKA2iMCzGGHw?= =?us-ascii?Q?KrXecnwbnMqy8XmTYSEpSdyMd4QCOo8mG12+s03hkLqeLakhLxnefr/Co4d3?= =?us-ascii?Q?p11Piqp+1ZviX8Cl2nePYuQX4dwmnGCGTLwcg/Ky8UYob9Ayhf6yyUEjkNU4?= =?us-ascii?Q?sqMXnHrYSgrPW34FS6EAoqdb1BkmOS8Ysmjj1Pp8LuWvIQmlL9h33lb1Sb3Z?= =?us-ascii?Q?i/ibDgj/WGkYChNUmQDu5cnEgVD4+5TrDzqwzgIqaKdkXtteGTIPyVeKAI7O?= =?us-ascii?Q?9NXaKzaf5tRXbPx+Qg143KgsFz3icBAnwZ80mQVWKRHCWxrjo1Rcl4N6rk8Z?= =?us-ascii?Q?7SQ/8w5JKAUERnkdtkTbs9QP?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lySE2DVzf6OZX8xCmOhynJulAAzzmVTQgMxj1FhNrK4E7VVzoaZfb7HUFJYA?= =?us-ascii?Q?5a1JhErCtA1IPfme97eDPCtdUVwadOKt21LybjFtvXwD3DdV5+RRxc7koGPH?= =?us-ascii?Q?So6yP+1mMrZRs51fyApjGs7/yTslGf3v2mBpeZ+qLVKOiZsKrW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VDZwJnbnGfNVkq5WmzR6FGHrCg9cldy7J4c3/goY?= =?us-ascii?Q?DecKXSjijxzW2aSY/La5wdt+eywEsK0n8SAnDwrQ87O9hjgBRf3PrL0OI/7Q?= =?us-ascii?Q?fRO6VA8yS7Ho0rU8kloMmxro04dJdtzh6mvXMMOUtMG3d+t5y+sNmd5q+xEA?= =?us-ascii?Q?Qnv6vuNlcRKV/5KjsndNFsMim56PIjqHEDbkoRMpxpG/y5FSQ59MpwA2FnEs?= =?us-ascii?Q?fcw5gLcaAnIXuLIqx3yi3mgaeRGMmQ1zQynZXjbo6C6a3h4DBDF21CfM7JRl?= =?us-ascii?Q?xmXMJyrsPBptyTLIM4Gba7KTHQ/2MWqCUKl1rjpOxcRzSWr44pRfAXzx0E0t?= =?us-ascii?Q?6s6FBHSweXGqoYByVdkiHriRdFrcfBm58vkx3qzNOC1LZuVK8EPkUOwTWgeJ?= =?us-ascii?Q?6t87CYKzb90aFVBbi0mTOj6ZbyaD40rmj/yWMvEPuSDdhej43b+bBTSVS+MD?= =?us-ascii?Q?3XMW+2s6cPUv1QISfbHOJOMKn0NDtvryqHN7zD5HkY2huHDz7DMfdmmQpOuo?= =?us-ascii?Q?QwwryspL28dc6Nu1SdV0+UE4bNqPKqVbbub7ePo4PIOTNJrWjLdvbsAEDVgv?= =?us-ascii?Q?9Q=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: BBCZ0WwbmgaDjrHg7xlnI4Rx0Lj24UXEzyCxm3NuuIJxo0IY0hSO6QqtobLJWqysD7bN8fonxL3OAPP8B98QcJZ+oTUS692lC5pTGiYgs22EVv+vE1jlbou9LO7bNkr/KTvMOym//jVOWmnv4iYgKgAByaBY4qZA9BeZraSimzmpmV1YIcf+s7Dfg9nWxofMo4Gnj1lHHmUwnUp1ASi6c1jtHUrFibCQgnXjA0xfDeRbg3LUINTJYgNSf1PWWVQFumL5QbxVZ9QLiMJyYRm/BinIqMB7DtlSdvxhZTwY6+QXwuKByQD6DWFCNZ9pdUxboEfL99z0rBOsNUMhQ5PmRLQYx2BYhWwCuS5lLujiVwUa6qwemve6WYXdsvA1a+CRNX6vEjm3XEcS0Ky8BawEqZbRJV24RZz2enNbiJNKb9e33yRbsINHybLhbs/fl2xN8EqnUL6WanNjfV+e6vuESf1jfnRdhgfwSFhJXnB6ZDjAUkjr5FNVdYCUy1YiTFdaZYJP1cm22J8+Kyogd4ekGHyOEAMfuc9be6F+YTDSPg1jefwJVeRr1ebxPo6+vL6LCNWCZ0Qx+noAWwyPcdHY9/0lD1jQmeBB/8wNwBtDNcw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b99ad31-b75f-4263-b685-08dcff5fa2d3 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:08:59.9894 (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: Due1nKfOIkfQz8sw3Ve2sVCCQZVlUqbqi3DwT0BhbjU6qVxJhgmlNZ1GfMoI9xyY4hYBqkLMpMNBeQ4cYz0UDYQzXugrVZz/SW8bpr7FmJI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7037 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-GUID: 4PjqjIBRC43LNInZQ5n8z8bOg8JeVw1P X-Proofpoint-ORIG-GUID: 4PjqjIBRC43LNInZQ5n8z8bOg8JeVw1P Content-Type: text/plain; charset="utf-8" Moves some constants and functions related to xloops, cycles computation out to a new header. No functional change. Signed-off-by: Ankur Arora Reviewed-by: Christoph Lameter --- arch/arm64/include/asm/delay-const.h | 25 +++++++++++++++++++++++++ arch/arm64/lib/delay.c | 13 +++---------- 2 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 arch/arm64/include/asm/delay-const.h diff --git a/arch/arm64/include/asm/delay-const.h b/arch/arm64/include/asm/= delay-const.h new file mode 100644 index 000000000000..63fb5fc24a90 --- /dev/null +++ b/arch/arm64/include/asm/delay-const.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _ASM_DELAY_CONST_H +#define _ASM_DELAY_CONST_H + +#include /* For HZ */ + +/* 2**32 / 1000000 (rounded up) */ +#define __usecs_to_xloops_mult 0x10C7UL + +/* 2**32 / 1000000000 (rounded up) */ +#define __nsecs_to_xloops_mult 0x5UL + +extern unsigned long loops_per_jiffy; +static inline unsigned long xloops_to_cycles(unsigned long xloops) +{ + return (xloops * loops_per_jiffy * HZ) >> 32; +} + +#define USECS_TO_CYCLES(time_usecs) \ + xloops_to_cycles((time_usecs) * __usecs_to_xloops_mult) + +#define NSECS_TO_CYCLES(time_nsecs) \ + xloops_to_cycles((time_nsecs) * __nsecs_to_xloops_mult) + +#endif /* _ASM_DELAY_CONST_H */ diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c index cb2062e7e234..511b5597e2a5 100644 --- a/arch/arm64/lib/delay.c +++ b/arch/arm64/lib/delay.c @@ -12,17 +12,10 @@ #include #include #include +#include =20 #include =20 -#define USECS_TO_CYCLES(time_usecs) \ - xloops_to_cycles((time_usecs) * 0x10C7UL) - -static inline unsigned long xloops_to_cycles(unsigned long xloops) -{ - return (xloops * loops_per_jiffy * HZ) >> 32; -} - void __delay(unsigned long cycles) { cycles_t start =3D get_cycles(); @@ -58,12 +51,12 @@ EXPORT_SYMBOL(__const_udelay); =20 void __udelay(unsigned long usecs) { - __const_udelay(usecs * 0x10C7UL); /* 2**32 / 1000000 (rounded up) */ + __const_udelay(usecs * __usecs_to_xloops_mult); } EXPORT_SYMBOL(__udelay); =20 void __ndelay(unsigned long nsecs) { - __const_udelay(nsecs * 0x5UL); /* 2**32 / 1000000000 (rounded up) */ + __const_udelay(nsecs * __nsecs_to_xloops_mult); } EXPORT_SYMBOL(__ndelay); --=20 2.43.5 From nobody Sun Nov 24 01:19:43 2024 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 00C5F21F4D9; Thu, 7 Nov 2024 19:09:47 +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=1731006589; cv=fail; b=Psfac6ZbxP26XP3W+fHI32GHLrFLRfppFh8kH7F2R2PrKsTGs13wcxSmQtLNb0gQH76na2ou9nkTib15uP0PSOcG/jh1610UxVGZzwyz3TrUVkTYNTiSaQUxphJel/9HYx+gkYsNU0lwp/Wk1v6A+ggWwIWD80YaiNpuvzPFWrg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731006589; c=relaxed/simple; bh=MY1WUyiG3MlGsF9zGtV+TOUyfeJkWNCFZTQDiZEjs58=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=gGP73ZEbG+hjCBw9GcBA1o9HdRNLB7oJU6kjzPgSsXP1RrxcWB3Pm1mn3edxc2nYp8mcUunxFQFgAL73RBJ0MWMNrmbp7Vb6/34kDBXj7Gy/4aySPiCvFLgds6px22aYLrhp/OS2MBwSWpRrdNgV2C7noUxUSvGSMDYVjcEojhc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=ak8pQiLu; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=u2Ubfc2s; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ak8pQiLu"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="u2Ubfc2s" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7HBZ9u024688; Thu, 7 Nov 2024 19:09:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=KCpMsJmZCRizv1HK7VHHQLxW3ArzQmimptLDQTbndr0=; b= ak8pQiLuJbvexQ7OGSN7ay//bTPfi+pOQAPjXleZkndcESYLSFc6+nMyoGdZu+Tz Bq34nl46WySsQYd352MqYukJ0Mw3UFmZVVL6xIyBpfB4WW+SAvTfzFUWrTIWUGl3 wrhTO4VOA1d5AMgtX31EpWOPPkthP8TgwoDMd9brjuBT05Bz+4QowHHRFg5zsWB0 EeOKalGchOpdstxWTgzoORQ+8aK0mPGLcfsdDVfN8HDRnxSS5G76aM5Uwc8wk8T8 zvQaJp9STz+Sne3VJ9iLsEcxHnZtCQiUx2ayLzEaW3KnXiBW6ExaJVb4/7vXnzQQ bpric7OnZT+VQMD2OKeozQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42nagcbc1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:15 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4A7I2sU6008426; Thu, 7 Nov 2024 19:09:14 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42nahaercn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Nov 2024 19:09:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F9rrfYFLjxt50I6Lmac5FiP8uUFY4kHBI4saKamlSIvPa4OyNkVedw7EbzGZE7SuuK8GOEd60B2jX6viduVKFKAbJxmoBPeVXppMf84UpM4FucbxmXniQ8vEUA4Xvc1VfDZvzwJXClxSSc25rdyRMoDUgyF9N8BfGwGDtyYr/fhcHcdiMtgOQNI3oPzlxAAmfRQ/aT7wSUfQ0MxQC6Rw1CuYPMMy1Q+DT1XIdKBPIBb1CQW+zAnmGimuVU50wCgAA+ur0RkCX0810BRQzQkU7xVyHuxh6WL3O9ncqZ2x7B7byDgwSCiH0LYvt/Ipa+FSRlMvOro5UkyszsCyJ6Mh6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KCpMsJmZCRizv1HK7VHHQLxW3ArzQmimptLDQTbndr0=; b=hxI2a9pG9ieIjQvo84I51gv71esLa9MIzTts5dG17lQxYzrFOx8m9gPpMoi1irgjkIu/fdjbHnjqI/NaqN4yQpJ/n+xx2h/qzXOVJ1YD1erp8xpXlSyxllzhOVgu3wVatXFgR+6s5rKpizNdNLvGF+446mbFvNfqEvehreddUbxHQwhHkomM/tkNCjgrprl08mUBCKQaXO02wsdzhMB8n6GBiuhk4IufET6acQQDec0Wr7z6tM2ko8V4J4WmLGB6J6ARCGsXUyV22jCuD0ggR1GzlIckZnL6vny9Hvuydlo0WwsLX3jWOf+JUXe0hBNEeDCM/A3DXj+5jyHD2U5/Ww== 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=KCpMsJmZCRizv1HK7VHHQLxW3ArzQmimptLDQTbndr0=; b=u2Ubfc2s1wjtYcJ5MeuuDHFR31s4X925cKVvHpI4MB7xOwMuViYmCEvRos8nJ9cP3J9HTWhO+AVrm1b5Pcd9Hu4noseFP8wk5/sOHLlQ3cNb0Iei5b17B/AJi43TuNegy8D5eoHMKBl1CgzTpn7IBNTYnv2DFi7QJlqOe4Tx2tA= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by SJ2PR10MB7037.namprd10.prod.outlook.com (2603:10b6:a03:4c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 19:09:04 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::25a9:32c2:a7b0:de9e%5]) with mapi id 15.20.8137.019; Thu, 7 Nov 2024 19:09:04 +0000 From: Ankur Arora To: linux-pm@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Cc: catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, peterz@infradead.org, arnd@arndb.de, lenb@kernel.org, mark.rutland@arm.com, harisokn@amazon.com, mtosatti@redhat.com, sudeep.holla@arm.com, cl@gentwo.org, maz@kernel.org, misono.tomohiro@fujitsu.com, maobibo@loongson.cn, zhenglifeng1@huawei.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: [RFC PATCH v9 15/15] arm64: support WFET in smp_cond_relaxed_timeout() Date: Thu, 7 Nov 2024 11:08:18 -0800 Message-Id: <20241107190818.522639-16-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20241107190818.522639-1-ankur.a.arora@oracle.com> References: <20241107190818.522639-1-ankur.a.arora@oracle.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MW2PR2101CA0024.namprd21.prod.outlook.com (2603:10b6:302:1::37) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) 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: CO6PR10MB5409:EE_|SJ2PR10MB7037:EE_ X-MS-Office365-Filtering-Correlation-Id: 5438fedb-214c-43a5-5b82-08dcff5fa5b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?hYAWn1pUScq8HbbTR9vmDOBVkI96IXbZtC821AOvfX3hk52tctCxEcUrHKbb?= =?us-ascii?Q?J+mky8fqdA/Mx2/o64BW47TTtzd/C9OYxQUzeUJX9Dl3q1ybNUN0ZvqVFtzp?= =?us-ascii?Q?GPBHlv/YV+zwpzUAJJoJ4s2GxxIZ+83BCMl+lqZs0O1UbZUoBnnsyck7Et5X?= =?us-ascii?Q?o7I7Vm5/8QK+ImI2nAMUKYJngNXrRKGvLLZVXDhDy06IWWlJ9Vn0RNnRm783?= =?us-ascii?Q?zuEI1GHVZwdSc3TiqJaaKN5JhjPPexo4VVFYOIpVJQ/CCj5MRPOFMCa38oLw?= =?us-ascii?Q?GMW1tTczIjzsoM8ivdc0aMnpmR6I8FR67qbmiXZtLnsj/fEkcDWerh3VlZGG?= =?us-ascii?Q?qrwe1AULySHpy6VAvOWnt5rvcACEJBlkeaYvBZipioRMnFYX+hp4m2I7R8if?= =?us-ascii?Q?RUOhhZBMRyAc6XrpPpPzZdkH/5hdh5mYw0R5XjjU/Th6Jnb+HN7mN3maHNWG?= =?us-ascii?Q?3QYoo1knjcdX8Yk2gwRs0B3RiVMNXAeAkzsbKUg/ZXlQErl0+7Z1HujA7Ckz?= =?us-ascii?Q?5k/UM1rGwoLsB60NQVqO1lG9dFAi6MUGtzjlvkIJNtG97s+LhZ7Go/z+O/Rg?= =?us-ascii?Q?AmlqEkfcxS69o78bAAJHFraq9meSPuDgQkyOdTWKzMrmlovRVW9CrvH8lRSG?= =?us-ascii?Q?A8WWIjii7N0K5bIAG6rgI/6Bo0Kfc5WasYtqBAB2pOqhDxLflb7IPmruuvJ+?= =?us-ascii?Q?wsAzA/fMh3ihm6orvHyraYmqJFq6OF1g5bf7TkpCDok+QDf8eF4G4Uf0zMv8?= =?us-ascii?Q?wMxjiGC2JGdTo+K3EN7bZDaGQmciabDgNuW9Hia4XUQEsmuF6EF1lISsR3Bq?= =?us-ascii?Q?JV4h2yiN8Mo+ceKvqFflbXInuo/dWCeTh4Jvo9dFhrnWd3J0vbAhDU4sNqsC?= =?us-ascii?Q?EwDWfILdMsN463JFRahfmPLEWj/bBkweud6Wezn33k0EABvWkyb8IIZlYcEe?= =?us-ascii?Q?8ri6GpBJ45T20XAnkGuJdMBR8xjduEgCMxpzcx1seouWnIBpkmC+MHvigsLW?= =?us-ascii?Q?+XDc17fsjKTorLZg6h0WpjWOV2QUyN1VJM+6aXNPlyetmT8Emu/OMYDhCJSh?= =?us-ascii?Q?pG6Gc9H5L0B3LxELQ6pNGW+rTW8zG8bxHZv28Dz8E2aVaGpMFnsxa8pWdpgP?= =?us-ascii?Q?ZcUNOz+kaROqvKh8tiGi8bUNPY2qBUomZbIsegga/a9bo9TtVmJK4F+84qyA?= =?us-ascii?Q?QMQC3ipwmY8xRHSHPDAuJJPRinnbrrTI+4aHyj/fvn3Ju9CDTp5UJy9320rv?= =?us-ascii?Q?9S75HiNuRCABQoqoNibjWk3eyR+yIR25/kLPdfi+KDRo7HcwEC++yHLzwfRq?= =?us-ascii?Q?IEo=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?boZVpkwl2LPYemiwlo6Un7QLeWzOxOOZzhp+CE/8SGEN9gGVXMBO8Fl5tQ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P8KnL8/7kscrqBIzqkIlAfuIxLZpfMtWHIL0s4Mh2V5q9t?= =?us-ascii?Q?BvdMg59or+NMbvKuGQcUqP+PJl3r/X4i0bcHXmLS3GUEWyndHrBYVt6vm9Eq?= =?us-ascii?Q?7auVFfrXaU+mrKiF+ij2Ly0zUtY6/zTwDnVsHASffHRHuDu19HKRFVdnA2au?= =?us-ascii?Q?rhs8nQcM/O6TP2Ppv4TUvdsLXYhK9eK8uj/43P4xSWW5i1FmYET7IFiSk75V?= =?us-ascii?Q?l70K1Yxi5hXKi6UYXoS7dneuIfDdl3cnDoJm981le8Aad9eyBJpJ5NA5SBwH?= =?us-ascii?Q?FYxYcWj0176AnL7zFdcm74atvIHsrO6I1H/Na2n6exzBD6igZAw4H+7peSZp?= =?us-ascii?Q?C6tR95eYI3jCqcF7ZMtLUrqqFf96Q1/SgwyKNFjzbv4C4SNglllaO+xoz1Qw?= =?us-ascii?Q?Vz3JsRWVKckz6ZHes6d6n4Lhm3+ZU/tzyDflJusA65gKBr4Dk1gyIS5dqNJ5?= =?us-ascii?Q?UXGOcTDoCtKJRQJdFcgPLRxxTPveDIJrZFwhsTN0RqoYTig02wkGGnIFYM2S?= =?us-ascii?Q?jiXaxbeACcrfAy4rwKow6lftpmPwafrZm6MZhtj/BOYLVOV9LwWZrwFINNQW?= =?us-ascii?Q?tySsU/VUZv+U/jnk7klqjAMmYdNvyjPGqETdnpzJnY2CKLtAws3JafYgWp+L?= =?us-ascii?Q?4QY12HzDr8XyOJbr1ml29H+NpTXAPUC9HeLPf4AXNf5+BZNuRaUH7Xvjvkce?= =?us-ascii?Q?uA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: QqHW91sCpLQub1GK4qI1X9y586EIPiou+54IfagUSB5C6WJ1wPWeUFVTHnXPPn1OCZeoLH3kOqg3eXfYgU6VZa4GI9mOLGQUQ/Fk2+HMnHorC2t+FN2U+Thvl/KX0570rNQuQZjDrCHyi5VgJ3RyrOll/0W162L4H/4PK9j5MEqWanpWQuo6FRAKlOQlAstIc8wtWDNEsuBF0xyuTUOBMFsw+hPnnlut9FULweuNWxAVQw29SZ2BbtGktmRUzPR1lztsCySxJTTmzRdJQuvVDbaA/oNr1LcAaMe/Ohp1o+aMysLLgcagHzd/hEfBi5DY8lFh0b/HXDbAYDU0VABUovprpqEThVNsO3bMLTY6kD0RYyh0s4+Ho84qoEqrnkTQ08aL8U2jG/VzfWT6xBfMP27DQH4iTsqsScLmAtN6tJL2SnF48MRTdcgH8prdjd9C80tX0fUXZ+0Gx+ro2etiijbcavX0RecPprDVIE4HhArKsCg4MDJrrP16FGC3COyb6fM/0JF3wLcsySsTK9mncWbZHISoBgxqOE0jNox2HbA8/hHNy1ZKLL+0aPrK/EuUKst7QwWkvwL6MWMcj7HOlPriEqG5WUv/DquhNP67osk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5438fedb-214c-43a5-5b82-08dcff5fa5b5 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 19:09:04.8340 (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: NbwoBMTYz20pQQaaVXIOp7NSO3VmLObnk9tiltkb7ZtHh78R2Bm6fn1exkzKAaaO/wNaSjspjB58afVmMqR3LxmaikouolYCuNR9BC5Aig0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7037 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-07_08,2024-11-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411070150 X-Proofpoint-ORIG-GUID: iWoBOumy3YHu1D3dDDRF7lMFulrb7bHm X-Proofpoint-GUID: iWoBOumy3YHu1D3dDDRF7lMFulrb7bHm Content-Type: text/plain; charset="utf-8" Support a WFET based implementation of the waited variant of smp_cond_load_relaxed_timeout(). Signed-off-by: Ankur Arora --- arch/arm64/include/asm/barrier.h | 12 ++++++++---- arch/arm64/include/asm/cmpxchg.h | 26 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barr= ier.h index ab2515ecd6ca..6fcec5c12c4d 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -12,6 +12,7 @@ #include =20 #include +#include =20 #define __nops(n) ".rept " #n "\nnop\n.endr\n" #define nops(n) asm volatile(__nops(n)) @@ -198,7 +199,7 @@ do { \ VAL =3D READ_ONCE(*__PTR); \ if (cond_expr) \ break; \ - __cmpwait_relaxed(__PTR, VAL); \ + __cmpwait_relaxed(__PTR, VAL, ~0UL); \ } \ (typeof(*ptr))VAL; \ }) @@ -211,7 +212,7 @@ do { \ VAL =3D smp_load_acquire(__PTR); \ if (cond_expr) \ break; \ - __cmpwait_relaxed(__PTR, VAL); \ + __cmpwait_relaxed(__PTR, VAL, ~0UL); \ } \ (typeof(*ptr))VAL; \ }) @@ -241,11 +242,13 @@ do { \ ({ \ typeof(ptr) __PTR =3D (ptr); \ __unqual_scalar_typeof(*ptr) VAL; \ + const unsigned long __time_limit_cycles =3D \ + NSECS_TO_CYCLES(time_limit_ns); \ for (;;) { \ VAL =3D READ_ONCE(*__PTR); \ if (cond_expr) \ break; \ - __cmpwait_relaxed(__PTR, VAL); \ + __cmpwait_relaxed(__PTR, VAL, __time_limit_cycles); \ if ((time_expr_ns) >=3D time_limit_ns) \ break; \ } \ @@ -257,7 +260,8 @@ do { \ ({ \ __unqual_scalar_typeof(*ptr) _val; \ \ - int __wfe =3D arch_timer_evtstrm_available(); \ + int __wfe =3D arch_timer_evtstrm_available() || \ + alternative_has_cap_unlikely(ARM64_HAS_WFXT); \ if (likely(__wfe)) \ _val =3D __smp_cond_load_timeout_wait(ptr, cond_expr, \ time_expr_ns, \ diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpx= chg.h index d7a540736741..bb842dab5d0e 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h @@ -210,7 +210,8 @@ __CMPXCHG_GEN(_mb) =20 #define __CMPWAIT_CASE(w, sfx, sz) \ static inline void __cmpwait_case_##sz(volatile void *ptr, \ - unsigned long val) \ + unsigned long val, \ + unsigned long time_limit_cycles) \ { \ unsigned long tmp; \ \ @@ -220,10 +221,12 @@ static inline void __cmpwait_case_##sz(volatile void = *ptr, \ " ldxr" #sfx "\t%" #w "[tmp], %[v]\n" \ " eor %" #w "[tmp], %" #w "[tmp], %" #w "[val]\n" \ " cbnz %" #w "[tmp], 1f\n" \ - " wfe\n" \ + ALTERNATIVE("wfe\n", \ + "msr s0_3_c1_c0_0, %[time_limit_cycles]\n", \ + ARM64_HAS_WFXT) \ "1:" \ : [tmp] "=3D&r" (tmp), [v] "+Q" (*(u##sz *)ptr) \ - : [val] "r" (val)); \ + : [val] "r" (val), [time_limit_cycles] "r" (time_limit_cycles));\ } =20 __CMPWAIT_CASE(w, b, 8); @@ -236,17 +239,22 @@ __CMPWAIT_CASE( , , 64); #define __CMPWAIT_GEN(sfx) \ static __always_inline void __cmpwait##sfx(volatile void *ptr, \ unsigned long val, \ + unsigned long time_limit_cycles, \ int size) \ { \ switch (size) { \ case 1: \ - return __cmpwait_case##sfx##_8(ptr, (u8)val); \ + return __cmpwait_case##sfx##_8(ptr, (u8)val, \ + time_limit_cycles); \ case 2: \ - return __cmpwait_case##sfx##_16(ptr, (u16)val); \ + return __cmpwait_case##sfx##_16(ptr, (u16)val, \ + time_limit_cycles); \ case 4: \ - return __cmpwait_case##sfx##_32(ptr, val); \ + return __cmpwait_case##sfx##_32(ptr, val, \ + time_limit_cycles); \ case 8: \ - return __cmpwait_case##sfx##_64(ptr, val); \ + return __cmpwait_case##sfx##_64(ptr, val, \ + time_limit_cycles); \ default: \ BUILD_BUG(); \ } \ @@ -258,7 +266,7 @@ __CMPWAIT_GEN() =20 #undef __CMPWAIT_GEN =20 -#define __cmpwait_relaxed(ptr, val) \ - __cmpwait((ptr), (unsigned long)(val), sizeof(*(ptr))) +#define __cmpwait_relaxed(ptr, val, time_limit_cycles) \ + __cmpwait((ptr), (unsigned long)(val), time_limit_cycles, sizeof(*(ptr))) =20 #endif /* __ASM_CMPXCHG_H */ --=20 2.43.5