From patchwork Tue Jul 30 00:48:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1138735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-104037-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="c4IWX4wU"; 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 45yHxj14gNz9sBF for ; Tue, 30 Jul 2019 10:49:12 +1000 (AEST) 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=fAx+TZd9MFCTRAKt w4mNTJ5uFjsoR/MWHJeHmJxEGJUtsLksE9CRQ25uhTGb9R4iNzQtIEZIrNpnlbpe wgQo34cC93oNKFT8pYep6S0r32aw3RkuIUcFRlk4RWYRwJpGoZvR4ziLMtTk5BeS dU9WltG6xhU54nKAMJzw+ZYsaEA= 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=oAocJaT2GQQrpAeVq8v/N6 hrsEM=; b=c4IWX4wUF6VwWsvvVXWvxCg4AYvXgr/Vw3xSjUEGt6ZBOYgJHK4p/0 Rwk41AgV6HmytUbg3PEZeWGNIiFdzytKQMTtN1jiREb1F9hRP/QF/bxIL6FFtxj+ l0EPAOMqGjqxarWx3iV5s+1Lk7lV71K3vf3n0jB/8v2DdNwNgykzc= Received: (qmail 47578 invoked by alias); 30 Jul 2019 00:49:06 -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 47513 invoked by uid 89); 30 Jul 2019 00:49:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=preparation X-HELO: relay1.mentorg.com Date: Tue, 30 Jul 2019 00:48:53 +0000 From: Joseph Myers To: CC: , Subject: Restore r31 setting in powerpc32 swapcontext Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Commit ffe8a9a8318e1db225b22da8bc067408494bac5c, "powerpc: Remove rt_sigreturn usage on context function", removed from powerpc32 swapcontext a setting of r31 that is relied upon in subsequent code. I'm not sure why this didn't produce test failures in Adhemerval's 32-bit testing; in my (soft-float) testing in preparation for 2.30 release, I see several context-related failures FAIL: stdlib/tst-makecontext2 FAIL: stdlib/tst-makecontext3 FAIL: stdlib/tst-setcontext FAIL: stdlib/tst-setcontext2 FAIL: stdlib/tst-setcontext4 FAIL: stdlib/tst-setcontext7 FAIL: stdlib/tst-setcontext9 FAIL: stdlib/tst-swapcontext1 that did not appear in 2.29 testing. This patch restores the removed register setting in question, and thus fixes those failures. Tested for powerpc (soft-float). 2019-07-30 Joseph Myers * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S (__CONTEXT_FUNC_NAME): Restore setting of r31. diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S index efebb10bba..6fa1ab7d6e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S @@ -276,6 +276,9 @@ ENTRY(__CONTEXT_FUNC_NAME) cmpwi r3,0 bne 3f /* L(error_exit) */ + lwz r4,_FRAME_PARM_SAVE2(r1) + lwz r31,_UC_REGS_PTR(r4) + #ifdef __CONTEXT_ENABLE_FPRS # ifdef __CONTEXT_ENABLE_VRS