From patchwork Thu Feb 15 07:41:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201307 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp275871dyb; Thu, 15 Feb 2024 01:33:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXTQQ3oygSncFUoR1G6Ngl4X/2GzLTqpAQmFbfoZQmigy8B0HSxKcI9n98NKdmwOOLZL9nLurkq/qkXrHYsOhkyWDNhJQ== X-Google-Smtp-Source: AGHT+IHbhc9ynIdqZJmybO98m4tVJejxQqlvtwWbUJ775I/5bzkYYayFa5BTYiI7jt74Fp28iIEI X-Received: by 2002:a05:6a20:109f:b0:1a0:5841:673c with SMTP id w31-20020a056a20109f00b001a05841673cmr916087pze.21.1707989601225; Thu, 15 Feb 2024 01:33:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989601; cv=pass; d=google.com; s=arc-20160816; b=0YBtYlHNQsxh8wKQun0R/JYT0RCNQbGJo26xQuFUIoe8IcIpTjBk3/maNQRFku0BNd ymoyOjak4NnkL5pJJTvXBInpF+jJICqRBGfZjCb3TnT5xa1w3i5tTALlqTt9Kl3wdOEP uZvKWie2FL83EHaEexSFoaWURLzoXfq/0y9kdsS6PgEjClhvkHB5Q5QoUPynAS3LsJVC GV3P2IcDG8vmctWXzrJ8RfQGW7qVS0FO5PdTslz8CNj6hPaMIX2Y7srHmMvbGQeF9ZWB v0B2XiWqy1YQERZKRt21uKPJfcxB7+ACYJp6lutIHXCt2Hh06R7Jvz74Prz14VN21Ntq Fouw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Ntu4DcQjGQsU8Mtl03jq//04K+iPyGzeMZZQoek0Cmc=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=kyAbmX/BBvZD/Z3q65fe8k7xilm4H0+Z2X6nC2H3ppx4FzdGX1+90FW8c5CU9wtMAW B40qK2E9efQ4cI1rsTP/Yz6P5w/lcTuz3JNs1dtYahLK6LTYJsyIel4o1nqDfJ4AuTZ9 eIGrrjBylZVXIRE0Bc3YrVpQ00aPkJcQwd6+fWeoHqUF9N7AMYgyoiE+1647g2DgcZjY zaYZJN+2tcgka08KY7T654uMJrk6LdGZhrAZz68VurRT81aL31IovlhtEwcQHydOR4lm ABsRxHCAa/a+LULBD30vJIEExPRm2X/43+50Etldn7buCOG9za3FLWbvZNFXl2omhLAJ ZC9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=HudTR39M; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66470-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66470-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id dq14-20020a056a020f8e00b005dc82fb4b3bsi811316pgb.742.2024.02.15.01.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66470-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=HudTR39M; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66470-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66470-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 795D7B2AA51 for ; Thu, 15 Feb 2024 09:00:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94BD31B959; Thu, 15 Feb 2024 08:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="HudTR39M" 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 7A99317741; Thu, 15 Feb 2024 08:58:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987488; cv=none; b=ootuvejP4gazCPAQ/gbwdzHNVNybTkqHPF9EMGW009U0GmGzXcagm2eR3qId12IyFDtDMuzroHv9+QyvENJlXWT+3I3Ow0I96IIdQrLv3D7rX9ikonKMahLWBP62jUwIpM+grvIH/B5PQielDslEmNUp55yqNUe7gPlzQo6mdeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987488; c=relaxed/simple; bh=+gcsxoQvX6QlykVu3RVGSqy/SWH5P0NH92lt2Z/NHLc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=VP7tOtG1J8y5DVXdGfokTQusf7sB4dE4+rwTa/w+sZRwcgdjycnp0KzBxexqNdEVhF38vx5cNOGzgLJ068/7nZr28IkYLrqVEf7jE5+xxFJmEv5t/2C4yKRqUG6LW4p7QNodLER1PTdNwPLPU0dq/r/LaoQrgBW1yu9fUXJk1Rw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=HudTR39M; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6iPAw031358; Thu, 15 Feb 2024 08:57:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=Ntu4DcQjGQsU8Mtl03jq//04K+iPyGzeMZZQoek0Cmc=; b=HudTR39MlWO+GCb9oPGIv7Vb5AP7LG/gaWZq1GcVqFpVuF2A6FoU8ZSGcHaGAE/xVS9c TM1MZXMV5azt7ExHep4cSzZSO3Uu68aOB2v39wufRG9kXQUKpTiZZI0O+dxovARO9PAn yVdSdkedWupjGH6TExOadvmV9R8s31tvj2ubUFDJvY0WNe5Jo6VlyG2OpRqjujX6CIE/ 9YapsA+M2ZLwjyH+IoHwLDscIgzpaE8WT31t1Zxn1xjqFZ08cD/Wad8EHimvrL+1ssyv v3iTUETtYegByXsT9NRtsRvDpievHAPJP6Df9sWPw00jp/0azr8viu8fKDvMzEi7rXj6 Fw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92pphew7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:19 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F85PoG015098; Thu, 15 Feb 2024 08:57:18 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73fv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:18 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDcp033748; Thu, 15 Feb 2024 08:57:17 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-2; Thu, 15 Feb 2024 08:57:17 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 1/8] x86: Move ARCH_HAS_CPU_RELAX to arch Date: Thu, 15 Feb 2024 09:41:43 +0200 Message-Id: <1707982910-27680-2-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-ORIG-GUID: Wy8QVjZ3Eode5e8NCy2g6PmIrvXOPHbD X-Proofpoint-GUID: Wy8QVjZ3Eode5e8NCy2g6PmIrvXOPHbD Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790956904045955974 X-GMAIL-MSGID: 1790956904045955974 From: Joao Martins ARM64 is going to use it for haltpoll support (for poll-state) so move the definition to be arch-agnostic and allow architectures to override it. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index a5af0edd3eb8..5b2e8a88853c 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1363,6 +1363,9 @@ config RELR config ARCH_HAS_MEM_ENCRYPT bool +config ARCH_HAS_CPU_RELAX + bool + config ARCH_HAS_CC_PLATFORM bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5edec175b9bf..8c4312133832 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -73,6 +73,7 @@ config X86 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_CPU_PASID if IOMMU_SVA + select ARCH_HAS_CPU_RELAX select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE @@ -367,9 +368,6 @@ config ARCH_MAY_HAVE_PC_FDC config GENERIC_CALIBRATE_DELAY def_bool y -config ARCH_HAS_CPU_RELAX - def_bool y - config ARCH_HIBERNATION_POSSIBLE def_bool y From patchwork Thu Feb 15 07:41:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201288 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp262709dyb; Thu, 15 Feb 2024 01:03:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVq+rgjoIh9VnPQPleWSSYcLX8vfOxQ4cEUJo3n3HWjWCcFE/b0dJ2Fakr1iC4S4vu9PM1K1d/mEPSnHfzl4tdLppY80Q== X-Google-Smtp-Source: AGHT+IEISD2FOtH3SAr9sSN6msrwkBWkkMRcNQeiQoPZ4rYSUMJAnJgOX9rlPg/pp0epZdt677qI X-Received: by 2002:a17:90b:394:b0:296:ea8c:cfc6 with SMTP id ga20-20020a17090b039400b00296ea8ccfc6mr1042692pjb.24.1707987817864; Thu, 15 Feb 2024 01:03:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987817; cv=pass; d=google.com; s=arc-20160816; b=mByxM8r3bZY3ChLSyfz+BGIeSZ5ljRZgM0+8SsRYZKOs9fRF/bCC3APqBKGw0q/s8s qGoAjrz8CZRv28nVYZa1uv8yj5gtNZbfFgSGIaYZkr7BskujFMlpWCGrz7WxIn/xB/gg QnO1H59bG6x8acASoC5MksmrWqSPmCg5ojji0903zZJinLsX6hRIDU2HpSKwVl/wPxvH 5cHlf3mWa1Nt9Vpo7krYczxLJ+2b9F2TzUvGkvqrRBWB/OQhJZD9XHhWgko3pwXFzUZO 3wXHnKPyEoN2JMqE6MppT6YZs8alxIWv4guO0qINw1TB5zw99sIgiAvA2ie+OEm9mnfx If4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=TAwS+2D72yyBJ0cEfl5gl5b2nb9+6zOA/B/kxENfM7w=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=l76y1hENQ5uXXFKWRK0xb3F8eAfxKf9RlthfHtzJH1mXIL8V3bdp7LpNZmIKAVc47m Na0Ldgkl9eLxsmggIYvMTRH3wVs6KYeUDNT7wjjSCsPzgC73/k4RvjZkQ/2bWyF+VgIW nIQFLXFfcianFCDTNBUYVtVrGTmd+yIeTCUvGYcgV8u2fUBzezlA2+W1bKKaIu72/JAb XBTwwwsuH2N8vjsj/zEkowJj/wkGms1S+NjBakeBXt81vZxbGr82LQirzxApIKnLXx1z EhuJZxto0czODm4+QDbHN1h9HmYYTwzS9nRt5ZdaC/nLo1L7vaAVkxNmgdAX6QtPhKXb wquA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=nTmX+yOF; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66471-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66471-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id sh7-20020a17090b524700b0028cfa4f3873si915422pjb.45.2024.02.15.01.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66471-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=nTmX+yOF; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66471-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66471-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 93E1E28E04E for ; Thu, 15 Feb 2024 09:01:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5F151CABC; Thu, 15 Feb 2024 08:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="nTmX+yOF" 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 DF3661B963; Thu, 15 Feb 2024 08:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987494; cv=none; b=JjZYH3mVSkCWYLYGHI6AAqRL7a0iSRHgvkSS2hnmiOkZ4myOp8eS6gNB9FPAtvS1Y+CKq8B725lmEpY14kV3y2w+EnHkOvWw9otOXOAkjpl0aIXRsqinhufi1MU9G8yMWdkP7SSaopCDktijFHKekS6a3a8a2w53fsPGJp0xW90= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987494; c=relaxed/simple; bh=1Fmk6TMn5KQ39g/kifUWbxTNBjmLAzVdlMpxRDqcWaY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=fKCywgGdQLp+a8BQRqEi/8BHksr6ITxJqrYAsxicmXjKp6Xr43ua8nP182R9N8SH9IrsQwyeaI91W+Zr385JQOnr89t/mTJwQxoMe4xTeRtbBqOQsA9mC3wZtmulokki1dx4yXbJFwKeWxRlOjOEY/QA5225i5mJwNQHHVTBGJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=nTmX+yOF; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6i03S027040; Thu, 15 Feb 2024 08:57:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=TAwS+2D72yyBJ0cEfl5gl5b2nb9+6zOA/B/kxENfM7w=; b=nTmX+yOF17M8oC2BpW+rfuX7BuScJEgPZ7aeHhxbSxfBpf0WtTeJ1vAHqABkUJ1aFUmk jAB1IUlg57+eAFU/qSiv1VEa1DI0uVwS4qB6z+k6s/4+1ARL/+HEgYL5VWWdQUF4U93d U3hALemyPfk1irHd6hv8XWxqBFbqFwz7VA3aMocDCySnif4507e0xxh5K3tk46lFydlG JzF2DjGGo7RXJc8mL2/SuqixVQ7CkEchue73ZghNaFk6PghgNduMDOeBQ5Ad6Gt94TPh xl5sfP/4rLH6LLE2kPzI4xtvj2vJcuSWjsampjQ1XGOHwAzNwk4oMhDWNHoSZzc8l9em OQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92j0hfjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:22 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F8TYih015073; Thu, 15 Feb 2024 08:57:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73h8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:21 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDcr033748; Thu, 15 Feb 2024 08:57:20 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-3; Thu, 15 Feb 2024 08:57:20 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 2/8] x86/kvm: Move haltpoll_want() to be arch defined Date: Thu, 15 Feb 2024 09:41:44 +0200 Message-Id: <1707982910-27680-3-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=995 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: pHUncGFQIZ7WEILBNb1GEfXndDxI0-cV X-Proofpoint-ORIG-GUID: pHUncGFQIZ7WEILBNb1GEfXndDxI0-cV Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790955034061413407 X-GMAIL-MSGID: 1790955034061413407 From: Joao Martins Right now, kvm_para_has_hint(KVM_HINTS_REALTIME) is x86 only, and so in the pursuit of making cpuidle-haltpoll arch independent, move the check for haltpoll enablement to be defined per architecture. Same thing for boot_option_idle_override. To that end, add a arch_haltpoll_want() and move the check there. Signed-off-by: Joao Martins Signed-off-by: Ankur Arora Signed-off-by: Mihai Carabas Acked-by: Rafael J. Wysocki --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 10 ++++++++++ drivers/cpuidle/cpuidle-haltpoll.c | 8 ++------ include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/cpuidle_haltpoll.h b/arch/x86/include/asm/cpuidle_haltpoll.h index c8b39c6716ff..2c5a53ce266f 100644 --- a/arch/x86/include/asm/cpuidle_haltpoll.h +++ b/arch/x86/include/asm/cpuidle_haltpoll.h @@ -4,5 +4,6 @@ void arch_haltpoll_enable(unsigned int cpu); void arch_haltpoll_disable(unsigned int cpu); +bool arch_haltpoll_want(void); #endif diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 428ee74002e1..259212eb478d 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1150,4 +1150,14 @@ 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(void) +{ + /* Do not load haltpoll if idle= is passed */ + if (boot_option_idle_override != IDLE_NO_OVERRIDE) + return false; + + return kvm_para_has_hint(KVM_HINTS_REALTIME); +} +EXPORT_SYMBOL_GPL(arch_haltpoll_want); #endif diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index d8515d5c0853..d68550270802 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -95,7 +95,7 @@ static void haltpoll_uninit(void) static bool haltpoll_want(void) { - return kvm_para_has_hint(KVM_HINTS_REALTIME) || force; + return (kvm_para_available() && arch_haltpoll_want()) || force; } static int __init haltpoll_init(void) @@ -103,11 +103,7 @@ static int __init haltpoll_init(void) int ret; struct cpuidle_driver *drv = &haltpoll_driver; - /* Do not load haltpoll if idle= is passed */ - if (boot_option_idle_override != IDLE_NO_OVERRIDE) - return -ENODEV; - - if (!kvm_para_available() || !haltpoll_want()) + if (!haltpoll_want()) return -ENODEV; cpuidle_poll_state_init(drv); diff --git a/include/linux/cpuidle_haltpoll.h b/include/linux/cpuidle_haltpoll.h index d50c1e0411a2..bae68a6603e3 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(void) +{ + return false; +} #endif #endif From patchwork Thu Feb 15 07:41:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp261689dyb; Thu, 15 Feb 2024 01:01:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX6N9V5Jf1ucrpOpqvTCmsZYcanwfTbdNEBCMNLHDSYDXq7Vv73ZGUNKqB8nYz1STSFT7Q2FrlgEtngmpmQVHmm0rcvsw== X-Google-Smtp-Source: AGHT+IE4BdOOe1OW1gX9upkfP+B/6BssGEAcFiZD88rvxj0sxQwKBUhyOO6D6fICGv9zFPAKlV3Z X-Received: by 2002:a05:6102:d5:b0:46e:e846:2484 with SMTP id u21-20020a05610200d500b0046ee8462484mr3065679vsp.0.1707987713594; Thu, 15 Feb 2024 01:01:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987713; cv=pass; d=google.com; s=arc-20160816; b=CnGswNdsreblQrZ1pld7IaQpv9Am7HZi51UbznqBF1lbVT/uNqMPC985OPf4RadCup mhX0gOpqlr/FbgSUzgICqR3sfa0NE6z9SjNQndQnFTBIG0gOEjMbXq8H8H6vVy9f7bhV 8x1cooOolFSMeUhbecjR4S7VULERa7QESYW8M6ln8/u7NW1KEVMI1p3XsM9A75rEaUBD C6TlAwmopSNwzNdKeeHO/Lku18jx/Z/ukEC4l3nT0p2k3SPsh2/eHB6qjBBQYMZWddcL JUj3WWuyI4erluyz0dZCZDUiriE+TNPRDooYCiS1xhXjemaWcdUavjDPdT2fzGq9DoCq TXFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=jvWR7NadDlFzwGkQ9GO0hvSkDG29BscyHclo7q5ReKo=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=N9iHyBj+g/tVu6i2jAulrFypAlBUgb9TivDh+QNOAh/Et/TtUQ4oic0fPQCVlfgAFk p+//7wGlzG9GVuA8+Xwt2ESRD56jTvRX/XNp7QsldIavoeF6D/s0nnHKvWqWdiNQbBsN 4YmdjbOgC7l5Mm5rynKnuhfd321OMM7CnXUN188+oF/aszSTBTZXi7Mhc0nrk8tzgyqL iuqMUHILJPxUpyvZVenM0MxPMKH+Y+YxOr3mSLhnALZU1UNa4nBlSR6Bm8+AKacXh3sm 4Yg1hOqozv1SIhOkL+pCBzHnQhgmo9u5m4lZNj2dSIV7HAuzbQPkK0fabTQRFG9XTDVx /l2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=WRi9b08m; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66469-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66469-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m13-20020a05610206cd00b0046d609278acsi85931vsg.500.2024.02.15.01.01.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:01:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66469-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=WRi9b08m; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66469-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66469-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C2DA21C23B53 for ; Thu, 15 Feb 2024 09:00:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D91121B941; Thu, 15 Feb 2024 08:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="WRi9b08m" 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 A17DE13AFB; Thu, 15 Feb 2024 08:58:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987488; cv=none; b=uU22jSrqzDwWSWJ1kdZEkdVqla9GuFsjusfD/ogOJNxNg6hKIZntlAG8Y/p1gELgeVhjn5Ntr2r6KIxe/XM0+dqJpkxLsN3XGW7RYupvpmzVkKmmlxznKbtN88qSyZhNfqrc1I2rruySBqDDgFg6duJWMINLIbmL2xTa612X1R0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987488; c=relaxed/simple; bh=qlzyj+96ZrnytPQobnPb0r/WF8j47o3LcA2aSb8TKyA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=hQyeIoTCpTMkeGuRsDjNbKTovHJ3Wy0ecbUcTs2N5r5hv4PniiwRqaKCRAocqwx29Es5jiE0p0YW1B+iC3wbbIL4Daet5vL1V4PIQ8m1pk602R+nn0xNH/IgPK4sLErBE0py44ibCz5bXnypTzfwj90FYoaP2xoiMoRNslOAWmY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=WRi9b08m; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6hvO5031013; Thu, 15 Feb 2024 08:57:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=jvWR7NadDlFzwGkQ9GO0hvSkDG29BscyHclo7q5ReKo=; b=WRi9b08m9JZKxZQtqSdGDNGMJmfgsXFaXifrH7kiE2hTFz2TUI+Q6XxPldhhFkCaVw72 waBjiKtL2PDEUVvA784P4MiIMApM7zqObVd+8dcalPugRvgieK3Qjf4zkKlpsuyPFDje erx5W+eTal5sFRp5m1ILpVyWF36D5O1XZUNZK5FQp75bgriOQQX7f3ejSy8DER0TqTVf kVQCcegr1Uq4Z7ToTUpPrYYs9PLTq+8wtE2Li4m8SmUjcZcx0GsvgngNWszLq1K8+3GO nZ5aLwBzZt3g5fJj1cPgFLio2aHDdRxFYsDQKZSBnEphrlMVmMqYOPkexAJLauGHGeEd /Q== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db1g5c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:26 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F7Lq25015051; Thu, 15 Feb 2024 08:57:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:25 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDct033748; Thu, 15 Feb 2024 08:57:24 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-4; Thu, 15 Feb 2024 08:57:24 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 3/8] governors/haltpoll: Drop kvm_para_available() check Date: Thu, 15 Feb 2024 09:41:45 +0200 Message-Id: <1707982910-27680-4-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: 6QwEybfJDMqlGTaCvgEBGb9IQtnd8AGQ X-Proofpoint-ORIG-GUID: 6QwEybfJDMqlGTaCvgEBGb9IQtnd8AGQ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790954925137337763 X-GMAIL-MSGID: 1790954925137337763 From: Joao Martins This is duplicated already in the haltpoll idle driver, and there's no need to re-check KVM guest availability in the governor. Either guests uses the module which explicitly selects this governor, and given that it has the lowest rating of all governors (menu=20,teo=19,ladder=10/25,haltpoll=9) means that unless it's the only one compiled in, it won't be selected. Dropping such check also allows to test haltpoll in baremetal. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas Acked-by: Rafael J. Wysocki --- drivers/cpuidle/governors/haltpoll.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c index 1dff3a52917d..c9b69651d377 100644 --- a/drivers/cpuidle/governors/haltpoll.c +++ b/drivers/cpuidle/governors/haltpoll.c @@ -143,10 +143,7 @@ static int haltpoll_enable_device(struct cpuidle_driver *drv, static int __init init_haltpoll(void) { - if (kvm_para_available()) - return cpuidle_register_governor(&haltpoll_governor); - - return 0; + return cpuidle_register_governor(&haltpoll_governor); } postcore_initcall(init_haltpoll); From patchwork Thu Feb 15 07:41:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201286 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp262245dyb; Thu, 15 Feb 2024 01:02:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJkIKBmMrRnybuZsQV7WJlGRuFsgxpAGkfDz2TmFXn9irbv52hdW0p85qWTuv6yx5v5GUP9T9fx+dy5xmZReop3wFOYg== X-Google-Smtp-Source: AGHT+IGUQWWJuoRUG58ibGrtiO+V8zqPl2B/ojFVXY2DvLCMN8CesrDZqQUihW/hTP7q214+40Vr X-Received: by 2002:a17:906:c13:b0:a3d:45ca:679e with SMTP id s19-20020a1709060c1300b00a3d45ca679emr814577ejf.58.1707987765607; Thu, 15 Feb 2024 01:02:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987765; cv=pass; d=google.com; s=arc-20160816; b=exk8Bwq0stAwkRj5XsbErT+p9lm0z5BX8WMPNCX51qc05btDrL9xzk0KSe1634sqc1 twq+S1BcWWX3aVvAuJC5mFn97oCYKnU3Rt8E89tcZ68AgA5afQKEn3U3ukIoq+qoJfNf 6BbbU2wmSjma7W5hayvUHpB++z2+wBE6bTkz03s2/hHmLgrs1MR22bMZgQrfxYMyi+XU EiZaKwlria5W07/Q1KaHN5ZY4vaRcVUayvd8Bhalhkz4KZ0WYC9QsxflGL3r/tmcRpdc Y7RyBUw3ug21XOWSqT1/zYGiElqNzIvYLKMP9py6S5cyrk09ZoixFGaFvpHU9Xplzp7V AogQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=TqZCyfY5MFOSV/wspVztSRkmFviNKD0NVeEVP8qptYg=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=j/wmUQoXPOBe/Lca0IUGOqDrNN7en+ohShODalxP6ytCqBzDAD+Bo/MeD6oltfGbJx Ygsqe1vJACuOTDXS6RJrUSm+16lFgSEE/SotIWLBFyDdaXKfyQTdPRvitPUqn9w+PZVS rCnvjP04DWcZ3yYLYMOr304DJpm9/1bB3LrXWz1Qgn19rEZ2ex9axurw50NH+/ygYbQV JngYrfrCUFM75ayWUWj+aqcjbC80XSGArh5yvdqkUTRC+p08zf8uPEJC/1C+m2lDp5VU Oge4ypqV/IJWqg/8VFwdmb+IEvmLjc3yRamEKy2rKPWgbH5cscfRVCyUdG/U/t+9oI/g kt3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=gnxEeIgb; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66474-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66474-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d12-20020a1709064c4c00b00a3d9e6b2a25si245395ejw.1020.2024.02.15.01.02.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:02:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66474-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=gnxEeIgb; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66474-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66474-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3929E1F21228 for ; Thu, 15 Feb 2024 09:02:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A98120DCB; Thu, 15 Feb 2024 08:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="gnxEeIgb" 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 C20061CA95; Thu, 15 Feb 2024 08:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987498; cv=none; b=ff5rPxHgStizu4JJ0so9bRaORzqwLwTI1kjiQfubs17eEdDaI0zLwnGD1D6iVrlrJx/nss88xe37hs4sYWvJSkRe93HS+b1XP2RjvqnwWIm6VK0NVmWw93bKmT8robQeZWoCKCMcj/e+WzVWC8ednc5wrygZvcfgsKpp9OVsKR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987498; c=relaxed/simple; bh=JmgT/kXMSE6/TzlkZacXRvzuEwEsNdGl3czGIcKJO6Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=mI4bQqlBloyl4GgYAf8Zb8WVKc0ExirVHzRb77+/Wa2olnw0p0f6dWujMO4O5y9QEcisZ7tdKcouWnbeIQBw0UOAvqg/24CzD3vaS2bap7YeG3gM/mL1LcAyU1E+CJLGoqj+lU58Wyj4tSgxuAt0je8WueLBJrF+c8HFtH3i/Ps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=gnxEeIgb; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6hvCr031032; Thu, 15 Feb 2024 08:57:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=TqZCyfY5MFOSV/wspVztSRkmFviNKD0NVeEVP8qptYg=; b=gnxEeIgb7vogauocskltO47fXSLqkWDX+TepOxqtnbB3rPqyVZYS1YEw0ZrtAZIzCsW6 kvPJOvms85RLGbJ5hULN0Ug4lovLNy0ZLgwok+IlDYMTTEeltl6o4Vy/3z8u9b6W9s3S 3y46YAqvtKUtD9JMns+DsFcW6dSvG2KW9fnJzqJhT07w862OGUb/nM7wAAWv5quOqB5B gE4u6Hr/ERrYBUN9/oyTz+naJ8dG1uMoYURaR0xyAG62iJ7XQnTh/8oF/P1BQmmvWXi/ 0QjWEeNZhyIyNhEnW4pdomJaKsZ+PvDGSfFbI86sWqTRIfvVxLPybEJvB/wOXzIJa2fJ kw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db1g5g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:32 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F74Bgc015080; Thu, 15 Feb 2024 08:57:31 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:31 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDcv033748; Thu, 15 Feb 2024 08:57:30 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-5; Thu, 15 Feb 2024 08:57:30 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 4/8] arm64: Select ARCH_HAS_CPU_RELAX Date: Thu, 15 Feb 2024 09:41:46 +0200 Message-Id: <1707982910-27680-5-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=990 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: pjoRB1MWpvnxUzMJUWVFqSVdKAqZSr5R X-Proofpoint-ORIG-GUID: pjoRB1MWpvnxUzMJUWVFqSVdKAqZSr5R Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790954979286978634 X-GMAIL-MSGID: 1790954979286978634 From: Joao Martins ARCH_HAS_CPU_RELAX controls the build of poll-state, so select it from ARM64 kconfig. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index aa7c1d435139..bc628a3165eb 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -107,6 +107,7 @@ config ARM64 select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_NO_INSTR select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES + select ARCH_HAS_CPU_RELAX select ARCH_HAS_UBSAN_SANITIZE_ALL select ARM_AMBA select ARM_ARCH_TIMER From patchwork Thu Feb 15 07:41:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp277551dyb; Thu, 15 Feb 2024 01:36:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWx6d8OpwueYayEhCFbErChZqgOKQD4gDL/zTcGryTpYausGBvhEhOXJv4d9bgXVskzW6cqxcWoi8DDZPisel3ycc5YIA== X-Google-Smtp-Source: AGHT+IEBUtmeTVnNLWr+5S0PPd4LZpdvGnja47n96ooqDGA0dtP8fwiXDZ+V6z/NsDSpyYmfjfcN X-Received: by 2002:a17:903:1103:b0:1db:4245:454b with SMTP id n3-20020a170903110300b001db4245454bmr1417018plh.57.1707989793711; Thu, 15 Feb 2024 01:36:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989793; cv=pass; d=google.com; s=arc-20160816; b=O8C0jgdF4ezT8U2c09ST1wlQl1gY4MZEbO3cD0jBvJcIkFDs1DNnRCe2cldajZVywW 6Z9WN9RA7usK2N3zzZ54ZE2iEjG15GhxRCs25b0zr9ge4+Rzix4ZSJqeah5M1oC37+Yh MNYgYkrGTtDXnktrEuMuF3jy7kZSx8hoRGVT5WnBd2lwNPS9mixNaQyJ67oq1Ax7Moix 7+vC/sH/JPAORow1kj2RydpAmAUTh6tkRlfmT+N9RKe6FzbgKnCybdFoQ1a7xhtfOhlF H1HhvScnuse/nI79hwg8oQXd8NN47FoxygJMsow377IB6MZgk+9RyMu3wvoS23KB5dQG Xisw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=V7nZPrYATUFAp4Eq6Ao12RohHH79Z76Hub/Iv1Wwg9w=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=L3uElsEkHKlLQJsMVcKS7wVSMP40ONmvSEP8CWyMWw/TI0gdY3143pvYhovogANGyI d0BZ3vlrOL36ehK82hMFGG1BDicNyzmE6I1fv9MwENnp3Y+/zJMGBHGiMh2yZk1I7WQr g6p40y3R0Yt8oDmJRD6QBQCUCJ/MT9kDOqaF8K+RSnD/ycejMPpzBAh5tpocCB7aCX+a IVs1f1D+yXxD5igY5jnHumTjLFQz//7vA/i+Dgn1NKPsEwIwu3otEmkkTbIxJU805PHo bUOyNptrUUnhcwQSTVbuhEQ5aziDb7N41mpR3DBaoV7aY7B39l6/aNbQ9EuyvrjlnjV9 vk1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=BlA22SaI; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66475-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66475-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id j9-20020a170902690900b001da22d9e810si840544plk.219.2024.02.15.01.36.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66475-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=BlA22SaI; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66475-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66475-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C3690B22E61 for ; Thu, 15 Feb 2024 09:02:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CF86210F0; Thu, 15 Feb 2024 08:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="BlA22SaI" 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 206781CAA2; Thu, 15 Feb 2024 08:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987498; cv=none; b=EJXUvzszXBliqUPRFEsAYihesN8C39bdqAfrHvMunMy16l0qsp9YkD3o7xVjgIfVko+/WD0NTe6mnz6GiamsqFjMY8F87JdcPtrQTjdQhnTGRHkzyQrwNRnTe9S0VbFlmiVSq+bCE40hELUZF8wtK2xUZ+22+NMLZp/KthcpNfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987498; c=relaxed/simple; bh=oT5VmBJQVuSb8o/SFdi2izyADM9BamqPWkKDm1+wq1o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=u0yhwLbbzm2p2Ga45C2XqISVvzlDL4eeX35wBsts2gPO4NPnpSsBzAKpffhKDMH87o4DwuVb2250kg6oF6q+aU7Eu6ggMfGvCVkiKS0kwkcrD9E3K3a42nqfGouBSparRKgc3KAAHEdZ5rjqTLoGqq/7LWzcTY8XpotqFjTTciU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=BlA22SaI; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6hwpN031109; Thu, 15 Feb 2024 08:57:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=V7nZPrYATUFAp4Eq6Ao12RohHH79Z76Hub/Iv1Wwg9w=; b=BlA22SaI3Sw51j5gazMju97Qto7T6hUCurUosEOXlvs0PuY+8W8Go93/L9IMz3os663E xZCFdkH+O1yYi4gZtjzwapSaLWID0A0cVQzcsgwllh8edoGznjSP8++xRlbXldYJNwG7 FMkfzk8BFTo1WglNESBFqNzjbbhiHY51HGjY65oOIb94qHQ3VwFWGfhBacWy+IO562Xr wY8ZEv9Z7ExVgZAtZJ7oET49irB4DbZaNhLHSsyS8d4P/sagmo/BnYQ+STH4/sXnZtoL 5eAPRCElFfpI+AnZQsecZBZufSKkGSpGKT4talSjUuuOXYiHaCANrxpwEfyDZWNvXKKw dQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db1g5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:35 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F74A09015104; Thu, 15 Feb 2024 08:57:34 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73q1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:34 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDcx033748; Thu, 15 Feb 2024 08:57:33 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-6; Thu, 15 Feb 2024 08:57:33 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 5/8] arm64: Define TIF_POLLING_NRFLAG Date: Thu, 15 Feb 2024 09:41:47 +0200 Message-Id: <1707982910-27680-6-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=871 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: xa6bMgHE2XaJ7zKkzKlmHBXQxg2JYjTu X-Proofpoint-ORIG-GUID: xa6bMgHE2XaJ7zKkzKlmHBXQxg2JYjTu Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957105685618823 X-GMAIL-MSGID: 1790957105685618823 From: Joao Martins The default idle method for arm64 is WFI and it therefore unconditionally requires the reschedule interrupt when idle. Commit 842514849a61 ("arm64: Remove TIF_POLLING_NRFLAG") had reverted it because WFI was the only idle method. ARM64 support for haltpoll means that poll_idle() polls for TIF_POLLING_NRFLAG, so define on arm64 *only if* haltpoll is built, using the same bit. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas --- arch/arm64/include/asm/thread_info.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index e72a3bf9e563..72273a2168fa 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -69,6 +69,9 @@ struct thread_info { #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ #define TIF_SECCOMP 11 /* syscall secure computing */ #define TIF_SYSCALL_EMU 12 /* syscall emulation active */ +#if IS_ENABLED(CONFIG_HALTPOLL_CPUIDLE) || IS_ENABLED(CONFIG_HALTPOLL_CPUIDLE_MODULE) +#define TIF_POLLING_NRFLAG 16 /* poll_idle() polls TIF_NEED_RESCHED */ +#endif #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_FREEZE 19 #define TIF_RESTORE_SIGMASK 20 @@ -91,6 +94,9 @@ struct thread_info { #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) +#if IS_ENABLED(CONFIG_HALTPOLL_CPUIDLE) || IS_ENABLED(CONFIG_HALTPOLL_CPUIDLE_MODULE) +#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) +#endif #define _TIF_UPROBE (1 << TIF_UPROBE) #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) #define _TIF_32BIT (1 << TIF_32BIT) From patchwork Thu Feb 15 07:41:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp261985dyb; Thu, 15 Feb 2024 01:02:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpuhCnOkQnTZezZSkfYi3AUWqWpXpvjjencTi41TTEcA47yL+KpXKJF/wzQ9qOLqEk0oK21ab3ZaqQuWIdiHeVs5UOEg== X-Google-Smtp-Source: AGHT+IGgirMswwKYBaQPqlBlgA2gDrbU8OtEkedsnkaSpc35AVObNMHbgma2K6+xTf22VR6seHBA X-Received: by 2002:a17:906:284a:b0:a3d:9dd2:e492 with SMTP id s10-20020a170906284a00b00a3d9dd2e492mr616514ejc.11.1707987739868; Thu, 15 Feb 2024 01:02:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987739; cv=pass; d=google.com; s=arc-20160816; b=z/oE9nLi38h/bUIBxBOItzD79zVAcgJn7q5fA+YGKib9Xj5AiZjXtc44L6DdgjO2fS cUwz1+iD8hrmBMuUnE/GEXbo0j2x9pppZN9sRpiRe2VA55tmXTcwYfGn1wPvsr7dNO0N poKMgsLtNL8Dmug5MLQIxqqWznGQmf9f3WduOnAEPmr6GkuQ3PNjj7bytYlapYhCUwfO SmU7YlBx/UQ+hRmLE4ZVxxyGKU365BI/0QsSI55eFLQVSukW0eZBpk9CXt1Qo9a1VwxQ WEdiOuuMdCMBGCbvzkJFfWqyHhoEjH8CssrOpGMYjsWbSF43w1RAIq+HDMQRgE2ZU92R aAXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=hlNIjt1lJtZP47W7eO4KvEIII2+KWpAFpv+PlhUsURU=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=yXSGU5YVTGPw3QcAPP6OorYxeeZPjzGg3Bo//S/9ZQDUHkip+ZpD9RaVMphxT2ls2D zixnP21rWhMHCpVIJ5D318rQq8K09BuI7DNjCZLWSh2ZEVZ/20YNYFRfjd4VL6nBplKa 6+ZLc1xqSdcOOxhoz7I5yQImV+zjkbGh4ExievrB94TeboJ5nXbb87MTxVBv4zhy8uY4 ZcrmK3g+xfwDDHg3SMcGZgzRSczciNGNoS1oQ+/Tv9NE8pvkTZ1T9EjENPiXUj3/mxAy a+NmQyDxJAtJp0F7BgyDwo20OVOQAHHeZLhIf/JHRmcc2buc1iHQQUypuAj4uA3UrPM6 IPYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=YC+l+PUr; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66472-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66472-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mf19-20020a170906cb9300b00a3d90d72b8dsi386036ejb.684.2024.02.15.01.02.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:02:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66472-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=YC+l+PUr; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66472-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66472-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 50B351F2A0F3 for ; Thu, 15 Feb 2024 09:01:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 246EB1CD06; Thu, 15 Feb 2024 08:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="YC+l+PUr" 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 F0F941B957; Thu, 15 Feb 2024 08:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987495; cv=none; b=PG7M/xGq1siRpui23DY+TcPrcK3HeyX4n9QUpW/L9q3bqZGGPx74uyO7XYRscJ5OJYKUQbk1u8nlPQ2l+eaNJOQ/WJUpZ3C31x3KJncYguPSXFAZBQudKR/Ws+/jb/7i087WY4WwXAMJK84QLmE9Kmd+8SFt3YdpzvDRitAG6hk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987495; c=relaxed/simple; bh=k7bPu+gk7Cd3HeftqicW+V1b6QVdrKTlCbgVbfhaERo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=SZqv+GMel7eJLC6dU7XhMRS5sj/v8ctPSIpzZcyECawjb47cz13EGrER/MZiKwEtQKl4mS/DqrZDx6/PY2lpAQiqpdLoxOKxe66TB0zcyigjTMavgH8Gx5nWxcx/1pqrL4ZZWsWiz0+wXD1omIdGoE8NI5WcPWPpjQ2MO5L2c1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=YC+l+PUr; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6iQ1A013781; Thu, 15 Feb 2024 08:57:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=hlNIjt1lJtZP47W7eO4KvEIII2+KWpAFpv+PlhUsURU=; b=YC+l+PUrMU5xBqA3hq5Ym58t6zY7CWPc4uYSBWvHEueWoJE5dL/FHQon3qwvOhNsOmVT TGHG20yQgpgfYShmuseYEPcpslkrzpYmaPFXw6fEpA0mRShnQpodYDoWOyA/nxGpSGnE OS+4xtCJEQWlgPqNu3YZyTNf5gPWQp2BuVgHuc1zrb18f/coAUr7eBIQ1gqqUux0AdT3 o6854UF23FxKthuiawWppPdx874M4D0pWvqPLflguM1Rqza6RiQtY5BvoimwKgiihRDQ z+tUYV5TXsSEBVyfZueWGf+2AIBxMI1Qg+xCGGXmnFGWj/tDWkInOAifBDTxfb1rsbSJ RA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92s71e5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:39 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F7oN7n015119; Thu, 15 Feb 2024 08:57:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73re-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:38 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDd1033748; Thu, 15 Feb 2024 08:57:37 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-7; Thu, 15 Feb 2024 08:57:37 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 6/8] cpuidle-haltpoll: ARM64 support Date: Thu, 15 Feb 2024 09:41:48 +0200 Message-Id: <1707982910-27680-7-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: DKEm_88vuEAgYfwqE-BtVNjQU26GaIam X-Proofpoint-ORIG-GUID: DKEm_88vuEAgYfwqE-BtVNjQU26GaIam Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790954952424447841 X-GMAIL-MSGID: 1790954952424447841 From: Joao Martins To test whether it's a guest or not for the default cases, the haltpoll driver uses the kvm_para* helpers to find out if it's a guest or not. ARM64 doesn't have or defined any of these, so it remains disabled on the default. Although it allows to be force-loaded. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas --- drivers/cpuidle/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/Kconfig b/drivers/cpuidle/Kconfig index cac5997dca50..067927eda466 100644 --- a/drivers/cpuidle/Kconfig +++ b/drivers/cpuidle/Kconfig @@ -35,7 +35,7 @@ config CPU_IDLE_GOV_TEO config CPU_IDLE_GOV_HALTPOLL bool "Haltpoll governor (for virtualized systems)" - depends on KVM_GUEST + depends on (X86 && KVM_GUEST) || ARM64 help This governor implements haltpoll idle state selection, to be used in conjunction with the haltpoll cpuidle driver, allowing @@ -73,7 +73,7 @@ endmenu config HALTPOLL_CPUIDLE tristate "Halt poll cpuidle driver" - depends on X86 && KVM_GUEST + depends on (X86 && KVM_GUEST) || ARM64 select CPU_IDLE_GOV_HALTPOLL default y help From patchwork Thu Feb 15 07:41:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201285 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp262055dyb; Thu, 15 Feb 2024 01:02:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWim6O8aPRsNwOEfajtGlNBfKdtqtoG+ZLfXNnM1PWW316sxvw/CRVS7O++qTBBTtKc+RMNJWTS9TJBJ/bFolEjkI3dxQ== X-Google-Smtp-Source: AGHT+IF95Q9HGgnjmy4NfJD9wgG9AUs0EsOBOug0j2BVsC5EIRLuNDn5ug2jltE33mgUeqsUNM2Q X-Received: by 2002:a05:6402:1a41:b0:55f:e493:33b4 with SMTP id bf1-20020a0564021a4100b0055fe49333b4mr964675edb.15.1707987747330; Thu, 15 Feb 2024 01:02:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987747; cv=pass; d=google.com; s=arc-20160816; b=cu0YgiHeae1darvt1jP4auuAONJ1SoCqdwTvrSWIgTtxaNqivWMZJZ79V13Ae9PCqZ 4x9R7yXoDjqqyfBEJVGmOHwErC62zpx1lAdZjD7paxdexxSzEX3DuNnzdHlvcvzrw0p+ MfODZ7C0C+4BAHuHeHz3WAttCiJUh2m4iUQDqBiz0G7U1zncrgG3n0LWrp6V8XAKF8SL uEei9TYQAYNqdzS5RyiFXasuq9Y5OuSR3mFUYMpMxrrCxcVnWXt4Hn6Zdpzn8C2ntNS2 kGQrIFqtb3f485iFIypfZJy+PIN/vlSfiUKzFmXwldN6Knsn0dx9RL+xQbff3yoFgTtL SLJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=jwgRCWyFl1O7epx0x8iWWiua+ulnxF3yCh67glyLBKk=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=WW/G8uNarM9NIi7pwsBZeKGse1gbsEkWn2bGL9VUhQ0AwWUh71INsN4TV4V1f1WIj3 7BPsNr52Eimzrn0veg32kSUlVds1gQg4fRPyYx1PaqY5VLa5Y49TdK3hupD6p7j/8/qZ 8PBSpvqDz26uCWO3sLW/i1fdDJ9X2hktaNRaWZ943TQfRQIQjbGFSxYOnyzg6XUY1Ob/ rW4TnPY1OlNMksm1wfts09st2llxk99RTOSWcgTG0bGRHPGarDMbOGdV+GZ452s0Sy3W BtsKWrhnXYEOHFkEcS037MPJ7p/4iWTgAbeQI7OMoGLqTwVxN3v1XAK/EYCoWMGXP4b4 vxrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=V1dZ8wGT; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66473-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66473-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j24-20020aa7c418000000b00561bbb18e96si459472edq.156.2024.02.15.01.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:02:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66473-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=V1dZ8wGT; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66473-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66473-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8B5A71F22A33 for ; Thu, 15 Feb 2024 09:02:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBA761B957; Thu, 15 Feb 2024 08:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="V1dZ8wGT" 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 926D91B966; Thu, 15 Feb 2024 08:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987496; cv=none; b=WNCKsC64LpZmlR7KASA1AcURm4jUt/efdBVWYLBg8eR+dEzyskZVAMyoWnmx9+bg1MAkAV2MqyZ28YyosL9GZeuCDN8UmAPLGG+xajEI9o9Z1h7mK+8qMOV2q3jWX9TY6QgBGg15WyZhWM98Z95oxx7YuBpUKDsHXL9dkIRIcfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987496; c=relaxed/simple; bh=0yDZe5Gug3G88eQxog9P6hpCmjQ2/vQHDkmYBm8PlKY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=fiQim1EXd6nFAWf1qDxLx54MdUHiHOlgg+ami5B63mK8DEYMxPVfxj4N2AoNweH7XdHjIQP91YhaHfWp8Gw/lDGBA6Fqtjb5efih+s6AHJyuTlJ1aHd/ovEmUEZQwrMmKe7IuT+yMHqrwWs/VJTL5VwvrwccOg2qhaWAwpRopdw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=V1dZ8wGT; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6iQBu013773; Thu, 15 Feb 2024 08:57:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=jwgRCWyFl1O7epx0x8iWWiua+ulnxF3yCh67glyLBKk=; b=V1dZ8wGTWncD6/oeL4npJv5r3qB9QQyQ354M+jNqsYr9rnpvDUERlOeH+NdbrBKgQ6CS pOGHTJtca0j8dyy22O/OtRTqFnTr7RbEvG0ScNGOMiV3GDRqjUKRc94NQe4V1Ist/uYj H+v5isde01nAQcPUE77GPN2aYudxmg24uUwSoyKCsjM//ueSpjBodcZN4B55mcedlw56 3k6f8+16qhIF5BzQZcFF/Nqyg8sn96TW6nVezl9+8p+DMMZEX0zN6E9tlPBEHDTw6bJe iLyOgZ0DNR6GRR0DkJKhw2rGtVlKfwuH1X5OW0XCBPQVfE294RnfKgOLP7XWQLevvGqM YQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92s71e5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:42 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F8qUA6015081; Thu, 15 Feb 2024 08:57:42 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73ts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:42 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDd3033748; Thu, 15 Feb 2024 08:57:41 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-8; Thu, 15 Feb 2024 08:57:41 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 7/8] cpuidle/poll_state: replace cpu_relax with smp_cond_load_relaxed Date: Thu, 15 Feb 2024 09:41:49 +0200 Message-Id: <1707982910-27680-8-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-GUID: yJ-iS1FTL20fHuvoqISXh1LxTLdGOEcN X-Proofpoint-ORIG-GUID: yJ-iS1FTL20fHuvoqISXh1LxTLdGOEcN Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790954959757226205 X-GMAIL-MSGID: 1790954959757226205 cpu_relax on ARM64 does a simple "yield". Thus we replace it with smp_cond_load_relaxed which basically does a "wfe". Suggested-by: Peter Zijlstra Signed-off-by: Mihai Carabas --- drivers/cpuidle/poll_state.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index 9b6d90a72601..1e45be906e72 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -13,6 +13,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { + unsigned long ret; u64 time_start; time_start = local_clock_noinstr(); @@ -26,12 +27,16 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, limit = cpuidle_poll_time(drv, dev); - while (!need_resched()) { - cpu_relax(); - if (loop_count++ < POLL_IDLE_RELAX_COUNT) - continue; - + for (;;) { loop_count = 0; + + ret = smp_cond_load_relaxed(¤t_thread_info()->flags, + VAL & _TIF_NEED_RESCHED || + loop_count++ >= POLL_IDLE_RELAX_COUNT); + + if (!(ret & _TIF_NEED_RESCHED)) + break; + if (local_clock_noinstr() - time_start > limit) { dev->poll_time_limit = true; break; From patchwork Thu Feb 15 07:41:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 201287 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp262548dyb; Thu, 15 Feb 2024 01:03:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVXFM9TcivzE/zc9CTKAXjnQDycj7uxoMtDa2HxDPuQcl04DIigrA6c/u54z7TKRq3Jg6IvVLwSw9PvZU0q+izn4m1zTw== X-Google-Smtp-Source: AGHT+IGC0PvwSNmCi9SI/hT71DvHUJTdcQIE6U/C1NCP/wOZGRbF0cO/6e3V0WN7kwKGh0dnmlGJ X-Received: by 2002:a25:b1a2:0:b0:dc6:b817:7f87 with SMTP id h34-20020a25b1a2000000b00dc6b8177f87mr1055084ybj.22.1707987797735; Thu, 15 Feb 2024 01:03:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707987797; cv=pass; d=google.com; s=arc-20160816; b=Jl59iEHxrchj0p21kQgI/HuXNUhg6y+ERISzEbdGcQt5VnNfhJKRIdk1BugEtTm6Eu SPreVLDeo1fRggWdk/TbGKQHxQfAhohJ3VjzfbofXiNgVZ7nXxg5hD1GiAiV0iaohkCL Y4sWY0SzU8lorGUskikRDOmYZx83paYceb5WAhRdmeJGZdSSBswMATfXmLz1PDA4MoWb MS1jzobg3umuCoWINlDjVlw7CEOJUOL2pArzlGH+hHxhYrxbd1cboBm+fFxAiAy2BJUx 2f4p3A+uvUQwxlG6CNuQxHRNNkGX2Eje9LdpuJUqnPta0r1hEsElOrWM629Gesjzupvg pjKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=6KDNlbJKwQaVVi8iZUM/SOJEGq248dU9EixloG0v3NY=; fh=cS+D6/15hJDwIQ5zbz5Bx0CwkimikQX+QlxAa68UNgo=; b=0UGDvY76Wyf/zDQYhz5lO3OJH9Fq8uJpZMacdcj/Sr+Vnc7y4LNO8nOyvBKr7yQhLS 2DenCxmKboXRV10a2ts1EwHJCmmaOaf6uCrvU0e1rgbzqOt9k2YkaOMoMPmn+Mz23ZZi Mlke0hPH3PZQ0AJ6nfQAhRil8G3NToiitY4/T5A5a/oWym8LuTT2qHKJZ/MhbgJvyV7G Qbz2J4nd9ATJRe+bMVbZjiFemftweOHHms78eLqyv7nYnIrWU1JXf6YahWg/OlB9E0il cs1tr/p2BueGR2JrbG5rSkCDi1SEZxBqqYsZex1RB06cf6GXuh370Pcp6k8hy04Ozun/ bhLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="l/9auz30"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66476-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66476-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m28-20020a05620a215c00b00783ebb7fa28si1060570qkm.316.2024.02.15.01.03.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:03:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66476-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="l/9auz30"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-66476-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66476-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 75D301C21951 for ; Thu, 15 Feb 2024 09:03:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10C8021A0B; Thu, 15 Feb 2024 08:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="l/9auz30" 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 8C6F7219EB; Thu, 15 Feb 2024 08:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987507; cv=none; b=gh5iIlZnuHOYJU/b5NxKISPbo13DhAYrFGPbHq7RI6Ot58jbnBSJg7QskIv0c9j5ejxcQw6RfqkAe2eIa7AOHuUyxam1qLPtCBvemwtID8uh7O/j/wRKh+E7K9uLqQN2Cq+yKj1tK0x0jGdKluvYZNqU5YdKqNAaJ+9AHfA7VN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987507; c=relaxed/simple; bh=taIMkmgjssmhEC0ZPe6RFUXMNpIm1p4svqj+IoHOQQ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=KFdBNGqUKCfUyl9VBj85pNH3eJaxlMDnb328T+AGhV+aha+cfArpTGqeQBhZ7tEqG4VpmVkCa4EYrGvGvFX5N9zSlVN5iKwi0kIANixOE34ujnkseMURWdaBy9CjEHXEXGOU1gDQdSu7D3pC0xWACkJwNh9osTfqaXn7FtRGiss= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=l/9auz30; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6icwN032668; Thu, 15 Feb 2024 08:57:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=6KDNlbJKwQaVVi8iZUM/SOJEGq248dU9EixloG0v3NY=; b=l/9auz3098bmaqsmPhx4befqpe7lUC7sQOXfkoPnsyctLv1Mn2GvtGrEEonNUz/PRSbK vkoPUnDqB5/H1Lk/xiL6Lc4SqkVXy7tfnjLgoenQFTXxoazXYiJbiBRxjYk2nnH5T4Rq HhbT71dBV/BV4j2Wes908/FuKQwl6HyKQh0F5RTCQRhT1RuKJgGGBHNKvfC/BScXz9JZ 9frLvvg3KxAX9Bl1nZzTkXX4Iwpbgg80Y642hf2JK84tqnFcGXsgTYTi1rVsZuxLisB+ jF2cGjfsiR8pT25+Oq2XdO/lPWQtElYb/JAjr1I+equ0+Pqtn/ClljB17fD/Pp9uB7oe Mw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91w6sm14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:46 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F75mac015097; Thu, 15 Feb 2024 08:57:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka73wa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 08:57:45 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41F8vDd5033748; Thu, 15 Feb 2024 08:57:44 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3w5yka73cg-9; Thu, 15 Feb 2024 08:57:44 +0000 From: Mihai Carabas To: linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, rafael@kernel.org, daniel.lezcano@linaro.org, akpm@linux-foundation.org, pmladek@suse.com, peterz@infradead.org, dianders@chromium.org, npiggin@gmail.com, rick.p.edgecombe@intel.com, joao.m.martins@oracle.com, juerg.haefliger@canonical.com, mic@digikod.net, mihai.carabas@oracle.com, arnd@arndb.de, ankur.a.arora@oracle.com Subject: [PATCH v4 8/8] cpuidle: replace with HAS_CPU_RELAX with HAS_WANTS_IDLE_POLL Date: Thu, 15 Feb 2024 09:41:50 +0200 Message-Id: <1707982910-27680-9-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> References: <1707982910-27680-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_08,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150069 X-Proofpoint-ORIG-GUID: dNXyji989GyJZ4dchNZTScxbHZCJTiW7 X-Proofpoint-GUID: dNXyji989GyJZ4dchNZTScxbHZCJTiW7 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790955012997354239 X-GMAIL-MSGID: 1790955012997354239 Replace ARCH_HAS_CPU_RELAX with ARCH_WANTS_IDLE_POLL for clarity as it controls the building of poll_state. Suggested-by: Will Deacon Signed-off-by: Ankur arora Signed-off-by: Mihai Carabas --- arch/Kconfig | 2 +- arch/arm64/Kconfig | 2 +- arch/x86/Kconfig | 2 +- drivers/acpi/processor_idle.c | 4 ++-- drivers/cpuidle/Makefile | 2 +- include/linux/cpuidle.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 5b2e8a88853c..e7659a3a7d58 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1363,7 +1363,7 @@ config RELR config ARCH_HAS_MEM_ENCRYPT bool -config ARCH_HAS_CPU_RELAX +config ARCH_WANTS_IDLE_POLL bool config ARCH_HAS_CC_PLATFORM diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index bc628a3165eb..7c963f7c10e4 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -107,7 +107,7 @@ config ARM64 select ARCH_WANT_LD_ORPHAN_WARN select ARCH_WANTS_NO_INSTR select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES - select ARCH_HAS_CPU_RELAX + select ARCH_WANTS_IDLE_POLL select ARCH_HAS_UBSAN_SANITIZE_ALL select ARM_AMBA select ARM_ARCH_TIMER diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8c4312133832..90f5d16be8c0 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -73,7 +73,7 @@ config X86 select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_CPU_PASID if IOMMU_SVA - select ARCH_HAS_CPU_RELAX + select ARCH_WANTS_IDLE_POLL select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 55437f5e0c3a..6a0a1f16a5c3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -36,7 +36,7 @@ #include #endif -#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0) +#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_WANTS_IDLE_POLL) ? 1 : 0) static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER; module_param(max_cstate, uint, 0400); @@ -787,7 +787,7 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr) if (max_cstate == 0) max_cstate = 1; - if (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX)) { + if (IS_ENABLED(CONFIG_ARCH_WANTS_IDLE_POLL)) { cpuidle_poll_state_init(drv); count = 1; } else { diff --git a/drivers/cpuidle/Makefile b/drivers/cpuidle/Makefile index d103342b7cfc..23f48d99f0f2 100644 --- a/drivers/cpuidle/Makefile +++ b/drivers/cpuidle/Makefile @@ -7,7 +7,7 @@ obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o obj-$(CONFIG_DT_IDLE_STATES) += dt_idle_states.o obj-$(CONFIG_DT_IDLE_GENPD) += dt_idle_genpd.o -obj-$(CONFIG_ARCH_HAS_CPU_RELAX) += poll_state.o +obj-$(CONFIG_ARCH_WANTS_IDLE_POLL) += poll_state.o obj-$(CONFIG_HALTPOLL_CPUIDLE) += cpuidle-haltpoll.o ################################################################################## diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 3183aeb7f5b4..53e55a91d55d 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -275,7 +275,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, } #endif -#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX) +#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_WANTS_IDLE_POLL) void cpuidle_poll_state_init(struct cpuidle_driver *drv); #else static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {}