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 058C5C7EE23 for ; Mon, 5 Jun 2023 14:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231742AbjFEOPe (ORCPT ); Mon, 5 Jun 2023 10:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234965AbjFEOPV (ORCPT ); Mon, 5 Jun 2023 10:15:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E77FE8; Mon, 5 Jun 2023 07:15:20 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685974518; 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=QxfN8XhVYQPBZK7oM9kZ2tYIqv/AxYIE9gW+GsDBqhM=; b=GjrnM9wzipOA/AXN/iLgCqL0XO1MOvh3zVdqwlbfcK9sMeTjJvVQYYwAfWcYyK7dg/z60f CEn+Cg/EqaUMi7GxzS1X5GnALYAiO8UqfkphzoYUtu2bt4u15DxRGn070Z4X+HOB7xzo5X 80Ctt+9S6M4gti+GHFSN91z7kq1Xy3WAIEsPfRArvBg2W+kfoWod4nN9igpcDqjo3xmvm3 QZAms+qqzy4yC5HP3l1Q5iuYsLS64HeuDNS/XXSgDM9DJenX+HZQqCrYEuI6G9W4lJSgCP Zyiaq4Q3IPo/TkD/8EW8UFduldggpIOwSBY9hX2GaJa/OFPzISlsOO/uln1vEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685974518; 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=QxfN8XhVYQPBZK7oM9kZ2tYIqv/AxYIE9gW+GsDBqhM=; b=CMo2JQQgahrYCw5CqsRO5yAvF5V6Vgv8Fbw0I3yCdOnpbWevU2HClv5zicUaV6NxXyrYyH 4kCcswHclc51wWCg== To: 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, hpa@zytor.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: <20230410081438.1750-32-xin3.li@intel.com> References: <20230410081438.1750-1-xin3.li@intel.com> <20230410081438.1750-32-xin3.li@intel.com> Date: Mon, 05 Jun 2023 16:15:18 +0200 Message-ID: <87ttvm572h.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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. Thanks, tglx