From patchwork Thu Jan 21 17:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 41784 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0EC13865C2A; Thu, 21 Jan 2021 17:43:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0EC13865C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611250997; bh=Ou6jo3OXjlCP5d8cho36Kahi6M0WEDByBFs6UEHqveg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=mzai9DAWc6UkmHxUTvFBlFClpdtor0sQIy+1jBrzjYMxuXv+y8gqlHYGSEWnYREZS RFiqyv8AMTXVtlGTrTWj9NfQ6ENAhg/zV1Aw2dkHcyjaIt7AItlXA0hJBLrlJHe3Rm d05aZ2rLxUj27og+gUygFDMtfm9UBya9zYlEm5z4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 8EB3D385043E for ; Thu, 21 Jan 2021 17:43:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8EB3D385043E 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-356-2Zz1T2vYNX-to3pLI_nUWQ-1; Thu, 21 Jan 2021 12:43:08 -0500 X-MC-Unique: 2Zz1T2vYNX-to3pLI_nUWQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56A2D1005504; Thu, 21 Jan 2021 17:43:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-35.ams2.redhat.com [10.36.113.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC0BD5D9C6; Thu, 21 Jan 2021 17:43:05 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] powerpc64: Select POWER9 machine for the scv instruction Date: Thu, 21 Jan 2021 18:43:04 +0100 Message-ID: <87y2gmrxsn.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: Tulio Magno Quites Machado Filho Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is not available with the baseline ISA on powerpc64-linux-gnu. (powerpc64le-linux-gnu enables it unconditionally.) Fixes commit 68ab82f56690ada86ac1e0c46bad06ba189a10ef ("powerpc: Runtime selection between sc and scv for syscalls"). Reviewed-by: Tulio Magno Quites Machado Filho --- sysdeps/powerpc/powerpc64/sysdep.h | 3 +++ sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 3 +++ sysdeps/unix/sysv/linux/powerpc/sysdep.h | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h index cea05c8e17..c57bb1c05d 100644 --- a/sysdeps/powerpc/powerpc64/sysdep.h +++ b/sysdeps/powerpc/powerpc64/sysdep.h @@ -333,7 +333,10 @@ LT_LABELSUFFIX(name,_name_end): ; \ mflr r9; \ std r9,FRAME_LR_SAVE(r1); \ cfi_offset(lr,FRAME_LR_SAVE); \ + .machine "push"; \ + .machine "power9"; \ scv 0; \ + .machine "pop"; \ ld r9,FRAME_LR_SAVE(r1); \ mtlr r9; \ cfi_restore(lr); diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S index b59837b071..e9bd8cb960 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S @@ -76,7 +76,10 @@ ENTRY (__clone) because it uses CFI directives and we just called cfi_endproc. */ mflr r9 std r9,FRAME_LR_SAVE(r1) + .machine "push" + .machine "power9" scv 0 + .machine "pop" ld r9,FRAME_LR_SAVE(r1) mtlr r9 diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h index d3605d562d..6b99464e61 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h @@ -76,7 +76,10 @@ #define SYSCALL_SCV(nr) \ ({ \ __asm__ __volatile__ \ - ("scv 0\n\t" \ + (".machine \"push\"\n\t" \ + ".machine \"power9\"\n\t" \ + "scv 0\n\t" \ + ".machine \"pop\"\n\t" \ "0:" \ : "=&r" (r0), \ "=&r" (r3), "=&r" (r4), "=&r" (r5), \