Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5622096pxb; Thu, 20 Jan 2022 00:49:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXOVQyjN7l45jO5ppv9XlLjphsD2XdmlCFQFrkG4Sv42Zl8Z8BINyTyOhJRI9gSQlWsa2s X-Received: by 2002:a63:9f0a:: with SMTP id g10mr30222066pge.387.1642668597156; Thu, 20 Jan 2022 00:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642668597; cv=none; d=google.com; s=arc-20160816; b=ue1xrIzb7bTwn4q88X+pYIufUYc3+QI/2eHGjSDt3TrExBdrZdOEU+LRBs/QuZv+hM eAk61CmCzFg8QRjvIhJVADeFMih+Kzpdo37nixuQ6yLhpmRFCo18aV6CGpJX6r8T2wru /FaW9WmAxkOtHem8Ff205hu4kyt/VWdpHca7oYpzLsf7xTDN9glrT86lhPox+3g9esER d9e5zLjxhDZLrJch2Fh9rKzR9I5O97lJwU3qkmWQLEaMtgzmOMHKiDYRrfXz85pth0AJ XdBCc1dy0BSxp/k+19TUvtxq6IgeBBBc0ppvLTsoJ2fVLLay9KVJsc6er5//rKQx4lze ryVA== 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=dcPkqEQXOuUooXn/pxt31GQPJweWO1xDKudS9D8vv8M=; b=t5PxneVW1P92BbWGzz1cwA1D5Ss6MOuoB/5ia/SpGzOfItPp/yH529rD/b6uiWmSav vFJzP2mFFChnud4xNqCwK2r82yvoMLIyHc6aIdQr7b2Mt7ceOHLHOOmzfJzPs3fsqr2C Lrmk18pAf5HNK6J0aGe/7FZ5YQWNiWh2SSO7TGR9ixbTZe7r8p3XcQA9pxYZIcqxl6E3 nYQp9+RZoZVfMKTkNcW+yTeQt7asxYorRylhAiN4fGbucmxFaf5fTM6jspr2dsrVrfYY IatxgMw71O6cFo/qd0q/Mc9Kiv9Ocb4t1Ycb9wzafzkj993geKy7WOykW7XJJTs3SKrT Y2Kg== 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 k9si8265387pjo.88.2022.01.20.00.49.45; Thu, 20 Jan 2022 00:49:57 -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 S237808AbiARMC0 (ORCPT + 99 others); Tue, 18 Jan 2022 07:02:26 -0500 Received: from foss.arm.com ([217.140.110.172]:54970 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241149AbiARMCW (ORCPT ); Tue, 18 Jan 2022 07:02:22 -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 6AEBED6E; Tue, 18 Jan 2022 04:02:21 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.37.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B301E3FA31; Tue, 18 Jan 2022 04:02:15 -0800 (PST) Date: Tue, 18 Jan 2022 12:02:06 +0000 From: Mark Rutland To: Paolo Bonzini Cc: Christian Borntraeger , 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: <20220118120154.GA17938@C02TD0UTHF1T.local> References: <20220111153539.2532246-1-mark.rutland@arm.com> <127a6117-85fb-7477-983c-daf09e91349d@linux.ibm.com> <8aa0cada-7f00-47b3-41e4-8a9e7beaae47@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8aa0cada-7f00-47b3-41e4-8a9e7beaae47@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 06:45:36PM +0100, Paolo Bonzini wrote: > On 1/14/22 16:19, Mark Rutland wrote: > > I also think there is another issue here. When an IRQ is taken from SIE, will > > user_mode(regs) always be false, or could it be true if the guest userspace is > > running? If it can be true I think tha context tracking checks can complain, > > and it*might* be possible to trigger a panic(). > > I think that it would be false, because the guest PSW is in the SIE block > and switched on SIE entry and exit, but I might be incorrect. Ah; that's the crux of my confusion: I had thought the guest PSW would be placed in the regular lowcore *_old_psw slots. From looking at the entry asm it looks like the host PSW (around the invocation of SIE) is stored there, since that's what the OUTSIDE + SIEEXIT handling is checking for. Assuming that's correct, I agree this problem doesn't exist, and there's only the common RCU/tracing/lockdep management to fix. Sorry for the noise, and thanks for the pointer! Thanks, Mark.