From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id A2A4638708E8 for ; Mon, 1 Feb 2021 19:46:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A2A4638708E8 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-Gw-DJKklPsuV4fm4jN_b7g-1; Mon, 01 Feb 2021 14:46:11 -0500 X-MC-Unique: Gw-DJKklPsuV4fm4jN_b7g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 92D6A1005D44; Mon, 1 Feb 2021 19:46:10 +0000 (UTC) Received: from greed.delorie.com (ovpn-114-77.rdu2.redhat.com [10.10.114.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 691A65C1A1; Mon, 1 Feb 2021 19:46:10 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.14.7/8.14.7) with ESMTP id 111Jk9ne023689; Mon, 1 Feb 2021 14:46:09 -0500 From: DJ Delorie To: "Madhavan T. Venkataraman" Cc: libffi-discuss@sourceware.org Subject: Re: [RFC PATCH v3 2/5] x86: Support for Static Trampolines In-Reply-To: (madvenka@linux.microsoft.com) Date: Mon, 01 Feb 2021 14:46:09 -0500 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 19:46:15 -0000 "Madhavan T. Venkataraman" writes: > Yes. But the problem I ran into is that if libffi is compiled with old > compilers that have not yet been updated for Intel CET, the builds fail > because the assembler cannot recognize endbr64 and endbr32. > > This happened in CI testing. In the previous version, I had the endbr64 in the code > like you suggested. I suggested keeping the __CET_ENDBR macro in, not the endbr64 code itself. > As for the repeat count, here is the reason. Yes, I know why we're *using* repeat. I'm suggesting some clever math to *calculate* the repeat count, instead of hard-coding it. That way the math gives you the most copies per page regardless of whether __CET_ENDBR is defined or empty. Of course, you could just use the largest repeate count you'll need, and ignore any parts of the template that fall past the end of the page. But you still need to know how many trampolines are usable in that page.