Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3001995imu; Sun, 11 Nov 2018 05:44:08 -0800 (PST) X-Google-Smtp-Source: AJdET5elhiCVPe0Oa3naIV2ihO//CM52AY0+yidm5R2GAyIilnMUJEFZcuwcVhTx1/CyXImBcQuc X-Received: by 2002:a63:6ac5:: with SMTP id f188mr14269731pgc.165.1541943848740; Sun, 11 Nov 2018 05:44:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541943848; cv=none; d=google.com; s=arc-20160816; b=MGtQymttPNeNYCApr22NF+0jebEk2uu13PbEV/5WlmFgHD62iPqEvi6ioEk827K6cY SBouCMMcU+TJGI6FRJc/zOO2jAgwlLYz6IC+DEWD0ZsrzGQxzxikXAuONI4GpQBuvgZ9 fLho6j4le5Wi6wfvwBTSmxEZKeOZokIA+Ofc+5ZSIWDXycYL76usWwf0qgEzmUax4m2H oydqlXWVmlV0yCJzKG2EYsKECikYLUb69DgN1z0ISBjrQ8EXo7I9GRID9VM2CCSe+/Yf sA4pfZaEuNGgu//0b/Bpc9rlpxes9rfiM7t33IMmXwh1DoZYZg8xGz/eFQRmoUdoxEDh 2/PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=RGzub7tlXzS5z3FKnQAN8eNP9GXfEpc7NOMdYjc4d9M=; b=gVq9iNzl4EK66jvoDWNo+Y5V93nW3tcb/y0bPSuTTr/pBR8Z9jI0w00oR2a4B6lWZy GXcGS0wNMBF+qcPJgHT2lM47tCvcV1tT9wi6apFFQD6TCO4M5lC0w3bAx/3cgUySrL4J JdkEKfQs7+yIpVW7NqnuN5f9MLT/rs/0raZfzTo9i7r3+u+vbhyAWO+H6oXQOBQm9bpz QHNhx4PSQXaLocmaspOLrbks5VXGkNfG9PsQj6Z2XIPEr3G2Cvxcs6q0Va7y0qiPcUCx yGt307mNHCRN9u0E2knBeHdx2ESOczJG2vCm4uTKpqGZ8knwDZbHqUFro2yePK4kLlu9 wN0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hKQqJeBj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22-v6si12806337pgk.214.2018.11.11.05.43.53; Sun, 11 Nov 2018 05:44:08 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=hKQqJeBj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727879AbeKKXbe (ORCPT + 99 others); Sun, 11 Nov 2018 18:31:34 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:38087 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727594AbeKKXbe (ORCPT ); Sun, 11 Nov 2018 18:31:34 -0500 Received: by mail-it1-f195.google.com with SMTP id k141-v6so9700367itk.3 for ; Sun, 11 Nov 2018 05:42:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RGzub7tlXzS5z3FKnQAN8eNP9GXfEpc7NOMdYjc4d9M=; b=hKQqJeBj9vAGuPU8siQHkEi+PVhIKOVtgHrgzEf06C1RaYgrPQExJmPyPMZIKyPU56 3GZi7qTY6cin1UXxLvBjDkag7VikHdMK3EjmgNEkTSGMLB/rDdAdJ9zxuD/t9Hvo+nOL N6/JN9ynoUD3uU3BxQ9qXDKk24ezrfsYTby/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RGzub7tlXzS5z3FKnQAN8eNP9GXfEpc7NOMdYjc4d9M=; b=JUU5Yas695mGZYH8O3pAeTUC9qjr4p3ucKDREfLLDo9dqSjeVFo8wBCP1p9wXgfTUg 9kGi4GaFusIslOr+tmEpwydxT3Di5KdJYXqtliyZ026/OhuEhuFMhC3goWocmQG1Pcyv cflP8HaHhH6UyK/UBgvi8qzgZX4SXcpWtsicoxbKWHso7G5+tzO68EKYrLueoTiTf+Xa k+VmaofogxoLtvnfztt2ec0A5A9xNboYdi62Xq7YA2olqmrXDIVmqQUtylGRh7TPuyEH 8IiJgBC1kYkFViVVUDjWh9NNhWg/0zrwdUNqERqBlR2G7zGNYicAsf6SczYxoiIOhvPq nvBg== X-Gm-Message-State: AGRZ1gJik/DaQka0mQOICr8MCCimrqbapAzz/FWPUiGV5o6kWdDfDhHY NvousCjatntTYZT+hcCJVrL4fkQytl9E4Y1MHcyKhw== X-Received: by 2002:a24:8347:: with SMTP id d68-v6mr9362265ite.158.1541943776312; Sun, 11 Nov 2018 05:42:56 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a6b:4f16:0:0:0:0:0 with HTTP; Sun, 11 Nov 2018 05:42:55 -0800 (PST) In-Reply-To: <20181110232059.GA12766@worktop.psav.com> References: <20181109072811.GB86700@gmail.com> <20181110232059.GA12766@worktop.psav.com> From: Ard Biesheuvel Date: Sun, 11 Nov 2018 14:42:55 +0100 Message-ID: Subject: Re: [PATCH RFC 0/3] Static calls To: Peter Zijlstra Cc: Ingo Molnar , Josh Poimboeuf , Linux Kernel Mailing List , "the arch/x86 maintainers" , Andy Lutomirski , Steven Rostedt , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov 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 On 11 November 2018 at 00:20, Peter Zijlstra wrote: > On Fri, Nov 09, 2018 at 02:50:27PM +0100, Ard Biesheuvel wrote: >> On 9 November 2018 at 08:28, Ingo Molnar wrote: >> >> - I'm not sure about the objtool approach. Objtool is (currently) >> >> x86-64 only, which means we have to use the "unoptimized" version >> >> everywhere else. I may experiment with a GCC plugin instead. >> > >> > I'd prefer the objtool approach. It's a pretty reliable first-principles >> > approach while GCC plugin would have to be replicated for Clang and any >> > other compilers, etc. >> > >> >> I implemented the GCC plugin approach here for arm64 > > I'm confused; I though we only needed objtool for variable instruction > length architectures, because we can't reliably decode our instruction > stream. Otherwise we can fairly trivially use the DWARF relocation data, > no? How would that work? We could build vmlinux with --emit-relocs, filter out the static jump/call relocations and resolve the symbol names to filter the ones associated with calls to trampolines. But then, we have to build the static_call_sites section and reinject it back into the image in some way, which is essentially objtool, no?