From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B2DEC25B75 for ; Thu, 23 May 2024 18:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LjBzypRLknBjpPXPOxduCfAVIHVYC6on48ops7Zuf5k=; b=HCTSJibufADQH8 JejjTpk83P8qsM12vq62E5ylV5yEaCd4uxAkI6Fat9BH6HPQiYm3bL8GHeld6tVhEGTbV5fjS95Kc 1Du+UZ/q+qjYaIxSt4jkfdBpstTVdnEwvC3d/6wH69D15ChNCNrpRL/jHyTRg+D/j9IwgcQdTEDQe 7WluCpSq03LzHaQj6o1+vvw9GAcSVloQvA4n/OdigmlM/TflHPJjPgT7deCD4MuuHyehJ0Bog99Gg 0TGqcFIZw6Owm+xpjhcy1vS8GX1hO/8gOln1z/TC22zKWWDj5uA2NxhxN9KWxFklB7JW2YI+kRdjS VdrryumbZF9LNzC6Wh9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAD1t-0000000704B-2j5F; Thu, 23 May 2024 18:19:05 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAD1p-0000000703m-2O4z for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2024 18:19:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C590662E66; Thu, 23 May 2024 18:19:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71691C2BD10; Thu, 23 May 2024 18:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716488340; bh=gw8y3FfzavCiPRp+Tzm9CwPAxk4GsPXQvMhRKDlNdYg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RPWcuG1c9ZXSiqZ6kgqpgEc6UqGOEvg00HOYJFMHPOwkV0qK18umMx+qZ3l4cKR5d uobq6yxkuELsAdbMu1ccapk9Dp5RHWch71q110w5Lar/s5l8Orel8w/6QHZ22B42mN RVl0jF1+sikAYDQyCsQj6OMSUQaC1PTtqJZfL1/2DRp7/ZHIzT3iaLwOCE+a90QcbZ bIDpN39jhjcjB/+fZ0q1/ciKafg0ymtCwVBvb23xuGksN5fikItGl/xlg9/y75fKlc Syr9IeYk+yVaqM6FzKbvZw0Neg3JEwZfQ1dPSWAAlNm+d7mf/v5yZDgknctMxQB3tv 78AsflaOPqAjg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sAD1l-00FGMG-QA; Thu, 23 May 2024 19:18:57 +0100 Date: Thu, 23 May 2024 19:18:57 +0100 Message-ID: <86jzjkmlwu.wl-maz@kernel.org> From: Marc Zyngier To: Nina Schoetterl-Glausch Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Andrew Scull , Will Deacon , Mark Rutland , Quentin Perret , David Brazdil , kernel-team@android.com Subject: Re: [PATCH v2 11/11] KVM: arm64: Get rid of the AArch32 register mapping code In-Reply-To: <678f6b8fe42f7a39eba4090a12a618cdbc710fa5.camel@linux.ibm.com> References: <20201102164045.264512-1-maz@kernel.org> <20201102164045.264512-12-maz@kernel.org> <66a7077c5df86d0a541237996382ae583d690a14.camel@linux.ibm.com> <86le40ms5m.wl-maz@kernel.org> <678f6b8fe42f7a39eba4090a12a618cdbc710fa5.camel@linux.ibm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: nsg@linux.ibm.com, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, ascull@google.com, will@kernel.org, mark.rutland@arm.com, qperret@google.com, dbrazdil@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240523_111901_686182_9AD8313D X-CRM114-Status: GOOD ( 20.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 23 May 2024 17:19:38 +0100, Nina Schoetterl-Glausch wrote: > > On Thu, 2024-05-23 at 17:04 +0100, Marc Zyngier wrote: > > > Amazing. Thanks for spotting this. This is indeed broken. I guess this > > was not spotted because userspace is not totally broken itself. > > So it's an actual bug and not just doing more work than necessary? Definitely. > Could corrupt the regs of a 64bit kernel? Yup. If you have a 64bit guest with a 32bit userspace, and that you restore the state at the point where the latter is live, with any PSTATE bit set other than those in PSTATE.M, you corrupt the 64bit GPRs by zeroing the top 32bit. Linux as a guest is probably fine as it doesn't try to optimise the GPR save/restore for a 32bit userspace and will restore the registers from its stack (which itself is not corrupted), but that's still a pretty bad situation. > > Do you want to submit a fix adding the masking back? or should I do it > > myself? > > You go ahead and do it :) Will do shortly. Thanks again, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel