From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE2DFC4742C for ; Mon, 16 Nov 2020 12:06:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AE9C22263 for ; Mon, 16 Nov 2020 12:06:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WsAEj1rv"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Qk+N1CSp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AE9C22263 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CNAQNVRZl17EV2oauo56MvwhmPvHrz69tCfEQI4Ie1c=; b=WsAEj1rvKAVqHJMXTcSOBJHRB 7Wv1zm+Z/HG7fxNvFY5uT/tQc9GplU6LHaFXbY9Dfynt/S4uIw3010v4U7c2suLiiXMiI0EdzLRcM Ll50buCQ9WF/oOu/DwlGyHYQTvqrAJtXbi17BdSAfo9YWUpz8el1pD01ab9HkuxZulgbM2dOQ1ZCI +bjC4Z57XjH3N7mEBrD6fOdLDqa0EtmYaTD96UWkYzYWF66LGpt1vonubj5tt9n4QNyEZ+07YlCk6 T4YxRXi9dWBpkscStYXjhr0ZjFqy+XJ4FfDsLafZKvyzfMVsKGXLFgZGSn3tfIIK/yQdIGJzTVt2s kOXd1DNQw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedGJ-0004Ty-K8; Mon, 16 Nov 2020 12:05:35 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kedGH-0004TK-2T for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 12:05:33 +0000 Received: by mail-wm1-x341.google.com with SMTP id c9so23484824wml.5 for ; Mon, 16 Nov 2020 04:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rL+wqk8vjbWnxUKCfFtRJkPZNIgcudRohyrL8rMdXQg=; b=Qk+N1CSptv7igOOKkTU61J8iXtVDe5a1XLk6LtoaQULACxlLE6bQJ94/3yVKxk2J6z M340rwRx2wAbMuXHcgS+nNT1xL/52ZCjkf4vIxv2SKxD4Wnd9Fb4xTEufRVpFhSJRm6V uZAdbFteZXicUkS53dOmGorckhT0xNOD7ygGdwCQnfZtBXi8rLDM97Gzih12hVM//YOg UPpY2Z5TnPJd/dugjGbRDwPBVEJFB54MfYTs1jNbfOEJd7oM73Fq239F8T+alMDL8yvK rSrut3YOqqGU90ImEyQj2cAjLJRZv6NEXNPW8t9wWVlYFy9oMaRL0jlQ2yUGSBfcLZtc pbmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rL+wqk8vjbWnxUKCfFtRJkPZNIgcudRohyrL8rMdXQg=; b=uBPbXuSXg7l2KCmNFf3XQ7OaZtLsrAy4nzTu42UfKkAehAVGc6EBDti3kM86l97WPt RMqjF78kCZD6cyApPVAdfhj11ki4IPh75/TiL/Nofrz2ciNEpxzvKrTJFsrfBwa8SYs8 Xhnt2fCJ5C172CkS6vJ9mP/uZWCc+7EsTG/fIbyUO2ZTYGsSBd4Rwxtl7UfA+Qodkfui 3XGCVcSsjdMIzhEu9GTtBVFrwOh0gyTN8m1VxL/yEjIQOqKI5xkYealo57ndnyCIyJ7C sS2YfzT1XFAwrfgNL3z721T8XPKPV2xxB6nmOTZ82CpH90mrd2tmK1oyM75JgIknvs31 sLuw== X-Gm-Message-State: AOAM5337TcLtAeXttbcgcbprsKmlmNkEhW+auXqhwHCVHjM6UxUwcv2b iDP7XaCojnmyGiveuxHjlOzCNSwWrOqCzw== X-Google-Smtp-Source: ABdhPJyzNJGUpbQQIkWfonTUFYqF2uon519avvxWvqLQMs7oW4blHS0It80J8URHFjjHALRKtI1YGQ== X-Received: by 2002:a1c:97:: with SMTP id 145mr14768024wma.72.1605528331606; Mon, 16 Nov 2020 04:05:31 -0800 (PST) Received: from google.com ([2a00:79e0:d:210:f693:9fff:fef4:a7ef]) by smtp.gmail.com with ESMTPSA id m18sm20947246wru.37.2020.11.16.04.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 04:05:31 -0800 (PST) Date: Mon, 16 Nov 2020 12:05:27 +0000 From: Quentin Perret To: Ard Biesheuvel Subject: Re: [PATCH v2] arm64: implement support for static call trampolines Message-ID: <20201116120527.GA3931251@google.com> References: <20201028184114.6834-1-ardb@kernel.org> <20201029112747.GA4090840@google.com> <20201029115442.GA4092571@google.com> <20201116101802.GA3908597@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_070533_138431_817F2ACE X-CRM114-Status: GOOD ( 17.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Zijlstra , Catalin Marinas , James Morse , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Monday 16 Nov 2020 at 11:31:10 (+0100), Ard Biesheuvel wrote: > OK, so that would suggest that having at least the out-of-line > trampoline would help with CFI, but only because the indirect call is > decorated with CFI checks, not because the indirect call itself is any > slower. Right. By disabling CFI checks in Android we get something that is more comparable to the inline static-call implementation as we get a 'raw' indirect call. But yes, it's very likely that even an out-of-line static call is going be much faster than a CFI-enabled indirect call, so definitely worth a try. > So that suggests that something like > > bti c > ldr x16, 0f > br x16 > 0:.quad > > may well be sufficient in the arm64 case - it is hidden from the > assembler, so we don't get the CFI overhead, and since it is emitted > as .text (and therefore requires code patching to be updated), it does > not need the same level of protection that CFI offers elsewhere when > it comes to indirect calls. Agreed. I'm thinking the static-call infrastructure itself could perhaps do the CFI target validation before actually patching the text. But I suppose we probably have bigger problems if we can't trust whoever initiated the static-call patching, so ... Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel