Received: by 10.192.165.156 with SMTP id m28csp40669imm; Tue, 10 Apr 2018 15:59:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48IkJ2bH/x/QA/TEIlqgjMRQPiX7UbdQ+mqlxO6gcpJcD1G14ldK1IVcrSpgmTmvAgJpTpC X-Received: by 2002:a17:902:4225:: with SMTP id g34-v6mr2386513pld.297.1523401170966; Tue, 10 Apr 2018 15:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401170; cv=none; d=google.com; s=arc-20160816; b=AzX8/L0auGX1doYwRw6N2FjPEnIX+4VJ4WyeZHvPX+tY1QMdCI5PkGbKcxbmKwgg4y CG9Sb69jt15Q/ws7YFHx6dxqbBq4Rq9fgU/mC7ZxUD8QIPuJwWS4KM+6+OGyFEZGfH40 4AFutli/lE+N6wF8uzbGP8Wl9LVfjqQE2uC47IJ/BlD0dB5X6S+ZRz+2m4zP+IUZvmXb K4Yxxvh0XRvzGaZ/Z0Y2C6KvcEvDSUBtc67pf9KslNGdkhm41Y2Oq3tJDe5IwDRQdjsb JiC6hMra2NQzIX/IeaCCxnGGQ9vBeV91tHzA4Sv0csGJvssSh26PciEoa6uQYb7eSPj/ RzyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PNFgTWNKkrUCH5GBHpvDChK52uyFrHMgRFPj3fOBHZI=; b=IJIfdjAx6816zpiiqNOreAM36LV8DvmQL+mZv281tDbh+TP7sgK5gxxaufvm+s8XEF UpItpkuNnNKl88yHWHlejavjGWJQz6zcVQWHDefk3NRR/NM/oFerVULWxKM5+JbzLT4r kBqYD86MeFCFp5t1H0PVBAgIYeZBhuFyI4GX048pxUNPxjIJ8JJsasihDmoDWSkXrvd6 3zmm8pZgZyFAAtdadVJ7v/UAIGmXGglcIjHFR4vszhwDf0dizFtJNGdOcKUG0+l52wRG GUnkhf9tB1P5q/2SfWh+mwxsGWJwgAqoiuyxXkK+j5YNvAZRKHHXl341LTjpxdCPpdDs wBFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f35-v6si3553527plh.394.2018.04.10.15.58.54; Tue, 10 Apr 2018 15:59:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932452AbeDJWhY (ORCPT + 99 others); Tue, 10 Apr 2018 18:37:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43754 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754247AbeDJWhW (ORCPT ); Tue, 10 Apr 2018 18:37:22 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 43708BB6; Tue, 10 Apr 2018 22:37:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Poimboeuf , Linus Torvalds , Matthias Kaehlcke , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.14 083/138] objtool: Add Clang support Date: Wed, 11 Apr 2018 00:24:33 +0200 Message-Id: <20180410212911.858115266@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Josh Poimboeuf commit 3c1f05835cbf9fdfe60b81c718d82ceb94b6c55e upstream. Since the ORC unwinder was made the default on x86_64, Clang-built defconfig kernels have triggered some new objtool warnings: drivers/gpu/drm/i915/i915_gpu_error.o: warning: objtool: i915_error_printf()+0x6c: return with modified stack frame drivers/gpu/drm/i915/intel_display.o: warning: objtool: pipe_config_err()+0xa6: return with modified stack frame The problem is that objtool has never seen clang-built binaries before. Shockingly enough, objtool is apparently able to follow the code flow mostly fine, except for one instruction sequence. Instead of a LEAVE instruction, clang restores RSP and RBP the long way: 67c: 48 89 ec mov %rbp,%rsp 67f: 5d pop %rbp Teach objtool about this new code sequence. Reported-and-test-by: Matthias Kaehlcke Signed-off-by: Josh Poimboeuf Cc: Linus Torvalds Cc: Matthias Kaehlcke Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/fce88ce81c356eedcae7f00ed349cfaddb3363cc.1521741586.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/objtool/check.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1385,6 +1385,17 @@ static int update_insn_state(struct inst state->vals[op->dest.reg].offset = -state->stack_size; } + else if (op->src.reg == CFI_BP && op->dest.reg == CFI_SP && + cfa->base == CFI_BP) { + + /* + * mov %rbp, %rsp + * + * Restore the original stack pointer (Clang). + */ + state->stack_size = -state->regs[CFI_BP].offset; + } + else if (op->dest.reg == cfa->base) { /* mov %reg, %rsp */