From patchwork Wed Aug 9 11:39:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2793652vqr; Wed, 9 Aug 2023 06:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg7YMjmOm4/FvE9FUzjZSSyS5kZXxYKmMCH/0vUc5VcyN8r3El1DRtJXBzgNWbUdtucrEf X-Received: by 2002:a17:90a:7e12:b0:268:ef84:b0cd with SMTP id i18-20020a17090a7e1200b00268ef84b0cdmr2056655pjl.18.1691587008061; Wed, 09 Aug 2023 06:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587008; cv=none; d=google.com; s=arc-20160816; b=qUkDzNbbZ25ybMHBGUiNmMZK+8Ylw3schja/HzABcf5r7D7zxX/a8UlGbzIJkR19vu WcWs6OV279J0TlcYZ/cZq2awvqSQHnyyEmKd6pKSNMAlMqGB5uc3mLkrFpwA8MBuHz9w jKpAZhixKmO6b8JdzP+tIBgyVc0OvpuxElatlmi9fnSXWBICpslZ9CQ6xd+q7HbWCj5E 3yyD79lyqw7SJ/sj74xSq5sK2rI0EkwYSb+Kzd3dHWARfTilKG5FKFI9atMY/rZUXPWQ kfbSK6Xz+CAOTwlMUEc0bp8i0LYX97VWDcOanbxZ2fGSIZmqjgFMB9TyMKxkJqbNxvlW 58CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature; bh=dp9iFGt1DI/ZFnlFyKZMqYY2pB/jjn5nTppwpN2N960=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=fWDsNPJzQa7qmMmhE1HxTHxCtuo1wk79lP2dCcz+ECRSJEuOssGD7Puf4VjvNWZNDS 23BB0HE4PqEl1j3OZAxvI4aqlz78tKuX+/+HxWgFQQrm4Q5GsoY8dOzy8Wr3pVNDjfon GRJ4moPbGUHjrHrFPMgWkNHMsym0/GIB0gs2MziME7dSw6hak13QurKWWbUX7FDLlE29 /3nXw7MImKuhd4GskbMe3mlyxTEWbZgbylJI5ofmkNLzf4X6HxZKThr6cTGhrfZ+hTm4 uMY2PaAc8hPuWDVClAUv/B+epayOFPCWARmaRyAE6YfXPhM9LnkuhEE340M6QZUlZRFo tEjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=LxqfFgtK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu10-20020a17090b388a00b0026800178358si1504518pjb.144.2023.08.09.06.16.33; Wed, 09 Aug 2023 06:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=LxqfFgtK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231687AbjHIMyq (ORCPT + 99 others); Wed, 9 Aug 2023 08:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbjHIMyo (ORCPT ); Wed, 9 Aug 2023 08:54:44 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB8E7210C; Wed, 9 Aug 2023 05:54:43 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 379Crh2k014123; Wed, 9 Aug 2023 12:53:47 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-03-30; bh=dp9iFGt1DI/ZFnlFyKZMqYY2pB/jjn5nTppwpN2N960=; b=LxqfFgtKjIDW0eCxIidQcPxwSkuKyc1/tyjk0jAYlSbPHyclu0IvcG3HIlPWFOq+BWsY 3L2TpB08jc9oLxCnHM0DFtJR36EVKEmsTJdwBblFMLSUf9OGHruRFFXtqRn3W2lfpaCu P0s57uVdUfyx+b2IEI2UHR8z37d55O8SPxTkvwOi2rSsNwDGBV0YKrPeuUoK6lYO0t7Z VfMtVULJQwtRJB+FqOesZY2iGkuai8t3RUWrEh/Ni6Ik9LUhj1Eo6TYsaX5G8jWzTIht vObCOL72JkWMaY0vA6QqJ/PaoEvNxpthYrtYBP/JiM2uj5Z80SeyHo2kCt8Z/bkuAY3b ug== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9d73gjpj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:53:47 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 379CKgs6021507; Wed, 9 Aug 2023 12:53:46 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdygp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:53:46 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 379CqCGL027258; Wed, 9 Aug 2023 12:53:45 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-5; Wed, 09 Aug 2023 12:53:45 +0000 From: Mihai Carabas Cc: Joao Martins , Mihai Carabas , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , "Rafael J. Wysocki" , Daniel Lezcano , Andrew Morton , Kees Cook , Peter Zijlstra , Petr Mladek , Ard Biesheuvel , Sami Tolvanen , Nicholas Piggin , Juerg Haefliger , =?utf-8?q?Micka=C3=ABl_Sal?= =?utf-8?q?a=C3=BCn?= , Arnd Bergmann , Ankur Arora , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 4/7] governors/haltpoll: Drop kvm_para_available() check Date: Wed, 9 Aug 2023 14:39:38 +0300 Message-Id: <1691581193-8416-5-git-send-email-mihai.carabas@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1691581193-8416-1-git-send-email-mihai.carabas@oracle.com> References: <1691581193-8416-1-git-send-email-mihai.carabas@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_10,2023-08-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308090114 X-Proofpoint-GUID: JNuNSRW3VUw9SQHkXuGjtM0f2OfpL4K8 X-Proofpoint-ORIG-GUID: JNuNSRW3VUw9SQHkXuGjtM0f2OfpL4K8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773757538663194942 X-GMAIL-MSGID: 1773757538663194942 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);