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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F19A4C7EE23 for ; Mon, 5 Jun 2023 17:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbjFERQf (ORCPT ); Mon, 5 Jun 2023 13:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjFERQd (ORCPT ); Mon, 5 Jun 2023 13:16:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7E5599; Mon, 5 Jun 2023 10:16:32 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685985391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HoFThzoC6fpGbyKMWpymWNyMC8yF8MkWrY/0sdSvLaM=; b=qYs3b+XYRheTQwx8sI81c6CL/R1wf6tORczaI42iys/0RquQlzzNG/RVd0UZgRM2zjxjNT pANs066B0NYB5NJtx16V8iAvbtKlxsLi2oKTojr7OyBQa/4kx1SuE/M9fvohfn9jOJMk8s NXyQcrYz6iYcxyI1Li5Mzzg6B+t6Uy/dAJUstkPB/TWfPzZ7d8MtIlCQdLdE+kXADNbcK2 C6G4i8O4zMweKs6oeHjxETfHSwmnO3a/U7N+vRWv+m1YGSZXErNRjacyQQ0X6iAsn8l92W 4WyGLujM+IB6H94D2tau0b4N9AcIHYuBI0cl9VgBh9XygpoFbT6AdO/dRTOehQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685985391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HoFThzoC6fpGbyKMWpymWNyMC8yF8MkWrY/0sdSvLaM=; b=IjHpsn+24ddQtcYcLfzp3sbTNCbaQmTvSs/U3EkdGNpPsewY7AFpvj38aI+hxR18avSSdv JD5aKZjqXx30PsBQ== To: "H. Peter Anvin" , Xin Li , linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com, jiangshanlai@gmail.com, shan.kang@intel.com Subject: Re: [PATCH v8 31/33] x86/fred: BUG() when ERETU with %rsp not equal to that when the ring 3 event was just delivered In-Reply-To: References: <20230410081438.1750-1-xin3.li@intel.com> <20230410081438.1750-32-xin3.li@intel.com> <87ttvm572h.ffs@tglx> Date: Mon, 05 Jun 2023 19:16:30 +0200 Message-ID: <878rcx6d8x.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jun 05 2023 at 09:42, H. Peter Anvin wrote: > On 6/5/23 07:15, Thomas Gleixner wrote: >> On Mon, Apr 10 2023 at 01:14, Xin Li wrote: >>> A FRED stack frame generated by a ring 3 event should never be messed up, and >>> the first thing we must make sure is that at the time an ERETU instruction is >>> executed, %rsp must have the same address as that when the user level event >>> was just delivered. >>> >>> However we don't want to bother the normal code path of ERETU because it's on >>> the hotest code path, a good choice is to do this check when ERETU >>> faults. >> >> Which might be not catching bugs where the wrong frame makes ERETU not >> fault. >> >> We have CONFIG_DEBUG_ENTRY for catching this at the proper place. >> > > This is true, but this BUG() is a cheap test on a slow path, and thus > can be included in production code. No objection.