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=-14.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 E589AC433E1 for ; Mon, 3 Aug 2020 17:00:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4FDE20A8B for ; Mon, 3 Aug 2020 17:00:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="aFVPc1Gu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728142AbgHCRAH (ORCPT ); Mon, 3 Aug 2020 13:00:07 -0400 Received: from linux.microsoft.com ([13.77.154.182]:50684 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbgHCRAG (ORCPT ); Mon, 3 Aug 2020 13:00:06 -0400 Received: from [192.168.254.32] (unknown [47.187.206.220]) by linux.microsoft.com (Postfix) with ESMTPSA id 78F6120B4908; Mon, 3 Aug 2020 10:00:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 78F6120B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1596474006; bh=xPQidYuoj27KLcDBCgI71AQFyVVUOYWMoSSTSHUPbW8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aFVPc1Gu41xtINHxdFGnzfv2HBq0EGEd0iH8amloyMh8tYfeAU7clLOSMb6TuEJmU hfVT4JzlCTZI9FgI54InEHWWr99xf3Egvr+DSd/z2OzTw7yIg+2Z6TOublxySEu1T5 rUlm/3leT/O5FXJfSA+UW2fG5vVktd6bCmKVR4as= Subject: Re: [PATCH v1 0/4] [RFC] Implement Trampoline File Descriptor To: David Laight , 'Mark Rutland' Cc: Andy Lutomirski , Kernel Hardening , Linux API , linux-arm-kernel , Linux FS Devel , linux-integrity , LKML , LSM List , Oleg Nesterov , X86 ML References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <6540b4b7-3f70-adbf-c922-43886599713a@linux.microsoft.com> <46a1adef-65f0-bd5e-0b17-54856fb7e7ee@linux.microsoft.com> <20200731183146.GD67415@C02TD0UTHF1T.local> <7fdc102e-75ea-6d91-d2a3-7fe8c91802ce@linux.microsoft.com> From: "Madhavan T. Venkataraman" Message-ID: Date: Mon, 3 Aug 2020 12:00:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/20 11:57 AM, David Laight wrote: > From: Madhavan T. Venkataraman >> Sent: 03 August 2020 17:03 >> >> On 8/3/20 3:27 AM, David Laight wrote: >>> From: Mark Rutland >>>> Sent: 31 July 2020 19:32 >>> ... >>>>> It requires PC-relative data references. I have not worked on all architectures. >>>>> So, I need to study this. But do all ISAs support PC-relative data references? >>>> Not all do, but pretty much any recent ISA will as it's a practical >>>> necessity for fast position-independent code. >>> i386 has neither PC-relative addressing nor moves from %pc. >>> The cpu architecture knows that the sequence: >>> call 1f >>> 1: pop %reg >>> is used to get the %pc value so is treated specially so that >>> it doesn't 'trash' the return stack. >>> >>> So PIC code isn't too bad, but you have to use the correct >>> sequence. >> Is that true only for 32-bit systems only? I thought RIP-relative addressing was >> introduced in 64-bit mode. Please confirm. > I said i386 not amd64 or x86-64. I am sorry. My bad. > > So yes, 64bit code has PC-relative addressing. > But I'm pretty sure it has no other way to get the PC itself > except using call - certainly nothing in the 'usual' instructions. OK. Madhavan 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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 DE563C433DF for ; Mon, 3 Aug 2020 17:01:22 +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 AB72A20678 for ; Mon, 3 Aug 2020 17:01:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uUeKxon3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="aFVPc1Gu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB72A20678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.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:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LhnSWjB6Lbn2/Mi8hB1YAIaqGaJyMsKBWGki6JY7ipY=; b=uUeKxon3VAi0iaLARsdgzT6T/ CGCQKIVft7JITJnezlp3G0PhpQSdkY3qBaSx8WTriOryyR3e5YbROyPgrZsfe1jr6oR3Q2FucAgss gS+zQlvr1SFSFfmTPOyhhQPx+xyYL0yWVV9BqcH0ZHc2SuigBRtWBG2Ng3OLSe9ZURZigkhVCYOkP 7qXR41hjLjyIqe+ofg3QESyJtWY/dJD6qFUNG5zxfVZ3QpFWITGNEh78zUxDEQmRkwwYgKGewKRWh qHyg7VWZxxAJB7/EDEd0NJCAgxm/UJEtzAUFw9YKA7Vo5rceRKQoCLa5dAfEgMkNe2KWWPMyrDG4Q dIWsEL2mQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2dom-0004Bf-KK; Mon, 03 Aug 2020 17:00:08 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2dok-0004Aj-Nk for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 17:00:07 +0000 Received: from [192.168.254.32] (unknown [47.187.206.220]) by linux.microsoft.com (Postfix) with ESMTPSA id 78F6120B4908; Mon, 3 Aug 2020 10:00:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 78F6120B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1596474006; bh=xPQidYuoj27KLcDBCgI71AQFyVVUOYWMoSSTSHUPbW8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aFVPc1Gu41xtINHxdFGnzfv2HBq0EGEd0iH8amloyMh8tYfeAU7clLOSMb6TuEJmU hfVT4JzlCTZI9FgI54InEHWWr99xf3Egvr+DSd/z2OzTw7yIg+2Z6TOublxySEu1T5 rUlm/3leT/O5FXJfSA+UW2fG5vVktd6bCmKVR4as= Subject: Re: [PATCH v1 0/4] [RFC] Implement Trampoline File Descriptor To: David Laight , 'Mark Rutland' References: <20200728131050.24443-1-madvenka@linux.microsoft.com> <6540b4b7-3f70-adbf-c922-43886599713a@linux.microsoft.com> <46a1adef-65f0-bd5e-0b17-54856fb7e7ee@linux.microsoft.com> <20200731183146.GD67415@C02TD0UTHF1T.local> <7fdc102e-75ea-6d91-d2a3-7fe8c91802ce@linux.microsoft.com> From: "Madhavan T. Venkataraman" Message-ID: Date: Mon, 3 Aug 2020 12:00:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_130006_882811_C69AF6AD X-CRM114-Status: GOOD ( 12.68 ) 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: Kernel Hardening , Linux API , X86 ML , LKML , Oleg Nesterov , LSM List , Andy Lutomirski , Linux FS Devel , linux-integrity , linux-arm-kernel 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 8/3/20 11:57 AM, David Laight wrote: > From: Madhavan T. Venkataraman >> Sent: 03 August 2020 17:03 >> >> On 8/3/20 3:27 AM, David Laight wrote: >>> From: Mark Rutland >>>> Sent: 31 July 2020 19:32 >>> ... >>>>> It requires PC-relative data references. I have not worked on all architectures. >>>>> So, I need to study this. But do all ISAs support PC-relative data references? >>>> Not all do, but pretty much any recent ISA will as it's a practical >>>> necessity for fast position-independent code. >>> i386 has neither PC-relative addressing nor moves from %pc. >>> The cpu architecture knows that the sequence: >>> call 1f >>> 1: pop %reg >>> is used to get the %pc value so is treated specially so that >>> it doesn't 'trash' the return stack. >>> >>> So PIC code isn't too bad, but you have to use the correct >>> sequence. >> Is that true only for 32-bit systems only? I thought RIP-relative addressing was >> introduced in 64-bit mode. Please confirm. > I said i386 not amd64 or x86-64. I am sorry. My bad. > > So yes, 64bit code has PC-relative addressing. > But I'm pretty sure it has no other way to get the PC itself > except using call - certainly nothing in the 'usual' instructions. OK. Madhavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel