From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550AbdESTus (ORCPT ); Fri, 19 May 2017 15:50:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40376 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbdESTur (ORCPT ); Fri, 19 May 2017 15:50:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E222F804E0 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E222F804E0 Date: Fri, 19 May 2017 14:50:08 -0500 From: Josh Poimboeuf To: Jiri Slaby Cc: mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Boris Ostrovsky , Juergen Gross , xen-devel@lists.xenproject.org Subject: Re: [PATCH v3 04/29] x86: assembly, use ENDPROC for functions Message-ID: <20170519195008.ls6ynaoxcxilip4x@treble> References: <20170421141305.25180-1-jslaby@suse.cz> <20170421141305.25180-4-jslaby@suse.cz> <20170426014217.hshjlweqsimaumuy@treble> <4c3b765e-483a-4d9b-c451-6eccc02403f3@suse.cz> <20170512221532.s2wuaoq65uvaprgq@treble> <4a63c996-6c86-c298-dd9c-34b77afc6f27@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 19 May 2017 19:50:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2017 at 11:17:24AM +0200, Jiri Slaby wrote: > On 05/17/2017, 03:23 PM, Jiri Slaby wrote: > >> So the initial CFI state is different between the two types of > >> "functions". And there are a lot of other differences. C-type > >> functions have to follow frame pointer conventions, for example. So > >> your FUNC_START macro (and objtool) would have to somehow figure out a > >> way to make a distinction between the two. So it would probably work > >> out better if we kept the distinction between C-type functions and other > >> code. > > > > Ok, that makes a lot of sense. > > A quick question: > Do you consider these to be C-type functions? > > ENTRY(function_hook) > ret > END(function_hook) > > or this? > > ENTRY(native_load_gs_index) > pushfq > DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI) > SWAPGS > movl %edi, %gs > SWAPGS > popfq > ret > END(native_load_gs_index) > > Both are called from C, but they do not setup frame pointer etc. Yeah, those are valid C-type functions. Setting up the frame pointer is optional for leaf functions (i.e. functions which don't call other functions). -- Josh