From patchwork Thu Sep 11 17:30:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 388338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7E5B114011D for ; Fri, 12 Sep 2014 03:30:16 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=TX0ivRB6KjXOK2hv uwKVJE0+DIXXf1lTkffqtdlrjYDLfNncZCf8OPK7xsB811hQXywr+7g7EwI6f1tl +DVdm5yVK2xZUsEyKXJq1IPlN9t1WPwT/ZPGxsoqt2iS3aZdLqYXRJQ70Bz+1qdG 7NLGlBnTtR63cPyiV8lfKqfSQ30= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=UjG3Xx2xeBZqJ8/nnAp65F dF8z0=; b=l2fKgQ2zL5wRC+sIKepfDEv1neH8nAK1fA726/8qtl9folhLysjh5J HyqtxBCzTn2YUY0iVWWoxTCVD1sGo6vc4E/wM7dNpMRgPKqFZtfXwip9XAmpCpaz GRphK7K3xD4vR5StRMaz3T9qgUkXWde/l6ObEzjwqZYMU8ya3c9uo= Received: (qmail 428 invoked by alias); 11 Sep 2014 17:30:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 419 invoked by uid 89); 11 Sep 2014 17:30:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Thu, 11 Sep 2014 23:00:02 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: carlos@redhat.com Subject: [PATCH] Enhance tst-xmmymm.sh to detect zmm register usage in ld.so Message-ID: <20140911173002.GJ14885@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Hi, 2d63a517e4084ec80403cd9f278690fa8b676cc4 added support to save and restore zmm register in the dynamic linker, but did not enhance test-xmmymm.sh to detect accidental usage of these registers. The patch below adds that check. Tested on x86_64 by injecting an instruction into dl-runtime.os. Siddhesh * sysdeps/x86/tst-xmmymm.sh: Check for zmm register usage. diff --git a/sysdeps/x86/tst-xmmymm.sh b/sysdeps/x86/tst-xmmymm.sh index 69ddb58..fe37328 100755 --- a/sysdeps/x86/tst-xmmymm.sh +++ b/sysdeps/x86/tst-xmmymm.sh @@ -1,5 +1,5 @@ #! /bin/bash -# Make sure no code in ld.so uses xmm/ymm registers on x86-64. +# Make sure no code in ld.so uses xmm/ymm/zmm registers on x86-64. # Copyright (C) 2009-2014 Free Software Foundation, Inc. # This file is part of the GNU C Library. @@ -80,12 +80,12 @@ echo "object files needed: $tocheck" cp /dev/null "$tmp" for f in $tocheck; do $OBJDUMP -d "$objpfx"../*/"$f" | - awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xy]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' | + awk 'BEGIN { last="" } /^[[:xdigit:]]* <[_[:alnum:]]*>:$/ { fct=substr($2, 2, length($2)-3) } /,%[xyz]mm[[:digit:]]*$/ { if (last != fct) { print fct; last=fct} }' | while read fct; do if test "$fct" = "_dl_runtime_profile" -o "$fct" = "_dl_x86_64_restore_sse"; then continue; fi - echo "function $fct in $f modifies xmm/ymm" >> "$tmp" + echo "function $fct in $f modifies xmm/ymm/zmm" >> "$tmp" result=1 done done