Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5941041rwd; Mon, 5 Jun 2023 10:31:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67tcxShpLREe26LHmmzqS9Fb4uAPxYNR+3zFTa7xpS5pxpGY1WAM/cqXiWTRXeq3tCqGv+ X-Received: by 2002:a17:902:f685:b0:1b0:5425:2165 with SMTP id l5-20020a170902f68500b001b054252165mr6131604plg.29.1685986317555; Mon, 05 Jun 2023 10:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685986317; cv=none; d=google.com; s=arc-20160816; b=ec/D1xlDC2JJvx82JpBoqDCDA6hi0fdPRpT+KNuvVIbea7dGvzh1P0Ny4Zxvd87lBU rR2OPZnO201IuKSp5e3uxSax8/kLfIVfhG0B1FbzwzDhIjiuhNGUfFb3kOz70vXkICjF RxpyLqb5FQHuL+6P7BqAJIoB609+CEEMtncT2VyvOgBkdWxaHBE93AQ5rccPaGVtQirV aETlvtupdqgtFIruJrL8PEIiQSdQo423aC3xY0/bw4jeVGRVmUTBa47KN9D8EKjTj7SN s9TNEMC0U3t/N/5HB7FnYH5MkL51aB9xpaowwekrIWU1JcO7p8m4ff8OCrJ57cNuNQAJ xj1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=HoFThzoC6fpGbyKMWpymWNyMC8yF8MkWrY/0sdSvLaM=; b=BlaxIkht6GuHFSOTfWV+lyyw5TX/CevURmArFH2vy0jOEf/wiD5fcwEMgvoVC5Elu+ RXo00hj2HqxQBqFwcGrIQvXwTbmjyVFZYRCfMmyAYyanVLc77nlIqxlMNAVvoaV8ZKi5 ACkUnhmzM6sA+CGdLrlTslwLAEmyz9XAgPc9y0Dc3aNNfG9ZlMtgnUfdk9I3KBvROrTM DLXZXsQF1SpveTRKe5MIGiG36HaLkPuq4D4oMmVReyZjnRioiy2J/YIVF1182q2OAmIB U4etS6yfGNq8tHpH262odBohHu5k4n+wzjccnIUfooBIxvkfUqV1qS2BfM9MU/ORpWn0 leKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qYs3b+XY; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j19-20020a170902759300b001ae52127485si5586561pll.433.2023.06.05.10.31.43; Mon, 05 Jun 2023 10:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qYs3b+XY; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbjFERQf (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.