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=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 71325C4363D for ; Thu, 24 Sep 2020 22:15:16 +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 0529823A1B for ; Thu, 24 Sep 2020 22:15:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="buHV5A/o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0529823A1B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz 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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ggnjCzRqip4U3cuXO0Aqwl1SwlQEHPBUTy+lThJ12tI=; b=buHV5A/o67jF8b9rhssbZr63h hcg1jIBb5HIXQnOfeWRWca8s+4jLa28ADzbo2JqU/yu2dwX0Wd36mMIUV3qHrrNlG1UQGlP9xICyx Mqwx/PL6XeEHT/xoaRhXrSxUXBa2ujjtee+DbGY2GSNgyWN0Yokq98PD4AgN5QMtyQNeNeA8EL/xg x7JyIFuH1qC7+njKS5qrQfyFP8PUKhfLJXIIvDRQesVXYB18m9/Tetkw76jBrSIzujj4STSCNU/Ay aoED3DercDLj0FNmTWffsIgAMjR9hFQy9WZOYC6iIU2RPRTf0uH5CU1MuuypCtY4/C1z1peDaMzpM ORf330/+A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLZUp-0008JK-Hf; Thu, 24 Sep 2020 22:13:48 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLZUn-0008Im-4T for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2020 22:13:46 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 0D9A61C0BE0; Fri, 25 Sep 2020 00:13:43 +0200 (CEST) Date: Fri, 25 Sep 2020 00:13:42 +0200 From: Pavel Machek To: "Madhavan T. Venkataraman" Subject: Re: [PATCH v2 0/4] [RFC] Implement Trampoline File Descriptor Message-ID: <20200924221342.GB13185@amd> References: <20200916150826.5990-1-madvenka@linux.microsoft.com> <87v9gdz01h.fsf@mid.deneb.enyo.de> <96ea02df-4154-5888-1669-f3beeed60b33@linux.microsoft.com> <20200923014616.GA1216401@rani.riverdale.lan> <20200923091125.GB1240819@rani.riverdale.lan> <20200923195147.GA1358246@rani.riverdale.lan> <2ed2becd-49b5-7e76-9836-6a43707f539f@linux.microsoft.com> MIME-Version: 1.0 In-Reply-To: <2ed2becd-49b5-7e76-9836-6a43707f539f@linux.microsoft.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_181345_284022_B4AB9457 X-CRM114-Status: GOOD ( 19.82 ) 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@arm.com, linux-security-module@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, oleg@redhat.com, mic@digikod.net, Arvind Sankar , Florian Weimer , luto@kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, David.Laight@ACULAB.COM, libffi-discuss@sourceware.org, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============4559352744260208916==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4559352744260208916== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > PC-relative data referencing > ---------------------------- >=20 > I agree that the current PC value can be loaded in a GPR using the trick > of call, pop on i386. >=20 > Perhaps, on other architectures, we can do similar things. For instance, > in architectures that load the return address in a designated register > instead of pushing it on the stack, the trampoline could call a leaf func= tion > that moves the value of that register into data_reg so that at the locati= on > after the call instruction, the current PC is already loaded in data_reg. > SPARC is one example I can think of. >=20 > My take is - if the ISA supports PC-relative data referencing explicitly = (like > X64 or ARM64), then we can use it. Or, if the ABI specification documents= an > approved way to load the PC into a GPR, we can use it. >=20 > Otherwise, using an ABI quirk or a calling convention side effect to load= the > PC into a GPR is, IMO, non-standard or non-compliant or non-approved or > whatever you want to call it. I would be conservative and not use ISAs are very well defined, and basically not changing. If you want to argue we should not use something, you should have very clear picture _why_ it is bad. "Non-standard or non-approved or whatever" just does not cut it. And yes, certain tricks may be seriously slow on modern CPUs, and we might want to avoid those. But other than that... you should have better argument than "it is non-standard". Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl9tGhYACgkQMOfwapXb+vJZHwCfU5jKO40qUDcezUI+s8fyyfU7 zC8An2cC26db1I80i/2GbnoRTakpnf34 =8gy5 -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS-- --===============4559352744260208916== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4559352744260208916==--