PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15844
PG Version12beta1
OSLinux
Opened2019-06-11 04:39:35+00
Reported byYunqiang Su
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15844
Logged by:          Yunqiang Su
Email address:      (redacted)
PostgreSQL version: 12beta1
Operating system:   Linux
Description:        

MIPS r6 changes the encoding of LL/SC instruction,
while the .set mips2 will force assembler to generate
old encoding.

This patch can fix this problem.

In fact if we not willing to support MIPS I or any CPU without ll/sc
at all, we can just remove .set mips2 here.

Index: postgresql-11-11.2/src/include/storage/s_lock.h
===================================================================
--- postgresql-11-11.2.orig/src/include/storage/s_lock.h
+++ postgresql-11-11.2/src/include/storage/s_lock.h
@@ -606,6 +606,13 @@ typedef unsigned int slock_t;
 
 #define TAS(lock) tas(lock)
 
+
+#if __mips_isa_rev >= 6
+# define MIPS_SET_VER "			\n"
+#else
+# define MIPS_SET_VER ".set mips2	\n"
+#endif
+
 static __inline__ int
 tas(volatile slock_t *lock)
 {
@@ -615,7 +622,7 @@ tas(volatile slock_t *lock)
 
 	__asm__ __volatile__(
 		"       .set push           \n"
-		"       .set mips2          \n"
+		MIPS_SET_VER
 		"       .set noreorder      \n"
 		"       .set nomacro        \n"
 		"       ll      %0, %2      \n"
@@ -637,7 +644,7 @@ do \
 { \
 	__asm__ __volatile__( \
 		"       .set push           \n" \
-		"       .set mips2          \n" \
+		MIPS_SET_VER			\
 		"       .set noreorder      \n" \
 		"       .set nomacro        \n" \
 		"       sync                \n" \

Messages

DateAuthorSubject
2019-06-11 04:39:35+00PG Bug reporting formBUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-11 04:57:23+00Michael PaquierRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-11 05:12:54+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-13 14:07:15+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-13 19:53:15+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 01:46:08+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 01:49:28+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 03:32:15+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 03:52:54+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 04:28:02+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 04:38:05+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-16 16:16:53+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-17 15:29:49+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-17 16:32:07+00Andres FreundRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-17 16:50:22+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-22 04:21:09+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-22 19:05:32+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-22 22:37:07+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-22 22:59:44+00YunQiang SuRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build
2019-06-22 23:21:40+00Tom LaneRe: BUG #15844: MIPS: remove .set mips2 in s_lock.h to fix r6 build