From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755088AbdESJRg (ORCPT ); Fri, 19 May 2017 05:17:36 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34342 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753759AbdESJRc (ORCPT ); Fri, 19 May 2017 05:17:32 -0400 Subject: Re: [PATCH v3 04/29] x86: assembly, use ENDPROC for functions From: Jiri Slaby To: Josh Poimboeuf 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 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> Message-ID: Date: Fri, 19 May 2017 11:17:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <4a63c996-6c86-c298-dd9c-34b77afc6f27@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, -- js suse labs