From patchwork Wed Aug 9 11:39:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2793674vqr; Wed, 9 Aug 2023 06:16:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwmOQ0MxyaL/KlUKrF9+/Yew6iGyq9ZQyfBeFwM2H7wYCAvrVktgG2TZkp/3Tv09kvGurq X-Received: by 2002:a05:6a21:3291:b0:135:8a65:a772 with SMTP id yt17-20020a056a21329100b001358a65a772mr2910297pzb.50.1691587009983; Wed, 09 Aug 2023 06:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587009; cv=none; d=google.com; s=arc-20160816; b=p1g8UTts8uskIg7PAlsl9jUmjR/ApN2G0h9x10SMCtT+OEtAtV6QAxV78QsYz/216Q EEjU8jIQUJ2PI/cdLVURTBpu30hWSQu0EKETvIGekrBLvn0vkHQd0naZ7BzYl2IW1vtF 6emTw24WtnAqCCEy55wg2CO3xWKFSbaQ8MSqjcPyyVCb64kWthlWp0DrVCA2DV0Zv+Jo 0aQ7O3zr9/OPTHPsnj6ZdLHh9rdhAO+E9Sz2M3GhLtLSokyaX6kNqahKMkGAydREip74 x1aHpyel9goXnm23B8cMNfwXYKvBkPNr/wbYTAVXR1bNoXjC3u6h8uCC++hpbrKossWU waog== 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=0QZsX2jbO6id/iaRRnv0TmxxvvP8rcGnUdjnrbggVeE=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=GLCPtQP6ef3pqM4h1U46T3HemuHy4nk/b8U9iHFvs5ck82b17Pnnzoqe29FZLCs5yW bpyJ8dqKWwsO4yP99Mtj3qW2SJOiQHSaBSS8eksjU3/jX4U1ZvkCuJaHQgZiuaVabVyO uwETGdqy/1iia0HWRAoD3jwbzjAQCL11aNC+oq1GAjGd8xmuuytaSFVmhUuu02DUfBRk 984R9ko7Ikwk0BQHRbliGc81OBqBc8YIiuNLAEhPawXNk/HnCTSJAH5mS3yxD/dt63Kp zYyBZcbhmy6I/fKufqxigfPXpHnx/ekW5c4jbaRgyGxeS3p/smEW3XLkpqCtdUEUVCyV 8iVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=EHPw1hrr; 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 q12-20020a056a00088c00b00687071384a7si7398517pfj.152.2023.08.09.06.16.37; Wed, 09 Aug 2023 06:16:49 -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=EHPw1hrr; 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 S232223AbjHIMxz (ORCPT + 99 others); Wed, 9 Aug 2023 08:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbjHIMxy (ORCPT ); Wed, 9 Aug 2023 08:53:54 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DEE42109; Wed, 9 Aug 2023 05:53:53 -0700 (PDT) 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 379Cpatv031355; Wed, 9 Aug 2023 12:52:29 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=0QZsX2jbO6id/iaRRnv0TmxxvvP8rcGnUdjnrbggVeE=; b=EHPw1hrrhg1yTQEwYhDBLlnh0EFQdIXvnIdONYKFcH9mYEL+H58uVVEOZmnLxlgW2WiL KYhi4J0qi1VbdPagCMKL8BXbli2efIWvj55uO62+moCIcT7oJRGQSytHMV71FYB8Rp9k XWN+ppHZw6i1S9MtN5By2iGfrY/tZX0iBDcur+hS28ldrouHJdsw4BcLNavlyo27aJOs kQPMQfXBxtEbvpKLELqcsuqSRIIA4RIWE7nWPiw5GB38ce1dFJGXb45E7IryGV937wIv rYywDyGInS8ZTAYIaEzTigl80IezjPngwcTeDwInoY6oUzlAy9W4gLiiWks4/yHhUCS5 /g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9e1u8gup-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:29 +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 379C0l5O021712; Wed, 9 Aug 2023 12:52:28 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdyfg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:28 +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 379CqCGF027258; Wed, 9 Aug 2023 12:52:27 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-2; Wed, 09 Aug 2023 12:52:27 +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 1/7] cpuidle-haltpoll: Make boot_option_idle_override check X86 specific Date: Wed, 9 Aug 2023 14:39:35 +0300 Message-Id: <1691581193-8416-2-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-2308090113 X-Proofpoint-GUID: 12Ohs6U9gYefr7PsRh_c7KrFj31d0E8M X-Proofpoint-ORIG-GUID: 12Ohs6U9gYefr7PsRh_c7KrFj31d0E8M 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: 1773757540166447917 X-GMAIL-MSGID: 1773757540166447917 From: Joao Martins In the pursuit of letting it build on ARM let's not include what is x86 specific. Signed-off-by: Joao Martins Signed-off-by: Mihai Carabas --- drivers/cpuidle/cpuidle-haltpoll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index e66df22f9695..0ca3c8422eb6 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -104,9 +104,11 @@ static int __init haltpoll_init(void) int ret; struct cpuidle_driver *drv = &haltpoll_driver; +#ifdef CONFIG_X86 /* Do not load haltpoll if idle= is passed */ if (boot_option_idle_override != IDLE_NO_OVERRIDE) return -ENODEV; +#endif if (!kvm_para_available() || !haltpoll_want()) return -ENODEV; From patchwork Wed Aug 9 11:39:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133252 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2802065vqr; Wed, 9 Aug 2023 06:30:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnVyu8G91YF3p/jgGJTE1heb23EXpBJwBGXP20k4zIQTEcRmAYkkaOiRLH4/cpZ4Wkl16l X-Received: by 2002:a17:906:311a:b0:992:ef60:aadd with SMTP id 26-20020a170906311a00b00992ef60aaddmr2817872ejx.13.1691587844178; Wed, 09 Aug 2023 06:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587844; cv=none; d=google.com; s=arc-20160816; b=I/a5dw7OOliJnnT+ZeEHNLmy6ioI+qIqMi2Q1w2c7xoTOJNDAVLMRb0CoMl60xbLls 20BeJ+z82XyuNPRj730AaubzSI4sWkvbhKQGF7OWZ8hBSlzYOWFdFL+7ubI0CtrLulAc xA9dt5f7heqyiuOp1CPV2Cw26TW06iQ1+whPWZtAXMqbg0j4pjFNTHe7O9ybIWa6Z4/9 za2Y7irZ73RtCHBuEUoglAKlc8MNSsfi1tjyb8+if3QLShoF2I0w1B/Sb0BHan5Vjiy4 vL9r8j14WwsDMyTgMXxnDmBX8JM/NmBYlKLVAk3buDSDCTGrWjYpls9C76/9XAE0Dxub dZQQ== 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=YyWezMMwGxKKB/jHDRJjdl65qr6ALhU6yWW29edlye8=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=Vn0fyOV1eMI/+tdN7imFqLm5cmuMZJrAkRa7dXJ2qaQ2WSrZ0hj/5MwkyndCKjbydD Zs8qgc8837bZ5ZIzX6rDa8aD6eALp6PADV4DgaFrY0dWnr2RgJhirrOY4anzItTM5LH4 fLR5oQr2ESIRpNT95mw7TU4PiVwzWJZDVuyJpSMc5y6qjoFLt60NyOSpJO9DIeQbBlFK ml4UuD+jmQN/+V4X+NLEZJ29y3y0qe/32Dh6LVAItS2Uz0E0dwdZ5EvDM5leKniiRAyc he/AS4D2n1ISr3yHYx99VRK/FlgO+Z4gTNnKa9/TvisQCgTM++ONakJesSIEOfZUbzkO 6RMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=bmegIjY8; 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 sd2-20020a170906ce2200b0099bd8bc3fa2si8530615ejb.530.2023.08.09.06.30.20; Wed, 09 Aug 2023 06:30:44 -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=bmegIjY8; 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 S231768AbjHIMyE (ORCPT + 99 others); Wed, 9 Aug 2023 08:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232482AbjHIMyB (ORCPT ); Wed, 9 Aug 2023 08:54:01 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D15E4210B; Wed, 9 Aug 2023 05:53:56 -0700 (PDT) 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 379CqAuO005726; Wed, 9 Aug 2023 12:52:44 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=YyWezMMwGxKKB/jHDRJjdl65qr6ALhU6yWW29edlye8=; b=bmegIjY8aMPlI4TWlQ/gNw8pjim7vrfWelPOfnM2t+JThbO6nJTLoKR0g8SCs3qV1slJ 1odS4WeNNznC/+PMRYtr+PKFc3HGlUVguNEaHs3qjfYcnfq1OHU5wCLzjb33/tz8GyXj pUNQw11w6jrpduEEF8xucDO5fx0iVH/TPFvaK/El7whNOBRoRhv4VKFXYAFfDzKogLs+ BrzNj9FLiUI7+iurRsTJC9EmazJO08l8DJGTFLeK3zFyKtu/A7aBbX1Zew9wmZfu+Q2L BTsZ8REi7SfemKhjSJFDrqfJ9nvdnJXLnuzZ626Eg9V8YMZFMPDMwWDtd2BeHXNBpYqy yw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9cuerfv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:44 +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 379BXdcG021556; Wed, 9 Aug 2023 12:52:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdyfp8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:43 +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 379CqCGH027258; Wed, 9 Aug 2023 12:52:42 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-3; Wed, 09 Aug 2023 12:52:42 +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 2/7] x86: Move ARCH_HAS_CPU_RELAX to arch Date: Wed, 9 Aug 2023 14:39:36 +0300 Message-Id: <1691581193-8416-3-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-2308090113 X-Proofpoint-ORIG-GUID: xjNwmyV8x9M_ei9YNJqnuMKodw6deQN5 X-Proofpoint-GUID: xjNwmyV8x9M_ei9YNJqnuMKodw6deQN5 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: 1773758415644087076 X-GMAIL-MSGID: 1773758415644087076 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 | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index aff2746c8af2..31bd138f406d 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1371,6 +1371,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 7422db409770..2eab3be6abbb 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -72,6 +72,7 @@ config X86 select ARCH_HAS_CACHE_LINE_SIZE select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION select ARCH_HAS_CPU_FINALIZE_INIT + 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 From patchwork Wed Aug 9 11:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2802286vqr; Wed, 9 Aug 2023 06:31:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHD83/Dp6+zkbmDfiK3lk0y71cuaAIifDIqOzA7Xf6+MMt7G/NgAKyJ5KkhBc/TaUhHfid1 X-Received: by 2002:a2e:9103:0:b0:2b6:cf0f:1fbf with SMTP id m3-20020a2e9103000000b002b6cf0f1fbfmr1884203ljg.42.1691587861720; Wed, 09 Aug 2023 06:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587861; cv=none; d=google.com; s=arc-20160816; b=EiFlDmZ5Ec+WTsB5Sgt3b1yDbc8/r/ldvVV4yOOEIRMeJLvKtQd7vRjK7AnQZ1wAAM cQonCsrLso6VeqquuUkIZQRPsnKIT5yqJzYgTgcKaAToHnJUyF3zGOR/KciiVdBTEXFP nCBhnql473oF/lVQ09r7OLu+aspNgTwqlrHbM/8U/vBuu3LYSvMMN+qH29NlbGJz1w6M FFnmW5Ilu93sgwRgDZ+piWnTS9dN2gFD7dHFFHSUOk6Lh+T5p2xcxThmVn7yVHyu74pe OES1/Rqzpj70pJUSGYcbIHCVssJ4fmDLKSXdVs0jVWbtC2khm62XjZX+HgsPDaI26qEu 8ArQ== 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=4x+zE4hQtUzx7DvsxU62TsC9MtAa7FotAn6Rbv4QSws=; fh=0jFi7Lu4NMUyo4e/+x3IX0TBqq/3sSWuUfDA7G5slOU=; b=wfRO3UEx6AE8/665UpHn5SxjXIpXhE7ixI3NawDZcIVxnULwBRc1XXjYVDdb80lptk fpRFuNir0T9TtpqkWeC8ju1HvVYuA3bt6PqjKaPdx8LxOGUx6hdVPjSI+ntcHZjhkw2Y idSdDOQD7qa4rMIiWru7T7TbQXiP/mRde9bS2yek9gdKOfpHbxLUhMr69yp/SXOJnfSZ 5YZsrY1r2lIxSzgTZGQLtvA2kkl+Az52sy+gCa3J7X/g2hilKTLcRJWzFBhs0bMpqvGc SeuMwmca7gjvft5GRJO6SkqG/xaoHRKq7UaIlwnlskXtdy5TbFo6CrF+AWnLj+gRFqW/ Z6XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=s8vkesQl; 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 g2-20020a17090670c200b0099325564b77si8720113ejk.548.2023.08.09.06.30.37; Wed, 09 Aug 2023 06:31:01 -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=s8vkesQl; 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 S232716AbjHIMyG (ORCPT + 99 others); Wed, 9 Aug 2023 08:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbjHIMyC (ORCPT ); Wed, 9 Aug 2023 08:54:02 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D642F2122; Wed, 9 Aug 2023 05:53:58 -0700 (PDT) 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 379CqBJ3005733; Wed, 9 Aug 2023 12:52:59 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=4x+zE4hQtUzx7DvsxU62TsC9MtAa7FotAn6Rbv4QSws=; b=s8vkesQltMGztBt8U/Sn8oCyOJoaMWgkXjG0sdvIljOLPU+A90hZgOGa0RGeQ0gsWG/u henwl5geffvsUq3Gz1gOpYYXuS+l+qPn/q/T8CwJ93S5ALoTV1boT8Mcc/Yvi5hvdk5/ ERNgVPpCfFOpQJeXI9q1v7xo/9MHaZxFStAatnpa2344tObkh9CsezfwhB8DpuJcRnvs J7X23Z4OUeEJ3Mvaf63dqgc+yLYw3CAX10nKY9YsBD5pCudZmyZLvIJ2xaKjc0ccGu/N 7NKY+ZK8zzMU5fI79j5uYZ/RJiKjVDhXEtRdENi32/xqMFNYZDDgb7LI4DJLs8wSY4QV Og== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9cuerfvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:59 +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 379BXdcP021556; Wed, 9 Aug 2023 12:52:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdyfvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:52:58 +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 379CqCGJ027258; Wed, 9 Aug 2023 12:52:57 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-4; Wed, 09 Aug 2023 12:52:57 +0000 From: Mihai Carabas Cc: Joao Martins , Ankur Arora , 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 , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 3/7] x86/kvm: Move haltpoll_want() to be arch defined Date: Wed, 9 Aug 2023 14:39:37 +0300 Message-Id: <1691581193-8416-4-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=950 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308090113 X-Proofpoint-ORIG-GUID: Iz4AGH0IRJb3G1PZ_b520EPEYVR2M_ZH X-Proofpoint-GUID: Iz4AGH0IRJb3G1PZ_b520EPEYVR2M_ZH 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: 1773758433809045046 X-GMAIL-MSGID: 1773758433809045046 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. 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 --- arch/x86/include/asm/cpuidle_haltpoll.h | 1 + arch/x86/kernel/kvm.c | 6 ++++++ drivers/cpuidle/cpuidle-haltpoll.c | 4 ++-- include/linux/cpuidle_haltpoll.h | 5 +++++ 4 files changed, 14 insertions(+), 2 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 1cceac5984da..817594cbda11 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -1151,4 +1151,10 @@ 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) +{ + 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 0ca3c8422eb6..e2d4d78744ae 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -96,7 +96,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) @@ -110,7 +110,7 @@ static int __init haltpoll_init(void) return -ENODEV; #endif - 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 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); From patchwork Wed Aug 9 11:39:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2801758vqr; Wed, 9 Aug 2023 06:30:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG09H0pNU+A/oB7mBizIQvZcHFEX5zcA6WN/7PVQYhHKV6iHijV/AQnybw7J6C6GjUS4K8u X-Received: by 2002:aa7:d68f:0:b0:51d:fa7c:c330 with SMTP id d15-20020aa7d68f000000b0051dfa7cc330mr2493288edr.26.1691587818466; Wed, 09 Aug 2023 06:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587818; cv=none; d=google.com; s=arc-20160816; b=b48psH9X1fxx1YFgX29h9XnjVfFdR/MN9LqONF8+Y4wE2R/JfRs+oqeUpwLlrbwamj J0UHh+CWh0EgyjNi5TrxaT5JjcqcSnUeygB2LjD3V0CBx5BHHO0KMW8Tdc6IAjW2kaTJ jMV548queKPS8/Y/nTTBX1D58yNH4NOhHpC1kUnXmhf3tP4GgfDpAG0HOXF/E3YpMNdE Tj29IHIofvnge/2hHp+ocYXM/N3nnnt9uVlV2XsdfVmFQ0UKfTEUmthi59nQKNy7cENQ 74rvJzQuga3SfTHKus55zUkZZVLeHb3ULvAzYh9GF2vjcu0jwBsjlXWETQeGQVcJ5vRR +zEA== 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=F2lfrzJlWT849Hq5g4+oLQ9l0eG3oorZOJZ0GrdTMjc=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=T1B8U/irJJkWsAJhGlbhorIToQaZ2Y6JpFbjyG0DL44waEth975hCIiZBt+B5y3JwU 68kusKnNMd/8XXENouXEm7aq6FPb5ui54gFprXBi0ugm97Jw/wP+xUaAorH+zBEO4Rza T6svuEYMYvK1NP9H82zcJ6f3Gk90miDAsft8RQT1j3mIgyZ/RQApqkwoNtp5zf6bBw0F GyveOfVHveXdYQMsb8xKNK0L8XXLSxzpobnStKwWpiOJmIB83l3rdDD2LNUGH147G/iQ Q//TEvNAi5sClHTlvhZTvxlNxmmBqFB5z5rt7SO7mHSKeXAUMPu7WBDvI3+eVcU+gaKs ZeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=jyR98brk; 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 g9-20020a50ee09000000b00523282a8f4asi4729700eds.263.2023.08.09.06.29.54; Wed, 09 Aug 2023 06:30:18 -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=jyR98brk; 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 S232725AbjHIMzO (ORCPT + 99 others); Wed, 9 Aug 2023 08:55:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbjHIMzK (ORCPT ); Wed, 9 Aug 2023 08:55:10 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C00212B; Wed, 9 Aug 2023 05:55:06 -0700 (PDT) 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 379CrGlY007796; Wed, 9 Aug 2023 12:54:18 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=F2lfrzJlWT849Hq5g4+oLQ9l0eG3oorZOJZ0GrdTMjc=; b=jyR98brkXNH5hxIgoV/+lYc+OSjfV9SE3ZFD/r09ocUGAmabLsK6dmwhL9y3AE4YaWAB x7/e07+yEr1Aj3XJZgxf1MBoei6muNI+hVpAJkpjY62CGM31yrAL7U9rI52MS6MIw2oz LSyZS+w+k6lnaXDTGToO4aD8fT1bp9jvGeB5WD8KLICYENmK6rWQfZkJaHcPCmXhSvHN IREWCS2OV7Ge7cjfQQRxfWU84mctxrxbpevxeWIAcHbLRNkb5jbRlNtQNNTB3BBBg8OK ekZkXvwKjjPslzceBAJeQghleHHKbETZhKCakAYLIsmaR9yrnDBnA5wOsbGDNsys3z49 SQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9cuerfyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:18 +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 379CIABH021532; Wed, 9 Aug 2023 12:54:01 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdygxd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:01 +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 379CqCGN027258; Wed, 9 Aug 2023 12:54:00 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-6; Wed, 09 Aug 2023 12:54:00 +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 5/7] arm64: Select ARCH_HAS_CPU_RELAX Date: Wed, 9 Aug 2023 14:39:39 +0300 Message-Id: <1691581193-8416-6-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=985 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308090114 X-Proofpoint-ORIG-GUID: HUfDo3ON1mHD58lOUhvjKcDv8NUVytAY X-Proofpoint-GUID: HUfDo3ON1mHD58lOUhvjKcDv8NUVytAY 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: 1773758388314987534 X-GMAIL-MSGID: 1773758388314987534 From: Joao Martins cpu_relax() is necessary to allow cpuidle poll-state to be used, 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 87ade6549790..7c47617b5722 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -105,6 +105,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 Wed Aug 9 11:39:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2801827vqr; Wed, 9 Aug 2023 06:30:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJUK2cAbpvgIKCETd9ISTewIxNMYnvSF0eNR1fwNZ/mwoJiL2PnD+CSKjFzAuVaVwk4U4n X-Received: by 2002:a17:907:7633:b0:993:e9b8:90f5 with SMTP id jy19-20020a170907763300b00993e9b890f5mr1943078ejc.8.1691587825530; Wed, 09 Aug 2023 06:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587825; cv=none; d=google.com; s=arc-20160816; b=JA0JNTLxVm9BDzJ7GnIdRo4OL7Yh4nPlE7F+dOi1RydgjKt48bYXpt4rEn+rUJkSS1 ZHcM3FdsvtgV1SVHy6nmlSPd2fA7uqtRw4M9pvHjMTU0Re4JzheJL11YeC+tWs2Zo3UR QIGzWhlgGgk3v0AnnqZSFkNQ3QU0AjJPeBcSifq+swZSOb5WmVL9SKjxx8Dmf19ymHkD hSuv5ETcK/MloQwbVv9X9NNBpWguDo/sPCR0oRkKfdIiIAe1EuYXRSFVutQcsNG2qR2L sh8Rm8HTuSUdYlnuoHDObYf52Q0c+PYvyEkAHrUbKepOUMerzmEAwlqOPAVQo2wSSnco /NqA== 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=3CBdIWj34ZRhxUcc3rj18We/Fw9vZjncSXWx3xdqX8c=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=PyjAK5xAn4uZssUvd1Ke3T1VKNIMyTKBCueI1ykfMlc5axoESbrxkGQogPAov6/Uh8 cp7YIW8JgZHRPVTEFjot/3LaQAVNOP0Zk+++TN5sjBDfjhNNTTgve0tuzNIaJHjVQjmB +PbeexsDi0sM38zIyZLBrG/R9F8LSyH14nAqTQDChBIj5ilNtaHy6FAMPpN1VM3owH2E vCg+VODvpvHu/dYMOFk70XYSKlUGkx6C+6cRi9gryZtmC38Px3QKoeC22GThrC196OnG V7paJj7UAe9XSwPueuN+EEjkWjnZi0W241XIEm5uyrLaviHmp0i+GthW7aCbBUZZzESb Xndg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=jqUvKmcI; 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 br26-20020a170906d15a00b00992d8355decsi9455746ejb.249.2023.08.09.06.29.58; Wed, 09 Aug 2023 06:30:25 -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=jqUvKmcI; 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 S232749AbjHIMzM (ORCPT + 99 others); Wed, 9 Aug 2023 08:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232445AbjHIMzG (ORCPT ); Wed, 9 Aug 2023 08:55:06 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 435002106; Wed, 9 Aug 2023 05:55:04 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 379CrAMj003841; Wed, 9 Aug 2023 12:54:18 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=3CBdIWj34ZRhxUcc3rj18We/Fw9vZjncSXWx3xdqX8c=; b=jqUvKmcI0iRH7yyuqD+FJpXcehOvbBlaOcQ8ZTYMRUh2ISAX6kUZNU7PQno+4c4dIMRT Cc7b1hALhsNVK/4AT8wIWKeARWbjY6s7Fguqi/QXtRYHmlqSf5tKuckVHY1RP03iNOt/ 0zIOWxapVCetvWSMWAkGDbOzOBuDw4jxWtTj73DXFQ30fWgUxNaFoQvphxsWfTzeVJz4 eO6AkOG7sfCi3ezRVMLcCg5DLx/tcbusKx0/02KY4Zt+XCvnTjz1PvhoTDqT/YczDW+H xdLUzrU0REkQXNdtpV5CJBpr/44gOiVYYnW2+hCxwZB88wqJI6ZAVQneG1L6ggaV6Cef pA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9efd8mfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:17 +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 379CLjKs021450; Wed, 9 Aug 2023 12:54:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdyh79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:16 +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 379CqCGP027258; Wed, 9 Aug 2023 12:54:15 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-7; Wed, 09 Aug 2023 12:54:15 +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 6/7] arm64: Define TIF_POLLING_NRFLAG Date: Wed, 9 Aug 2023 14:39:40 +0300 Message-Id: <1691581193-8416-7-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=869 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: WCDia_qDu-gV8Dwp3ZO2w_zOHE8um58f X-Proofpoint-ORIG-GUID: WCDia_qDu-gV8Dwp3ZO2w_zOHE8um58f 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: 1773758395528611877 X-GMAIL-MSGID: 1773758395528611877 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 553d1bc559c6..d3010d0b2988 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 @@ -90,6 +93,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 Wed Aug 9 11:39:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Carabas X-Patchwork-Id: 133246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2801680vqr; Wed, 9 Aug 2023 06:30:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9+Te7tuBzoQARwAxBpApXTaVywu8c20r2WS9BangcdUa8oLxu8rbmEXwShybzxFT1prAM X-Received: by 2002:aa7:df03:0:b0:522:1d23:a1f8 with SMTP id c3-20020aa7df03000000b005221d23a1f8mr2090474edy.26.1691587811882; Wed, 09 Aug 2023 06:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691587811; cv=none; d=google.com; s=arc-20160816; b=ILMGzasmRrwS6U2B7YRA0PJP/Q8DvMD/5j5huVYYmJbHIGAyejlsGj78Okz85mGTxT 4e3fWtsQCchtYpoO2NIn/Zj/tgVfwo3CJApC277ZElK6Pm4e+GW8V1yzSP1FjF8CBWCR awIRya5Iz4c0cSssjKokCDV+dKVmJqbesf5dc56PMLDvUcDIumymKll9unQXcj8XZyGH 5M/e3oCvNwuUwGMR+QbPddtr3oHNDIPJmUS03Mah1Ee/KFqa4/TMUvflfLUR2e+atAJT yK+1A//vEAKwPIcAhLajKioXCa6gVpwY8PDoxvYSrfLD2OzxHKIVZh5C6WB9VjAOcplA lj0Q== 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=hlNIjt1lJtZP47W7eO4KvEIII2+KWpAFpv+PlhUsURU=; fh=4Nw8JGbfaJjHaiuIE0mktwMXM0BfTCTfVI0T+Yeb3UU=; b=bYxMPjpWxPYC5XeUXn2Km0d7vJXXOokS4+4ctLYJ3Njtkrl5G+LwufdjdnIKsbGNfR hZ+ZpI2KWvlFjY2/TkhEuJqJLg7SiqiuqHuA6NfNkJdGaXpsAWgXUUMJEPFeFo9RDxLv udE7TCeMrjGtuZ7ccKHzzj7jJa8Yp2aAlDG5GGMd/M/ga6m2YQunorgA3sOrBU+uhAom A31aQTcuIrdzaX2BqgawEr01fF/DicO4e8TE2wJc1/Cx+ZdSVZJXhGiFqC8uo1rl9L/+ SagmXE/ALbHiCM2YLp9Mx+hAwfZk9k8EtsSD1RqJFDcw2vs2ECBqVuE1D9sng/BzLxAH P8uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2023-03-30 header.b=ra4OJKLh; 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 i25-20020a05640200d900b0052237dfa831si7690281edu.541.2023.08.09.06.29.47; Wed, 09 Aug 2023 06:30:11 -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=ra4OJKLh; 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 S231869AbjHIMzd (ORCPT + 99 others); Wed, 9 Aug 2023 08:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232789AbjHIMzY (ORCPT ); Wed, 9 Aug 2023 08:55:24 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 096C3211D; Wed, 9 Aug 2023 05:55:20 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 379CraK3004191; Wed, 9 Aug 2023 12:54:33 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=hlNIjt1lJtZP47W7eO4KvEIII2+KWpAFpv+PlhUsURU=; b=ra4OJKLhpHJPM4lDoVZ1x++5xNqRV0jNJBHJDNetEGjeSCwfAlqwHDRCQXrNYYNmsjaV dgfvwOhhQE+2XvGHAGaLJ6jLzIJWB9SzDYT2qNYzlYYzL43Ye7jrhvnJqEt2I7qsCjKd cKjzSLk+VNqg+Z26UYx9lrNLsfmEDKDwkXHKopbf82OzY/Nd2InyytWijbIGXuxIhjlZ SmcLn5/GIlCRpW3uL1f9ULwWj/I+2DsUNoG6OsAugbU43SLODqB7fMi2EfKpHPPZ0h/o magYESnikUhl4mJREOEGcY5V3kDQRxA3wfTEYsmi1IXT8ePLvWMau7/F5DpaFo3fP20X og== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3s9efd8mg5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:33 +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 379CpGXw021492; Wed, 9 Aug 2023 12:54:32 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3s9cvdyhjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 09 Aug 2023 12:54:32 +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 379CqCGR027258; Wed, 9 Aug 2023 12:54:31 GMT Received: from mihai.localdomain (ban25x6uut25.us.oracle.com [10.153.73.25]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3s9cvdyf90-8; Wed, 09 Aug 2023 12:54:31 +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 7/7] cpuidle-haltpoll: ARM64 support Date: Wed, 9 Aug 2023 14:39:41 +0300 Message-Id: <1691581193-8416-8-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: TujCdh-4ZmyJLuERrr4PX2oao1-X7VtH X-Proofpoint-ORIG-GUID: TujCdh-4ZmyJLuERrr4PX2oao1-X7VtH 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: 1773758381801758317 X-GMAIL-MSGID: 1773758381801758317 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