From patchwork Sat Oct 19 18:33:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1179869 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106132-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="JPMmLW0h"; dkim-atps=neutral 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 46wWl61XWdz9sP3 for ; Sun, 20 Oct 2019 05:34:09 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:cc:from:subject:message-id:date :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=X1QD6DzbmbVBJlBakysrUTgMDd3vVuh0HzmvF4cfDQ7FlouaYbtQp dAUI5QUd3nIqKKE/hodiXlUZ5Z9QSa6gMY6OkShu6z4dGfbcH14KO9oFR25oq/Pv 6jF9PTh+XZZbMKNHZuuu6cnO6oZhm9vK2EqPBXhQA1nbYBQQdead5Q= 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:to:cc:from:subject:message-id:date :mime-version:content-type:content-transfer-encoding; s=default; bh=/FWw/0IqP46sdRea7atbm41Sa4c=; b=JPMmLW0h3C9F4wzWLiF5v/6+ur6O VST3xQtQFdwiZJNvZTWa3wNAVMV+LKPnmsx8baI1exnrP+gdwGTL2C7G3zbt3M6Y ZSsFpFHXXN21qCZoQfuHsS1CTr6eQOKC+05sCTC7jzKaNW8bGI/64a0ecs1/ZnH7 eMicxnvAbHZAg2Q= Received: (qmail 98576 invoked by alias); 19 Oct 2019 18:34:03 -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 98568 invoked by uid 89); 19 Oct 2019 18:34:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 spammy=sanity, adjusts, Clone X-HELO: torfep01.bell.net To: GNU C Library Cc: Carlos O'Donell From: John David Anglin Subject: [PATCH] hppa: Fix stack alignment passed to clone Openpgp: preference=signencrypt Message-ID: Date: Sat, 19 Oct 2019 14:33:59 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 X-CM-Analysis: v=2.3 cv=S9inP7kP c=1 sm=1 tr=0 cx=a_idp_d a=htCe9XT+XAlGhzqgweArVg==:117 a=htCe9XT+XAlGhzqgweArVg==:17 a=IkcTkHD0fZMA:10 a=XobE76Q3jBoA:10 a=MuJcwH_GDME7-Ze0LDYA:9 a=QEXdDO2ut3YA:10 X-CM-Envelope: MS4wfL+huWog1A2cYxkXUBfJwfu081209JeOOVyqLdhIIr6yNO4u888GvvsIlsbmCbanqN9GutJAZSMl55GMWODzQbjDYTYLzFE/+P/y0uGd0DLiaOeRNf2/ i6r8NryDLvQPRTsmpGDybxqoqLGIqw2IuRCcef7vZifQCPCft3FwjuZ0v8Qd7qejWkbNGqhMnla28A== The hppa architecture requires strict alignment for loads and stores. As a result, the minimum stack alignment that will work is 8 bytes. This patch adjust __clone() to align the stack argument passed to it. It also adjusts slightly some formatting. This fixes the nptl/tst-tls1 test. Okay? Dave sysdeps/unix/sysv/linux/hppa/clone.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S index 6db2cb5dd5..372d29a838 100644 --- a/sysdeps/unix/sysv/linux/hppa/clone.S +++ b/sysdeps/unix/sysv/linux/hppa/clone.S @@ -73,13 +73,18 @@ ENTRY(__clone) #endif /* Sanity check arguments. */ - comib,=,n 0, %arg0, .LerrorSanity /* no NULL function pointers */ - comib,=,n 0, %arg1, .LerrorSanity /* no NULL stack pointers */ + comib,=,n 0,%arg0,.LerrorSanity /* no NULL function pointers */ + comib,=,n 0,%arg1,.LerrorSanity /* no NULL stack pointers */ + + /* Ensure stack argument is 8-byte aligned. */ + ldo 7(%r25),%r25 + depi 0,31,3,%r25 /* Save the function pointer, arg, and flags on the new stack. */ stwm %r26, 64(%r25) stw %r23, -60(%r25) stw %r24, -56(%r25) + /* Clone arguments are (int flags, void * child_stack) */ copy %r24, %r26 /* flags are first */ /* User stack pointer is in the correct register already */