From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753926AbcAVQCw (ORCPT ); Fri, 22 Jan 2016 11:02:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54508 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbcAVQCu (ORCPT ); Fri, 22 Jan 2016 11:02:50 -0500 Date: Fri, 22 Jan 2016 10:02:45 -0600 From: Josh Poimboeuf To: Paolo Bonzini Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , Pedro Alves , Namhyung Kim , Bernd Petrovitsch , Chris J Arges , Andrew Morton , Jiri Slaby , Arnaldo Carvalho de Melo , Gleb Natapov , kvm@vger.kernel.org Subject: Re: [PATCH 26/33] x86/kvm: Add stack frame dependency to test_cc() inline asm Message-ID: <20160122160245.GD20502@treble.redhat.com> References: <56A1FED2.50700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56A1FED2.50700@redhat.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2016 at 11:05:06AM +0100, Paolo Bonzini wrote: > > > On 21/01/2016 23:49, Josh Poimboeuf wrote: > > With some configs, gcc doesn't inline test_cc(). When that happens, it > > doesn't create a stack frame before inserting the call instruction. > > This breaks frame pointer convention if CONFIG_FRAME_POINTER is enabled > > and can result in a bad stack trace. > > > > Force a stack frame to be created if CONFIG_FRAME_POINTER is enabled by > > listing the stack pointer as an output operand for the inline asm > > statement. > > If an __always_inline allocation works, that would be better. Yeah, that seems to work. I'll update the patch. -- Josh