public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Cc: "Matheus Castanho" <msc@linux.ibm.com>,
	"Lucas A. M. Magalhães" <lamm@linux.ibm.com>,
	"Tulio Magno Quites Machado Filho" <tuliom@linux.vnet.ibm.com>
Subject: [PATCH] powerpc64: Select POWER9 machine for the scv instruction
Date: Thu, 21 Jan 2021 18:43:04 +0100	[thread overview]
Message-ID: <87y2gmrxsn.fsf@oldenburg.str.redhat.com> (raw)

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


             reply	other threads:[~2021-01-21 17:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 17:43 Florian Weimer [this message]
2021-01-21 22:00 ` Tulio Magno Quites Machado Filho
2021-01-22  9:44   ` Florian Weimer
2021-01-22 10:59     ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2gmrxsn.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=lamm@linux.ibm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=msc@linux.ibm.com \
    --cc=tuliom@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).