Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp697550pxb; Thu, 2 Sep 2021 12:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys5ZU89d6GhYryOEdtOztVtvg2MFL2qQV9sRKqe6PbvS/k1iM0b1VB804/vWjyT9lqg6b5 X-Received: by 2002:a5d:9247:: with SMTP id e7mr18108iol.161.1630612493274; Thu, 02 Sep 2021 12:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630612493; cv=none; d=google.com; s=arc-20160816; b=eHWbDAIJiGcZFQapjUfdDlEgByeLVHGRh0l7cTI4e9AMxCjv/9SC3G6AhIq5XjMTyw 9HX5UvWHEzO/NJKpIcGxJr5gazquiGRtL9EVJCwoFpEAlQBUkPaTNgMviX4bal67UuaU cH7R4G3Ext8P36GpuV83J1WtOdDHcPD1jq3gWxWaDI8PR0XhbYRD6oCi8nayyAmxZAPB 5OcCmJar8mEqe2H7idyLwZEn7n+95WnqnNF2pb1uoaBhgJdallwwEJBS0Vp4WLbVZb74 QWnfywbdNGJvY5SgnaQzwadQCMlWiGVwff3olw503UaxVQr1mZlhB9ijZct9XEBXyl0U QU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0zoWaVGLtmeSAK/KJjDblWNoAIDreuyP4e8WrgtSims=; b=OrjdoZvXbvxCmcrAm/lqTYTeXWYbfnSMw0DXO/7MlEPK6OhnZRQiipxNHaddYval5S lIOkhlNQcKIR4igP2BNWXJsW3SQFajRMYflZ71y9qxXQt5XThIFVyxiAsCjM9K4Bq3Jz 0CGSK1hLqtp2qCFYVr0vAuUWr2pLaArq8kMJWLjSmCbny4skGBiIqdOQTJZY3nfJE9Vg 43OzIMEpgJU8aPm2Loq9ciCKhm1o7+yJJbYg7jrBTdYVDiSg2cjV+PDgHWJ4Pkpg40hg AAGmjDdn/qOgueMmnZwHBzHHTJYQ1LGh6317Nm1/aD29KbWXat/DoERMCuHk00fXxAJp Kiiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=e1e5R2LJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c193si2943436jac.53.2021.09.02.12.54.40; Thu, 02 Sep 2021 12:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=e1e5R2LJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243653AbhIBKen (ORCPT + 99 others); Thu, 2 Sep 2021 06:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239028AbhIBKem (ORCPT ); Thu, 2 Sep 2021 06:34:42 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A77C061575 for ; Thu, 2 Sep 2021 03:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0zoWaVGLtmeSAK/KJjDblWNoAIDreuyP4e8WrgtSims=; b=e1e5R2LJ28MhomQ0RlcPdwJ3Hz rwl75R3NAJfVDotsxhzeH0kPDGddq2G+HYUp2NIf1CvrI9c0TmYihKP3hwcHC0Eyx/3SmnHlZupIX q9iUqFpvwmlN1RqLuZ5OKYPd/Izqhe3/OuJRa0B67jH9z1Rl72wWdkfbPHaIcenhK398jSHD/rglx S+rFXPw/Vki40Ftslm/E3o7qdmJ54Y7Hvb2cpPAUT2iMQwhYy4SthlBJ8n4qDxo332frMLBmGFtQw v6B8HrY5o1K24bp/uOWtd8mT9KNBCd8Yn0+oxT3flSo1SIGTmHQufqFnI/TLm4bCopNEE/bgksP7r gxsA++EQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLk2C-0006Pl-Vc; Thu, 02 Sep 2021 10:33:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B9FB63001C0; Thu, 2 Sep 2021 12:33:30 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A070D285E1143; Thu, 2 Sep 2021 12:33:30 +0200 (CEST) Date: Thu, 2 Sep 2021 12:33:30 +0200 From: Peter Zijlstra To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Joerg Roedel , Youquan Song , Tony Luck Subject: Re: [PATCH 22/24] x86/entry: Implement and use do_paranoid_entry() and paranoid_exit() Message-ID: References: <20210831175025.27570-1-jiangshanlai@gmail.com> <20210831175025.27570-23-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210831175025.27570-23-jiangshanlai@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 01:50:23AM +0800, Lai Jiangshan wrote: > + call do_paranoid_entry > ret That's normally spelled like: jmp do_paranoid_entry But the same comment as for error_entry but more; pretty much all that's left in asm is things like: call paranoid_entry; # setup args call \cfunc call paranoid_exit which seems like prime material to also pull into C to avoid the back-and-forth thing. In fact, why can't you call paranoid_entry/exit from \cfunc itself? The IDT macros should be able to help.