Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5693752rwd; Mon, 5 Jun 2023 07:20:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KkbWwRTTxmK7paAEAE+Xe3a5O5K5kDmohtey+eIRSqhzwwka5+T5cm5nT5x+yg24rNGA5 X-Received: by 2002:a05:6a00:2ea3:b0:646:f971:b179 with SMTP id fd35-20020a056a002ea300b00646f971b179mr17514833pfb.16.1685974839464; Mon, 05 Jun 2023 07:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685974839; cv=none; d=google.com; s=arc-20160816; b=NpE5vRoZ1GNgJFFQcceHYb/sdKO/zsq3es3B/JOSNG16ewrvDuIiH6IqF42VieoDLg 0bR3VT7BvBt3fbjKWnKrvCCKIDL8t8Gf+tyyAgivffleRyKQ7teW4XHjebQX75/SyPaX 3QZoj+O3jGRvyi7mCyYuqszgpZPe5oEKIKxBFJdRCmOUaz7d7E+u86uaGtC4VEDecG/X rEu20RruMKJtdhGgU78mKIni/uTDJhrkmwXQxptNMMAw3clUVmb3UA6EfHIK0hKIoRJb SHUJjVy8zQUEdFQG//Q6jmMGNU+734naQER/a9jA0m8CHEABhgRakwE79UNcm5Re5VHy xICA== 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=X+4SrU6DsqFWnfII4h+3uCwsRVwxeJlfoNAM29p88Hc=; b=X5Igr8o4MjkYGGVUDYJYMxpVjMbZs8/mUTWEuj8OVY1F/0aT9/P5dZAijMkKJNCx44 qBesp8ButH6EcfQ8c/HxERu7lxlNX2zMimYR+XREcz/2TAwl6Lmn6Kjz3yQ7+p1qaXQk HzSSiLNcYm+wfSFEC2XtlbWLzDcTBlGZJtEMwa1TbdfzbBvg19NiDUNil9BlRIGTbDtV k0yd978XuL8pmV5EFW2Co5Nv2ZuR5KKUns9hX5a0LGb+r3IbPNGFWw/CHhFq4J2oe/G9 rpY19+IHubbBzUcZxkpFOvyPhS0Jmvf9Xcz52N59TYBEidfP1+zpnYzfNTWoXKIlUBMN zagg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cfc1TGFI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=JpyzuNuo; 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 a24-20020aa795b8000000b0063b8935bcbasi5172942pfk.310.2023.06.05.07.20.25; Mon, 05 Jun 2023 07:20:39 -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=cfc1TGFI; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=JpyzuNuo; 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 S234452AbjFEONp (ORCPT + 99 others); Mon, 5 Jun 2023 10:13:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234453AbjFEON2 (ORCPT ); Mon, 5 Jun 2023 10:13:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E33199F; Mon, 5 Jun 2023 07:12:41 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685974290; 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=X+4SrU6DsqFWnfII4h+3uCwsRVwxeJlfoNAM29p88Hc=; b=cfc1TGFIOq3GkZmxix152Ox9eE2l5LJoLY1uoKd30Ng5Gl8D6tUiuIIodWpcOkxZB9vZi2 32I6GJSyGicJFzwt9mjcSin9tgsI5GirIc5m1Y2x1/SZTOz7o4R/udgjePYCI5YDawwTLt IFyBHO1Tt1VBNpxNGCZLnUDvJCPrKTTzbpXUBorr0b3xixt3PzRwW2wlIgEDVDhfQyeljM 4JixXPWR1xAf4mNg2VVCHYyQ7GMEAhFo9U7D7S8kX1DKlrn1Zw5l2Lm+3ZStv0wx+x4Jul rBugVLBHhK+bxOJy9vGZECO8+g+J+tdTjBuMyi3H8tyx8LBYF2mQ6VrzsdCrCg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685974290; 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=X+4SrU6DsqFWnfII4h+3uCwsRVwxeJlfoNAM29p88Hc=; b=JpyzuNuozBw3352cB58J1TgX/docpZU3Bc626EFoyKlYiym9df5VgyXdLEfEW6HGAXQJ/Z A5kLRRml7Cc7G6Dw== 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 30/33] x86/fred: allow dynamic stack frame size In-Reply-To: <20230410081438.1750-31-xin3.li@intel.com> References: <20230410081438.1750-1-xin3.li@intel.com> <20230410081438.1750-31-xin3.li@intel.com> Date: Mon, 05 Jun 2023 16:11:30 +0200 Message-ID: <87wn0i578t.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, Apr 10 2023 at 01:14, Xin Li wrote: > A FRED stack frame could contain different amount of information for > different event types, or perhaps even for different instances of the > same event type. Thus we need to eliminate the need of any advance > information of the stack frame size to allow dynamic stack frame size. > > Implement it through: > 1) add a new field user_pt_regs to thread_info, and initialize it > with a pointer to a virtual pt_regs structure at the top of a > thread stack. > 2) save a pointer to the user-space pt_regs structure created by > fred_entrypoint_user() to user_pt_regs in fred_entry_from_user(). > 3) initialize the init_thread_info's user_pt_regs with a pointer to > a virtual pt_regs structure at the top of init stack. > > This approach also works for IDT, thus we unify the code. And thereby remove the useful comment and replace it with an undocumented macro mess. I'm simply refusing to review this. It's not my job to understand this undocumented hackery. Thanks, tglx