Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp283020pxb; Thu, 20 Jan 2022 13:27:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz5hjClBS7boN1aoTezRXRQsZ7ek4F5MCtXxuvnSzKvyBOfQAh0M2ffxIQJV0USC8l+qaG X-Received: by 2002:a17:902:a418:b0:14a:410e:2ad1 with SMTP id p24-20020a170902a41800b0014a410e2ad1mr1013541plq.170.1642714045287; Thu, 20 Jan 2022 13:27:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642714045; cv=none; d=google.com; s=arc-20160816; b=VXzqENmsIIBVB+qP1EE++Q0xZ+FbH0gbmfVhTtj3yUjMk3gsm7fdcc0i9qIooIS7iS jr9+CIHDw8MQ6KkLZE18Hc6ns5OyuRX5ITlPV21wLx7i1WP14YAanO2i8Eqtc/8Su+po EW9SMFYYjYOW4eBTzewiF5TlOCZCIkUhFCj0UWds5SyxvMw5m6wxIaYjvYpTlGS/NI1d /IIMb+21/SOg9T0ewcCCU+z8PpEmJoxISnSwLX6ENAiADolN+OhJ47gNCOEnzmPuWlPd 5AC6dk8NaJim1eAx5+RgrP2NHtSGMvgSscJHlaZTpcMncjQjys5iK43bj0SzPEPD14MP HJCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=7FZh9LmeR8nuxGXvG05gucnFS45PfVLz9jBDOkEfS+A=; b=eo4EJZnm5cVALu4Rj4Fe7rSxQ/EwaGx3eQTuypZ2kdBaF5pxG+YPd66fp8xrB+G1YX 8G65/tlxKiCsx+iLTjO/UqwdPIHb00nppbdpfXlBadpsMwLV/tiNCxfjTsjU4JoLHa8C baabXXqvDqPLnoPiwq6Sx5IfAD1bKgQJLdkRyx4pPjFVJoqjXpKXbMFJNYseQ5iN+mrn TgpndHP2ufCH0vvkfLCBbe++Vm/I76VRW0DyQHBeqibenNki58K8uzOD7xBXs34MDINf xO5D8iCeuORmsc9tXt6Vv34d5/7TU+hB0jDkwxbnS5MWEOvDjDgXrEZhXLwl4RoP/bGw BQzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si4850127plx.288.2022.01.20.13.27.13; Thu, 20 Jan 2022 13:27:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347816AbiARSM5 (ORCPT + 99 others); Tue, 18 Jan 2022 13:12:57 -0500 Received: from foss.arm.com ([217.140.110.172]:34960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233793AbiARSM4 (ORCPT ); Tue, 18 Jan 2022 13:12:56 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 320DCD6E; Tue, 18 Jan 2022 10:12:56 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.37.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97E453F774; Tue, 18 Jan 2022 10:12:44 -0800 (PST) Date: Tue, 18 Jan 2022 18:12:40 +0000 From: Mark Rutland To: Sven Schnelle Cc: Christian Borntraeger , Paolo Bonzini , linux-kernel@vger.kernel.org, aleksandar.qemu.devel@gmail.com, alexandru.elisei@arm.com, anup.patel@wdc.com, aou@eecs.berkeley.edu, atish.patra@wdc.com, benh@kernel.crashing.org, bp@alien8.de, catalin.marinas@arm.com, chenhuacai@kernel.org, dave.hansen@linux.intel.com, david@redhat.com, frankja@linux.ibm.com, frederic@kernel.org, gor@linux.ibm.com, hca@linux.ibm.com, imbrenda@linux.ibm.com, james.morse@arm.com, jmattson@google.com, joro@8bytes.org, kvm@vger.kernel.org, maz@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, nsaenzju@redhat.com, palmer@dabbelt.com, paulmck@kernel.org, paulus@samba.org, paul.walmsley@sifive.com, seanjc@google.com, suzuki.poulose@arm.com, tglx@linutronix.de, tsbogend@alpha.franken.de, vkuznets@redhat.com, wanpengli@tencent.com, will@kernel.org Subject: Re: [PATCH 0/5] kvm: fix latent guest entry/exit bugs Message-ID: <20220118181240.GF17938@C02TD0UTHF1T.local> References: <8aa0cada-7f00-47b3-41e4-8a9e7beaae47@redhat.com> <20220118120154.GA17938@C02TD0UTHF1T.local> <6b6b8a2b-202c-8966-b3f7-5ce35cf40a7e@linux.ibm.com> <20220118131223.GC17938@C02TD0UTHF1T.local> <20220118175051.GE17938@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220118175051.GE17938@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 18, 2022 at 05:50:51PM +0000, Mark Rutland wrote: > On Tue, Jan 18, 2022 at 05:09:25PM +0100, Sven Schnelle wrote: > > I wonder whether the code in irqentry_enter() should call a function > > is_eqs() instead of is_idle_task(). The default implementation would > > be just a > > > > #ifndef is_eqs > > #define is_eqs is_idle_task > > #endif > > > > and if an architecture has special requirements, it could just define > > is_eqs() and do the required checks there. This way the architecture > > could define whether it's a percpu bit, a cpu flag or something else. > > I had come to almost the same approach: I've added an arch_in_rcu_eqs() > which is checked in addition to the existing is_idle_thread() check. > > In the case of checking is_idle_thread() and checking for PF_VCPU, I'm > assuming the compiler can merge the loads of current->flags, and there's > little gain by making this entirely architecture specific, but we can > always check that and/or reconsider in future. FWIW, I've pushed out my WIP to: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=kvm/entry-rework ... and I intend to clean that up and get it out on the list tomorrow. The new entry/exit helpers are: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?h=kvm/entry-rework&id=df292ecabba50145849d8c8888cec9153267b31d The arch_in_rcu_eqs() bit is: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?h=kvm/entry-rework&id=6e24c5ed7558ee7a4c95dfe62891dfdc51e6c6c4 The s390 changes are: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?h=kvm/entry-rework&id=ca8daba1809b6e4f1be425ca93f6373a2ea0af6b I need to clean up the commit messages (including typos, TODOs, and deleting some stale gunk), and there are some comments to write, but by and large I think the structure is about right. Thanks, Mark.