From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755962AbcEYRO1 (ORCPT ); Wed, 25 May 2016 13:14:27 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:33709 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755881AbcEYRO0 (ORCPT ); Wed, 25 May 2016 13:14:26 -0400 MIME-Version: 1.0 Date: Wed, 25 May 2016 10:14:24 -0700 X-Google-Sender-Auth: allTsdwtcXEVZmWevfabuvb5sGU Message-ID: Subject: objtool warning: "duplicate frame pointer save" From: Linus Torvalds To: Josh Poimboeuf , Ingo Molnar Cc: Linux Kernel Mailing List , DRI Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Josh, my current git version (with gcc 5.3.1) makes objtool warn about "duplicate frame pointer save" in drivers/gpu/drm/vmwgfx/vmwgfx_msg.c for both vmw_send_msg() and vmw_host_get_guestinfo(). The reason is that VMW_PORT_HB_OUT() uses a magic instruction sequence (a "rep outsb") to communicate with the hypervisor (it's a virtual GPU driver for vmware), and %rbp is part of the communication. So the inline asm does a save-and-restore of the frame pointer around the instruction sequence. I actually find the objtool warning to be quite reasonable, so it's not exactly a false positive, since in this case it actually does point out that the frame pointer won't be reliable over that instruction sequence. But in this particular case it just ends up being the wrong thing - the code is what it is, and %rbp just can't have the frame information due to annoying magic calling conventions. Is there some way to override objtool for this situation? I hate seeing warnings that I need to ignore, it has just too often caused me to mistakenly ignore warnings I *should* have reacted to. I guess a STACK_FRAME_NON_STANDARD will shut objtool up (or just disabling it entirely for the whole file), but I was wondering about something more targeted that could be marked in the inline asm itself (rather than have to mark the functions that use it) Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: objtool warning: "duplicate frame pointer save" Date: Wed, 25 May 2016 10:14:24 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id BACC36E36A for ; Wed, 25 May 2016 17:14:25 +0000 (UTC) Received: by mail-io0-x230.google.com with SMTP id p64so36361006ioi.2 for ; Wed, 25 May 2016 10:14:25 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Josh Poimboeuf , Ingo Molnar Cc: Linux Kernel Mailing List , DRI List-Id: dri-devel@lists.freedesktop.org Sm9zaCwKIG15IGN1cnJlbnQgZ2l0IHZlcnNpb24gKHdpdGggZ2NjIDUuMy4xKSBtYWtlcyBvYmp0 b29sIHdhcm4gYWJvdXQKImR1cGxpY2F0ZSBmcmFtZSBwb2ludGVyIHNhdmUiIGluIGRyaXZlcnMv Z3B1L2RybS92bXdnZngvdm13Z2Z4X21zZy5jCmZvciBib3RoIHZtd19zZW5kX21zZygpIGFuZCB2 bXdfaG9zdF9nZXRfZ3Vlc3RpbmZvKCkuCgpUaGUgcmVhc29uIGlzIHRoYXQgVk1XX1BPUlRfSEJf T1VUKCkgdXNlcyBhIG1hZ2ljIGluc3RydWN0aW9uIHNlcXVlbmNlCihhICJyZXAgb3V0c2IiKSB0 byBjb21tdW5pY2F0ZSB3aXRoIHRoZSBoeXBlcnZpc29yIChpdCdzIGEgdmlydHVhbCBHUFUKZHJp dmVyIGZvciB2bXdhcmUpLCBhbmQgJXJicCBpcyBwYXJ0IG9mIHRoZSBjb21tdW5pY2F0aW9uLiBT byB0aGUKaW5saW5lIGFzbSBkb2VzIGEgc2F2ZS1hbmQtcmVzdG9yZSBvZiB0aGUgZnJhbWUgcG9p bnRlciBhcm91bmQgdGhlCmluc3RydWN0aW9uIHNlcXVlbmNlLgoKSSBhY3R1YWxseSBmaW5kIHRo Z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