From patchwork Tue Nov 7 21:57:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Arora X-Patchwork-Id: 13449396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98B6CC4332F for ; Tue, 7 Nov 2023 22:00:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E990D8D007B; Tue, 7 Nov 2023 16:59:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DACD88D007A; Tue, 7 Nov 2023 16:59:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B62FD8D007B; Tue, 7 Nov 2023 16:59:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A1DF38D0066 for ; Tue, 7 Nov 2023 16:59:55 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 82760C0B88 for ; Tue, 7 Nov 2023 21:59:55 +0000 (UTC) X-FDA: 81432526350.01.952C2B1 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf27.hostedemail.com (Postfix) with ESMTP id E2DCA40014 for ; Tue, 7 Nov 2023 21:59:51 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Nm3CUDkq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pUoY77pM; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699394392; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BRrX2dYuc/prXhp7fcx3fQvnR9baltRD3epzo2LIORw=; b=vb/xeMZyUZKo5Jxy8swsXozNaIy4MhGHaxEoIBQPEP2nO1lnzHa5O75Y+H3L4cnLO1UO25 R7QpGTzZzi4GJ7CHCrdJ8IStgGVFPKVHNgcwWZdyTxHAnZmZKJ7aHkL4syGcpTVIu7FTn3 512OE5591BOGRs3nCeZe1mZ3xUhMXrI= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1699394392; a=rsa-sha256; cv=pass; b=UgjKliNhIYkJulGxKJsRaC0mCxSv7V1NuZbzuZzBQOWBA7GkyOO/729DVyorsJGFnr0x81 Qsa6SlnO1AjMP/xXqfsC6nm/WksPt/f7gQfxt8678DDhYOtDRYjnvUilBYxAksqH45QTkD JaK/QZYaEGUzV/76dHqm66ZY/lC2u+A= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=Nm3CUDkq; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pUoY77pM; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of ankur.a.arora@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=ankur.a.arora@oracle.com; dmarc=pass (policy=none) header.from=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 3A7LJjiN005490; Tue, 7 Nov 2023 21:59: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 : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=BRrX2dYuc/prXhp7fcx3fQvnR9baltRD3epzo2LIORw=; b=Nm3CUDkqwTu+EpA1oPmfc5WXJvzwS/suCLC+Uj1op8U+vhdLQCqg3wLLwCbOaFG5dda7 E5HH0+FqFVp1dgzbx/gT8tpGHSdRbt5fl/ZbAu0nTOt9HFUYWfNf3jEBT4uht1cE1uVe LoWKVV2T4NFZtjbP/vyiIT85k4nBNnUUiFxiKNSyajQRL5f5MU2wLFAdcH7Xzg1OvagL +TQ6h8BvBLpXawQ11ucMhZvStT/HTJKNgHXFfHPHrNk+ehd/d2dQrFZlPB7WIP0PZQOC RzmFYKd6GTVedodLNwsu/4eTGONd6CzDyWQ7gD5K55Rozu1EmglFORH1CFjHfjhGblB6 kg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w23g2cw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:29 +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 3A7LIt9Q003973; Tue, 7 Nov 2023 21:59:28 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3u7w1vsjqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 Nov 2023 21:59:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JgySwZRCOjqZMlQN3bWspUSRwWFzIZLAJWirq3LVJj2U/fw3OjqY+OO5y0D+lJz7zgeeKdgeKADRBhmp7m68S4NE3TOEAG83CGYCbcAYOvLChGnPCi76MXOOJekqvT/DedF4h+lUeSH0Zmm/ydm6j6nQ8IrdIwsjq7/XCsE5qN5GC3ytZEnp9VUWMdRkP9MnUGHcmdYGCJOHGRwQMPOmRKs+qX8s8qrliPHkudyP5gphA4Eh/BIdFnCugFgz+haz/IIum29BY/lO8fCCc6iBSQLD5aErINiflKjnsfT2pd1Uaa+RlzZ9XkuUQA6iF5srTfyCYIGbBqiPqmGxu/1lnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BRrX2dYuc/prXhp7fcx3fQvnR9baltRD3epzo2LIORw=; b=Ep3X0SmXT39huIWz5vvog9aW1rpaxxy6OmGTeMS4uA+kL39tfDINt1/9fQCS3ZQo690V0V7tjuORz2vZZjCv1aI/8MrEU9Fbi74KXmB1JG7xQ1QDZY5GChAxt8uDvtjiiSmPoZFSkDhRaOJwK8SvgXUW7uJylnEPjgR/VdZF5Y3PrBgMpXecmxm9E1kL4r5Xie+7NMgUid6202rDwP36HCSC9nfN01YQIOt8vlHwz8/Lk7aV+5M+jGe5WgU2YFSad63ll0IqvSyYZl/AL1gjpDjvNqj/RMgLgXxVP7ieUqpC78Zaq9OYPkuqsrfI7QJ+dFvVql9SgtqMentOJsU86w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BRrX2dYuc/prXhp7fcx3fQvnR9baltRD3epzo2LIORw=; b=pUoY77pMZdLLLOnoYitJ3kkpqpl2J4bX51HiGpp/aUidH3viTn1lGezmnXVAeLiLe3z/vY3c1QIgoBKIyGTPEzvIu6O42VFKWHnTuO1pgcb9Tn9o8t/kaMCRpIVK6WYPtepiZ6BzK6RLF/uFzB11MXRGn1FEDzm2rb0K9prkzPw= Received: from CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) by CY5PR10MB6141.namprd10.prod.outlook.com (2603:10b6:930:37::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Tue, 7 Nov 2023 21:59:25 +0000 Received: from CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::1ce3:4a8c:4c99:acea]) by CO6PR10MB5409.namprd10.prod.outlook.com ([fe80::1ce3:4a8c:4c99:acea%7]) with mapi id 15.20.6954.028; Tue, 7 Nov 2023 21:59:25 +0000 From: Ankur Arora To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, paulmck@kernel.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, mingo@kernel.org, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@ACULAB.COM, richard@nod.at, mjguzik@gmail.com, Ankur Arora Subject: [RFC PATCH 33/86] entry/kvm: handle TIF_NEED_RESCHED_LAZY Date: Tue, 7 Nov 2023 13:57:19 -0800 Message-Id: <20231107215742.363031-34-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231107215742.363031-1-ankur.a.arora@oracle.com> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> X-ClientProxiedBy: MW4PR04CA0358.namprd04.prod.outlook.com (2603:10b6:303:8a::33) To CO6PR10MB5409.namprd10.prod.outlook.com (2603:10b6:5:357::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO6PR10MB5409:EE_|CY5PR10MB6141:EE_ X-MS-Office365-Filtering-Correlation-Id: cc5e03d1-507c-4ff4-4b3a-08dbdfdcce92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SbOaHlW3bXazlqZO5KgRFT26tVQyLgX4/uLPOWxL5zNMjE23eVLa3CGKs2V0TKYbjFVAOyXBZUi3liRWH98OnljZytVTTQ8DWStxGrn0KNRszSeoKxPU9x1efiLEeokhO2H4qZjJVLMLONKCn0/v0WPdeQux5XhaJMnX/3FAhAsab62ZxBT5jGR/KbsvrkXvCcjks5batbzMMfU4Vn+0b30cfNUdaztWZ6bQgmzmY9FMbDAw1d9BdG5uIchkW0EoSdt8j4H2t4BUn4FZeBdL1d25PV786TA43glVNBgpTK3/KNQiP6KEa6wmhQg+tq+EGJ3ghwvr78bAL08L7hYjIbf/bQsu2sYkh099okicZWOTilcInI+FA97gfcGI6nlMPJiq538be5tZHFehFGyEEFJLwLr1bx7xSlA4MYAkoh+2lhQ2xptoWRmkVBlwWA7kniwVQsT/nnEyAfYWyp0Qlu7fn//MKEDQL+O73Q5mNnyD649FGkPcsH9iAIJABkTCm+ZLam6/lCGK+0AW0CPTIhVopZeRcf+Fhyn4XYVZCUrAnMQyigP3+eTWgvAGtKsk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR10MB5409.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(376002)(39860400002)(136003)(366004)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6506007)(86362001)(103116003)(8676002)(478600001)(8936002)(6486002)(4326008)(6666004)(38100700002)(1076003)(5660300002)(36756003)(6512007)(66476007)(6916009)(66946007)(66556008)(316002)(2616005)(7416002)(107886003)(7406005)(2906002)(26005)(83380400001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: udbg9GDDPx14YM1VKbCYCfPj5nyscNc+sks3ITVvdWzwHYkCC47ZMB2TWWylSyjmY8h05K89IzRkWfo1EyW7CFiSHlPLauGahkaeq+9rPEFhy3mKd8+xbTrllj1rc2verMlCQsxEKkafZPO0u5U6ZoZtFeZ5wnflGz83KkNV/xeet8+8U3c15huY5I69zk6qX8z0geKB6wlpGg5cFQyIzMY14UB5KkOk2238/yCcpoKuoA3Bo9NLOmyWQZGZlGLyHSkpZ4+SMAsgFaw7uCCXjUOmlahu8ActvYDPwa74s8VXHcHnw2LbooSCKss3MHgZe1eKx2Ezdwi8tkED0NuJu7U8owwZEaMANOJqLbVsGyGeY60dLTwAR/Vjj/8RI82RLV1T3wbYSW+oRsgj1sUtiglGwY0VE+ciZVC8lgM/lCSbJQshoLIm3QipDoISll43gyMd9rys5hVk9n0MneNgT/hnPEgOwTbzRHLnZ2Xz96VD2EGqrgh/stEhWhBxeLOjL5YcktyosOPOB9JAkUor/KwbHiHXjkF/tIzQ0/W/7+moUhtyxtoHqAXySGugjgXQwP6U3d3zwY3jbzDpZq30AiD0opbgt/VVs2VOYFG/TqI/KnbIALX2noK9I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se7+8peUvpPjyWFEqU3plGoJXRelZXUWvIBmq3Fej+XApSQLi7CjxJWs27mLegpsThsfWLW7WWUmNJn2YS92fAKGA6rnB1LXVkP53/4pDsXepKVTxhhaPRdq+KCEcOKKvuLGozqazd0oWpd1whx7VtVKhnyZAma2UuOlUGPQoMqTr5ee2Ys/NJrSClydF7wxe7vq+uZx7JF1s4r9RBUhBmOfWTCs+WgZI2540aw1d/A9XEV5n9RrSoiWOKN3qMvXdfpQre6iBKW4LtwKugTt51LquIziLirBRA3egloXLdykOiIAX4AFehMRR8t0CR6kw9iL59ZIPsr5Z3NuFYmnYbAiqVmIvs7UCDvfFuAG7ldnjsaEIoV3Q/JwlQPoDJC8owyRp1EpN5uhSOoKXfts6snWHaEjSpDHUmNaNqqJVdr4ss8OwMHI+ThGap8g1PbObczyQLGTNlqeQvihHgQMJtFgkOkQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc5e03d1-507c-4ff4-4b3a-08dbdfdcce92 X-MS-Exchange-CrossTenant-AuthSource: CO6PR10MB5409.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2023 21:59:25.6053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GU/w1Byy4BTjU99GQQoJx2r8jfAVHXpKo0DI16pfh1GOgvEPN2AlpVxfp5DHbgAYwdFLhR5Ocl6JaAdnzrlDRFzh+8bavRErvoQi2/3mENs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6141 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-07_13,2023-11-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=685 mlxscore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311070182 X-Proofpoint-GUID: 8LIYsEx4CFEbCZXTJGr-E7wjx8Sw9P-L X-Proofpoint-ORIG-GUID: 8LIYsEx4CFEbCZXTJGr-E7wjx8Sw9P-L X-Stat-Signature: tpei15zia9hibeauqr3t59j98jtrq8nt X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E2DCA40014 X-Rspam-User: X-HE-Tag: 1699394391-877797 X-HE-Meta: U2FsdGVkX1/PnjkDqkthWwVtzK6LectMmcM9GKptSbckC/HKtmjdmDNMYSsPO6rzHJMcxh19TikZR3CdS2K63LO119nHPWXdo1PnuKhPZgadRvcsrcmKb/J5Ow8U07GgeBLXD0buJQPLQU/IXsDz412pPs3OPnGq5KSZy9UoFFUFvShYrhh5E5CwfB/NHvNWmvA+i936xiMaMPN8o9x6KVNOCJZYY/seuMP+eGW+jyctdSRbnfJIQUqIKu7Wa02IjflvxHKbKu1l/+hgB/oUu0r/7oANOO8zeKHVw0CzHBPTGu8aAoSXvYk4/52mNaF/8DjCcNK0reBkc54weUcD6yWslMAQt/2nVPAWWGJ7BLtnSkH2zteAVoxQ1d2o9f6/fbSKEThMuzVSNtH42lUwrPHi24WtEI1iVPR69TvP2D3qOlMaIADH52fFf16E3lF0tdNXAAeT3q8P+PpdwwYZcVLBfq7E1TqyyRXVOqsRiMwiPYuvXk/2iCcYUKCXfZ290eW4bK14MKKpcX6yBwtZONXrLdmbcAYZO6lzB1Ocmng5b9r0FgWdJ85QH9tHwaSof6TcwBxWtLlj/p9CAeRhatHDTcNyIJHTSD9rDIgfPCJIvuw+YWw7mhFfj5rSpirYsfWq+SMsaA4EXpz+FqGgfNkKb35VLTfghD6lcV2Gb+lPkEbvGpYHtptRk+QKuKn/4SOGBjC3r1SaN0p6R0pU5r2oZczbAtbacagwOlCiXnhE/cNHSwWgmPxTD4Eg6x6sbWqqpzJN09lV6CI+KzXAJ/2MzaNvt+xYwB37MaSbl8D/9MsQ3xs/jv8/Y2C0O31x21gJdhFMu5qqxVMtM1YO7xak0Sw3cfngDxDaca/daRhY6257m/aln8FC15M9naduq/yRKR8iPGxIlUNJw7qKv4366sqErAgntxJgfum4333Nzj7WM1INbebsRMt1/ILg2xdKbaueOUDFxx2dnHK Ah1UQpl0 jGRKd1Q928cU0jVEuEBzl4lZQjo2lJFcPkw4thqeqbjQjd01DhspZsniml/nZ+lKBriyZj4KwnnYq79PnisEa+NW4MjZh1XNLHAaPGPMyzwGZyV0PUPRFkCwno4AmMJFact3NiEt5bCKcSdlvcqafaIcJsvaLPKFN/tP2t5shqTrYadptxY4hiK3zEW0+imvSEIbgdoYMBTUl7dQBaJlUKnXsEnwrjs9wbcYXYSiCrCrHHQRplxUcAGPekEvlpbB7KEEbgcA5AhZSYzZ9LEBLu69as0Zc0o+fcmfsT54x83t6XY7RLhP5bhnP5y05RwAaGtGJZM7sVzxUaiO0RchxZUh/Nd4KWy5yeQW1a//AUAq6ImiKNsQCPRBsrkvtDQr08I36G5FZuowFu05BBenCUIqbNASh6JMP83Da31T69qb4NUker1Y7d+tZb9yyW8YVPxhrPlyFsNyUylg4KtYtHEtV5g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Executing in xfer_to_guest_mode_work() we are free of kernel entanglements that cannot span preemption. So, handle TIF_NEED_RESCHED_LAZY alongside TIF_NEED_RESCHED. Also, while we at it, remove the explicit check for need_resched() in the exit condition as that is already covered in the loop condition. Originally-by: Thomas Gleixner Signed-off-by: Ankur Arora --- include/linux/entry-kvm.h | 2 +- kernel/entry/kvm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/entry-kvm.h b/include/linux/entry-kvm.h index 6813171afccb..674a622c91be 100644 --- a/include/linux/entry-kvm.h +++ b/include/linux/entry-kvm.h @@ -18,7 +18,7 @@ #define XFER_TO_GUEST_MODE_WORK \ (_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL | \ - _TIF_NOTIFY_RESUME | ARCH_XFER_TO_GUEST_MODE_WORK) + _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED_LAZY | ARCH_XFER_TO_GUEST_MODE_WORK) struct kvm_vcpu; diff --git a/kernel/entry/kvm.c b/kernel/entry/kvm.c index 2e0f75bcb7fd..8485f63863af 100644 --- a/kernel/entry/kvm.c +++ b/kernel/entry/kvm.c @@ -13,7 +13,7 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work) return -EINTR; } - if (ti_work & _TIF_NEED_RESCHED) + if (ti_work & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) schedule(); if (ti_work & _TIF_NOTIFY_RESUME) @@ -24,7 +24,7 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work) return ret; ti_work = read_thread_flags(); - } while (ti_work & XFER_TO_GUEST_MODE_WORK || need_resched()); + } while (ti_work & XFER_TO_GUEST_MODE_WORK); return 0; }