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 [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) From: Florian Weimer To: libc-alpha@sourceware.org Cc: Matheus Castanho , Lucas A. M. =?utf-8?Q?Magalh?= =?utf-8?Q?=C3=A3es?= , Tulio Magno Quites Machado Filho 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 Content-Type: text/plain 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-List-Received-Date: Thu, 21 Jan 2021 17:43:16 -0000 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"). --- 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), \ -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill