Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1267348pxb; Fri, 21 Jan 2022 13:52:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+em6uZ3ckGtwuRVuBZWMkXXvJp67Wtr1VlqVBIeQS75mzzerRtLhyofV7J1tBHdMknnh2 X-Received: by 2002:a17:90a:6346:: with SMTP id v6mr2538748pjs.191.1642801960404; Fri, 21 Jan 2022 13:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642801960; cv=none; d=google.com; s=arc-20160816; b=Vi70lIpoC5JULB1PNE+TSdKP4zxQp28gc095SyWp7KuyA5mFNmHEErSIWCdMS6PbnW HBYnRSVW0suivUfytFcGNGQW+WorhmNQT6UiaLEfGr8/ONPTkJKtLrg/5GEer1zbIZjB r/V1k6143adPeAhCWs9OBYCDFseZAnnzZgxC5qxKV2aaOT3qNETj+UdhGay9L2JnD+k7 dRYtNYcz3DK2t6FFe3ThWCa/qCE/SajIzXcpYEGqmW8Adxi/BUqYFTSAgxS+T+aPBwqd 2emHgxgOn9tpnxSyaOHqICLOjHvhenPK9ArizTdqCL5IXQx28f8E7MkCj1BjSgL9eh8T PELA== 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=fbi90WdHv3tpRJqjrAvRdqP/nbuNgIzWJpf+yhOILEk=; b=l5kJ0vObHOHx3yRaryXWEMMNsUEPrdXkcBFzTk7qz44ZNUESUSYfYBjV+ITtcyJqx5 /di72DpzN2J2o5Nn+eXR4X8Jo8mci4H+P7n7Lt85igBPAf9QylpYlnTM5OLRTi0plkkv ahzI8ip5B8cYvFhjQcoqnv1kHAO5xx+l21ZX1x47n4ru8ytu9k/xvWyMb0q9Ymg+zR4T GMgIrYBYKyhBlR+99dfkQNF/KRQ7VuKaEqS2aWRGzB2Tq2kC/gfCHiIjZR4QmDWN/qN1 9fzA0nbiFpDJq89m5yrykp6NClht5tYRAv63gaHfR4lxa68nhNw4mo7RUiblq8TASVXu UJyw== 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 z4si7146447pge.854.2022.01.21.13.52.28; Fri, 21 Jan 2022 13:52:40 -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 S232283AbiATL5Z (ORCPT + 99 others); Thu, 20 Jan 2022 06:57:25 -0500 Received: from foss.arm.com ([217.140.110.172]:35194 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiATL5Y (ORCPT ); Thu, 20 Jan 2022 06:57:24 -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 33FA2ED1; Thu, 20 Jan 2022 03:57:24 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.11.183]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CAF73F774; Thu, 20 Jan 2022 03:57:18 -0800 (PST) Date: Thu, 20 Jan 2022 11:57:14 +0000 From: Mark Rutland To: Christian Borntraeger Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Michael Ellerman , aleksandar.qemu.devel@gmail.com, alexandru.elisei@arm.com, anup.patel@wdc.com, aou@eecs.berkeley.edu, atish.patra@wdc.com, bp@alien8.de, catalin.marinas@arm.com, chenhuacai@kernel.org, dave.hansen@linux.intel.com, frankja@linux.ibm.com, frederic@kernel.org, gor@linux.ibm.com, hca@linux.ibm.com, james.morse@arm.com, jmattson@google.com, joro@8bytes.org, luto@kernel.org, maz@kernel.org, mingo@redhat.com, nsaenzju@redhat.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, seanjc@google.com, suzuki.poulose@arm.com, svens@linux.ibm.com, tglx@linutronix.de, tsbogend@alpha.franken.de, vkuznets@redhat.com, wanpengli@tencent.com, will@kernel.org, Anup Patel , Atish Patra Subject: Re: [PATCH v2 0/7] kvm: fix latent guest entry/exit bugs Message-ID: References: <20220119105854.3160683-1-mark.rutland@arm.com> <20220119192217.GD43919@C02TD0UTHF1T.local> <0654e667-1cfa-5147-6661-b3b63288be0b@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0654e667-1cfa-5147-6661-b3b63288be0b@linux.ibm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 08:30:17PM +0100, Christian Borntraeger wrote: > > > Am 19.01.22 um 20:22 schrieb Mark Rutland: > > On Wed, Jan 19, 2022 at 07:25:20PM +0100, Christian Borntraeger wrote: > > > Am 19.01.22 um 11:58 schrieb Mark Rutland: > > > > > > > > > CCing new emails for Anup and Atish so that they are aware of this thread. > > > > Ah; whoops. I'd meant to fix the Ccs on the patches. > > > > Thanks! > > > > [...] > > > > > I just gave this a spin on s390 with debugging on and I got the following: > > > > > > [ 457.151295] ------------[ cut here ]------------ > > > [ 457.151311] WARNING: CPU: 14 PID: 0 at kernel/rcu/tree.c:613 rcu_eqs_enter.constprop.0+0xf8/0x118 > > > > Hmm, so IIUC that's: > > > > WARN_ON_ONCE(rdp->dynticks_nmi_nesting != DYNTICK_IRQ_NONIDLE); > > > > ... and we're clearly in the idle thread here. > > > > I wonder, is the s390 guest entry/exit *preemptible* ? > > Looks like debug_defconfig is indeed using preemption: > > CONFIG_PREEMPT_BUILD=y > # CONFIG_PREEMPT_NONE is not set > # CONFIG_PREEMPT_VOLUNTARY is not set > CONFIG_PREEMPT=y > CONFIG_PREEMPT_COUNT=y > CONFIG_PREEMPTION=y > CONFIG_PREEMPT_RCU=y > CONFIG_PREEMPT_NOTIFIERS=y > CONFIG_DEBUG_PREEMPT=y > CONFIG_PREEMPTIRQ_TRACEPOINTS=y > CONFIG_TRACE_PREEMPT_TOGGLE=y > CONFIG_PREEMPT_TRACER=y > # CONFIG_PREEMPTIRQ_DELAY_TEST is not set Thanks for confirming! Could you try with CONFIG_PROVE_RCU=y ? That can't be selected directly, but selecting PROVE_LOCKING=y will enable it. If I'm right, with that we should get a splat out of rcu_irq_exit_check_preempt(). If so, I think we can solve this with preempt_{disable,enable}() around the guest_timing_{enter,exit}_irqoff() calls. We'll also need to add some more comments around arch_in_rcu_eqs() that arch-specific EQSs should be non-preemptible. Thanks, Mark.