Skip to contentSkip to conversation

bsd-user: improve support for sparc syscall flags

PATCH In review [email protected] 3 participants 9 messages Jan 24, 2020 – Jan 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bsd-user: improve support for sparc syscall flags

From: Salvador Fandino <[email protected]>

Under sparc and sparc64, both NetBSD and OpenSSH use two bits of the syscall number as flags. Until now, those bits where only supported for sparc64 when emulating OpenBSD.

This patch extends support for syscall flags to the sparc architecture and NetBSD emulation. It had allowed my to run simple NetBSD sparc applications with qemu-sparc on a FreeBSD x64 machine.

The code supporting OpenBSD sparc and sparc64 emulation has been refactored in order to make it simpler and similar to the new one for NetBSD.

---
 bsd-user/main.c              | 68 ++++++++++++++++++++++++------------
 bsd-user/netbsd/syscall_nr.h | 52 +++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 22 deletions(-)
bsd-user/main.c +46 -22
index 770c2b267a..e249d66e26 100644
@@ -491,7 +491,7 @@ static void flush_windows(CPUSPARCState *env)
 void cpu_loop(CPUSPARCState *env)
 {
     CPUState *cs = env_cpu(env);
-    int trapnr, ret, syscall_nr;
+    int trapnr, ret, syscall_nr, syscall_flags;
     //target_siginfo_t info;
 
     while (1) {
@@ -511,21 +511,29 @@ void cpu_loop(CPUSPARCState *env)
         case 0x100:
 #endif
             syscall_nr = env->gregs[1];
-            if (bsd_type == target_freebsd)
+            if (bsd_type == target_freebsd) {
                 ret = do_freebsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
                                          env->regwptr[4], env->regwptr[5], 0, 0);
-            else if (bsd_type == target_netbsd)
+            }
+            else if (bsd_type == target_netbsd) {
+                syscall_flags = syscall_nr & (TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G2RFLAG);
+                syscall_nr &= ~(TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                TARGET_NETBSD_SYSCALL_G2RFLAG);
                 ret = do_netbsd_syscall(env, syscall_nr,
                                         env->regwptr[0], env->regwptr[1],
                                         env->regwptr[2], env->regwptr[3],
                                         env->regwptr[4], env->regwptr[5]);
+            }
             else { //if (bsd_type == target_openbsd)
-#if defined(TARGET_SPARC64)
-                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G7RFLAG |
-                                TARGET_OPENBSD_SYSCALL_G2RFLAG);
-#endif
+                syscall_flags = syscall_nr & (TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                              TARGET_OPENBSD_SYSCALL_G7RFLAG);
+                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                TARGET_OPENBSD_SYSCALL_G7RFLAG);
                 ret = do_openbsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
@@ -547,23 +555,39 @@ void cpu_loop(CPUSPARCState *env)
             }
             env->regwptr[0] = ret;
             /* next instruction */
-#if defined(TARGET_SPARC64)
-            if (bsd_type == target_openbsd &&
-                env->gregs[1] & TARGET_OPENBSD_SYSCALL_G2RFLAG) {
-                env->pc = env->gregs[2];
-                env->npc = env->pc + 4;
-            } else if (bsd_type == target_openbsd &&
-                       env->gregs[1] & TARGET_OPENBSD_SYSCALL_G7RFLAG) {
-                env->pc = env->gregs[7];
-                env->npc = env->pc + 4;
-            } else {
+            if (bsd_type == target_openbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_OPENBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                default: /* G2 or G2|G7 */
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            }
+            else if (bsd_type == target_netbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_NETBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G5RFLAG:
+                    env->pc = env->gregs[5];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G2RFLAG:
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            }
+            else  {
                 env->pc = env->npc;
-                env->npc = env->npc + 4;
             }
-#else
-            env->pc = env->npc;
-            env->npc = env->npc + 4;
-#endif
+            env->npc = env->pc + 4;
             break;
         case 0x83: /* flush windows */
 #ifdef TARGET_ABI32
bsd-user/netbsd/syscall_nr.h +52 -0

55 lines not on this page · raw message

Signature · 1 line
2.24.1
#1 lore raw
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PATCH] bsd-user: improve support for sparc syscall flags

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
74a56ab bsd-user: improve support for sparc syscall flags

=== OUTPUT BEGIN ===
ERROR: else should follow close brace '}'
#47: FILE: bsd-user/main.c:520:
+ }
+ else if (bsd_type == target_netbsd) {

ERROR: else should follow close brace '}'
#104: FILE: bsd-user/main.c:571:

             }

+ else if (bsd_type == target_netbsd) {

ERROR: else should follow close brace '}'
#120: FILE: bsd-user/main.c:587:
+ }
+ else {

ERROR: code indent should never use tabs
#136: FILE: bsd-user/netbsd/syscall_nr.h:375:
+/*^I$NetBSD: trap.h,v 1.18 2011/03/27 18:47:08 martin Exp $ */$

ERROR: code indent should never use tabs
#140: FILE: bsd-user/netbsd/syscall_nr.h:379:
+ *^IThe Regents of the University of California. All rights reserved.$

ERROR: code indent should never use tabs
#148: FILE: bsd-user/netbsd/syscall_nr.h:387:
+ *^IThis product includes software developed by the University of$

ERROR: code indent should never use tabs
#149: FILE: bsd-user/netbsd/syscall_nr.h:388:
+ *^ICalifornia, Lawrence Berkeley Laboratory.$

ERROR: code indent should never use tabs
#175: FILE: bsd-user/netbsd/syscall_nr.h:414:
+ *^I@(#)trap.h^I8.1 (Berkeley) 6/11/93$

ERROR: line over 90 characters
#184: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define TARGET_NETBSD_SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */

ERROR: code indent should never use tabs
#184: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define^ITARGET_NETBSD_SYSCALL_G2RFLAG^I0x400^I/* on success, return to %g2 rather than npc */$

WARNING: line over 80 characters
#185: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define TARGET_NETBSD_SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */

ERROR: code indent should never use tabs
#185: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define^ITARGET_NETBSD_SYSCALL_G7RFLAG^I0x800^I/* use %g7 as above (deprecated) */$

ERROR: line over 90 characters
#186: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define TARGET_NETBSD_SYSCALL_G5RFLAG 0xc00 /* use %g5 as above (only ABI compatible way) */

ERROR: code indent should never use tabs
#186: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define^ITARGET_NETBSD_SYSCALL_G5RFLAG^I0xc00^I/* use %g5 as above (only ABI compatible way) */$

total: 13 errors, 1 warnings, 153 lines checked

Commit 74a56abec155 (bsd-user: improve support for sparc syscall flags) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#2 lore raw
Quoted 8 lines · On 24/1/20 20:44, [email protected] wrote:

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

A new patch is coming fixing the errors found by patchew in bsd-user/main.c

I am not changing any of the new code in bsd-user/netbsd/syscall_nr.h as it has been copied from NetBSD source, in the same way it was done for bsd-user/openbsd/syscall_nr.h.

#3 lore raw

PATCH 1/1 bsd-user: improve support for sparc syscall flags

From: Salvador Fandino <[email protected]>

Under sparc and sparc64, both NetBSD and OpenSSH use two bits of the syscall number as flags. Until now, those bits where only supported for sparc64 when emulating OpenBSD.

This patch extends support for syscall flags to the sparc architecture and NetBSD emulation. It had allowed my to run simple NetBSD sparc applications with qemu-sparc on a FreeBSD x64 machine.

The code supporting OpenBSD sparc and sparc64 emulation has been refactored in order to make it simpler and similar to the new one for NetBSD.

---
 bsd-user/main.c              | 66 +++++++++++++++++++++++-------------
 bsd-user/netbsd/syscall_nr.h | 52 ++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+), 23 deletions(-)
bsd-user/main.c +43 -23
index 770c2b267a..9158ecbc5c 100644
@@ -491,7 +491,7 @@ static void flush_windows(CPUSPARCState *env)
 void cpu_loop(CPUSPARCState *env)
 {
     CPUState *cs = env_cpu(env);
-    int trapnr, ret, syscall_nr;
+    int trapnr, ret, syscall_nr, syscall_flags;
     //target_siginfo_t info;
 
     while (1) {
@@ -511,21 +511,27 @@ void cpu_loop(CPUSPARCState *env)
         case 0x100:
 #endif
             syscall_nr = env->gregs[1];
-            if (bsd_type == target_freebsd)
+            if (bsd_type == target_freebsd) {
                 ret = do_freebsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
                                          env->regwptr[4], env->regwptr[5], 0, 0);
-            else if (bsd_type == target_netbsd)
+            } else if (bsd_type == target_netbsd) {
+                syscall_flags = syscall_nr & (TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G2RFLAG);
+                syscall_nr &= ~(TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                TARGET_NETBSD_SYSCALL_G2RFLAG);
                 ret = do_netbsd_syscall(env, syscall_nr,
                                         env->regwptr[0], env->regwptr[1],
                                         env->regwptr[2], env->regwptr[3],
                                         env->regwptr[4], env->regwptr[5]);
-            else { //if (bsd_type == target_openbsd)
-#if defined(TARGET_SPARC64)
-                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G7RFLAG |
-                                TARGET_OPENBSD_SYSCALL_G2RFLAG);
-#endif
+            } else { //if (bsd_type == target_openbsd)
+                syscall_flags = syscall_nr & (TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                              TARGET_OPENBSD_SYSCALL_G7RFLAG);
+                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                TARGET_OPENBSD_SYSCALL_G7RFLAG);
                 ret = do_openbsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
@@ -547,23 +553,37 @@ void cpu_loop(CPUSPARCState *env)
             }
             env->regwptr[0] = ret;
             /* next instruction */
-#if defined(TARGET_SPARC64)
-            if (bsd_type == target_openbsd &&
-                env->gregs[1] & TARGET_OPENBSD_SYSCALL_G2RFLAG) {
-                env->pc = env->gregs[2];
-                env->npc = env->pc + 4;
-            } else if (bsd_type == target_openbsd &&
-                       env->gregs[1] & TARGET_OPENBSD_SYSCALL_G7RFLAG) {
-                env->pc = env->gregs[7];
-                env->npc = env->pc + 4;
-            } else {
+            if (bsd_type == target_openbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_OPENBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                default: /* G2 or G2|G7 */
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            } else if (bsd_type == target_netbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_NETBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G5RFLAG:
+                    env->pc = env->gregs[5];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G2RFLAG:
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            } else  {  //if (bsd_type == target_freebsd)
                 env->pc = env->npc;
-                env->npc = env->npc + 4;
             }
-#else
-            env->pc = env->npc;
-            env->npc = env->npc + 4;
-#endif
+            env->npc = env->pc + 4;
             break;
         case 0x83: /* flush windows */
 #ifdef TARGET_ABI32
bsd-user/netbsd/syscall_nr.h +52 -0

55 lines not on this page · raw message

Signature · 1 line
2.24.1
#4 lore raw
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PATCH] bsd-user: improve support for sparc syscall flags

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
636238f bsd-user: improve support for sparc syscall flags

=== OUTPUT BEGIN ===
ERROR: do not use C99 // comments
#62: FILE: bsd-user/main.c:530:
+ } else { //if (bsd_type == target_openbsd)

ERROR: do not use C99 // comments
#111: FILE: bsd-user/main.c:583:
+ } else { //if (bsd_type == target_freebsd)

ERROR: code indent should never use tabs
#132: FILE: bsd-user/netbsd/syscall_nr.h:375:
+/*^I$NetBSD: trap.h,v 1.18 2011/03/27 18:47:08 martin Exp $ */$

ERROR: code indent should never use tabs
#136: FILE: bsd-user/netbsd/syscall_nr.h:379:
+ *^IThe Regents of the University of California. All rights reserved.$

ERROR: code indent should never use tabs
#144: FILE: bsd-user/netbsd/syscall_nr.h:387:
+ *^IThis product includes software developed by the University of$

ERROR: code indent should never use tabs
#145: FILE: bsd-user/netbsd/syscall_nr.h:388:
+ *^ICalifornia, Lawrence Berkeley Laboratory.$

ERROR: code indent should never use tabs
#171: FILE: bsd-user/netbsd/syscall_nr.h:414:
+ *^I@(#)trap.h^I8.1 (Berkeley) 6/11/93$

ERROR: line over 90 characters
#180: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define TARGET_NETBSD_SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */

ERROR: code indent should never use tabs
#180: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define^ITARGET_NETBSD_SYSCALL_G2RFLAG^I0x400^I/* on success, return to %g2 rather than npc */$

WARNING: line over 80 characters
#181: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define TARGET_NETBSD_SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */

ERROR: code indent should never use tabs
#181: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define^ITARGET_NETBSD_SYSCALL_G7RFLAG^I0x800^I/* use %g7 as above (deprecated) */$

ERROR: line over 90 characters
#182: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define TARGET_NETBSD_SYSCALL_G5RFLAG 0xc00 /* use %g5 as above (only ABI compatible way) */

ERROR: code indent should never use tabs
#182: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define^ITARGET_NETBSD_SYSCALL_G5RFLAG^I0xc00^I/* use %g5 as above (only ABI compatible way) */$

total: 12 errors, 1 warnings, 149 lines checked

Commit 636238f7ed82 (bsd-user: improve support for sparc syscall flags) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#5 lore raw

PATCH 1/1 bsd-user: improve support for sparc syscall flags

From: Salvador Fandino <[email protected]>

Under sparc and sparc64, both NetBSD and OpenSSH use two bits of the syscall number as flags. Until now, those bits where only supported for sparc64 when emulating OpenBSD.

This patch extends support for syscall flags to the sparc architecture and NetBSD emulation. It had allowed my to run simple NetBSD sparc applications with qemu-sparc on a FreeBSD x64 machine.

The code supporting OpenBSD sparc and sparc64 emulation has been refactored in order to make it simpler and similar to the new one for NetBSD.

---
 bsd-user/main.c              | 66 +++++++++++++++++++++++-------------
 bsd-user/netbsd/syscall_nr.h | 52 ++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+), 23 deletions(-)
bsd-user/main.c +43 -23
index 770c2b267a..5706261f15 100644
@@ -491,7 +491,7 @@ static void flush_windows(CPUSPARCState *env)
 void cpu_loop(CPUSPARCState *env)
 {
     CPUState *cs = env_cpu(env);
-    int trapnr, ret, syscall_nr;
+    int trapnr, ret, syscall_nr, syscall_flags;
     //target_siginfo_t info;
 
     while (1) {
@@ -511,21 +511,27 @@ void cpu_loop(CPUSPARCState *env)
         case 0x100:
 #endif
             syscall_nr = env->gregs[1];
-            if (bsd_type == target_freebsd)
+            if (bsd_type == target_freebsd) {
                 ret = do_freebsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
                                          env->regwptr[4], env->regwptr[5], 0, 0);
-            else if (bsd_type == target_netbsd)
+            } else if (bsd_type == target_netbsd) {
+                syscall_flags = syscall_nr & (TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                              TARGET_NETBSD_SYSCALL_G2RFLAG);
+                syscall_nr &= ~(TARGET_NETBSD_SYSCALL_G7RFLAG |
+                                TARGET_NETBSD_SYSCALL_G5RFLAG |
+                                TARGET_NETBSD_SYSCALL_G2RFLAG);
                 ret = do_netbsd_syscall(env, syscall_nr,
                                         env->regwptr[0], env->regwptr[1],
                                         env->regwptr[2], env->regwptr[3],
                                         env->regwptr[4], env->regwptr[5]);
-            else { //if (bsd_type == target_openbsd)
-#if defined(TARGET_SPARC64)
-                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G7RFLAG |
-                                TARGET_OPENBSD_SYSCALL_G2RFLAG);
-#endif
+            } else { /* if (bsd_type == target_openbsd) */
+                syscall_flags = syscall_nr & (TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                              TARGET_OPENBSD_SYSCALL_G7RFLAG);
+                syscall_nr &= ~(TARGET_OPENBSD_SYSCALL_G2RFLAG |
+                                TARGET_OPENBSD_SYSCALL_G7RFLAG);
                 ret = do_openbsd_syscall(env, syscall_nr,
                                          env->regwptr[0], env->regwptr[1],
                                          env->regwptr[2], env->regwptr[3],
@@ -547,23 +553,37 @@ void cpu_loop(CPUSPARCState *env)
             }
             env->regwptr[0] = ret;
             /* next instruction */
-#if defined(TARGET_SPARC64)
-            if (bsd_type == target_openbsd &&
-                env->gregs[1] & TARGET_OPENBSD_SYSCALL_G2RFLAG) {
-                env->pc = env->gregs[2];
-                env->npc = env->pc + 4;
-            } else if (bsd_type == target_openbsd &&
-                       env->gregs[1] & TARGET_OPENBSD_SYSCALL_G7RFLAG) {
-                env->pc = env->gregs[7];
-                env->npc = env->pc + 4;
-            } else {
+            if (bsd_type == target_openbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_OPENBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                default: /* G2 or G2|G7 */
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            } else if (bsd_type == target_netbsd) {
+                switch (syscall_flags) {
+                case 0:
+                    env->pc = env->npc;
+                    break;
+                case TARGET_NETBSD_SYSCALL_G7RFLAG:
+                    env->pc = env->gregs[7];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G5RFLAG:
+                    env->pc = env->gregs[5];
+                    break;
+                case TARGET_NETBSD_SYSCALL_G2RFLAG:
+                    env->pc = env->gregs[2];
+                    break;
+                }
+            } else  {  /* if (bsd_type == target_freebsd) */
                 env->pc = env->npc;
-                env->npc = env->npc + 4;
             }
-#else
-            env->pc = env->npc;
-            env->npc = env->npc + 4;
-#endif
+            env->npc = env->pc + 4;
             break;
         case 0x83: /* flush windows */
 #ifdef TARGET_ABI32
bsd-user/netbsd/syscall_nr.h +52 -0

55 lines not on this page · raw message

Signature · 1 line
2.24.1
#6 lore raw
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PATCH] bsd-user: improve support for sparc syscall flags

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected]
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
e256a0f bsd-user: improve support for sparc syscall flags

=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#132: FILE: bsd-user/netbsd/syscall_nr.h:375:
+/*^I$NetBSD: trap.h,v 1.18 2011/03/27 18:47:08 martin Exp $ */$

ERROR: code indent should never use tabs
#136: FILE: bsd-user/netbsd/syscall_nr.h:379:
+ *^IThe Regents of the University of California. All rights reserved.$

ERROR: code indent should never use tabs
#144: FILE: bsd-user/netbsd/syscall_nr.h:387:
+ *^IThis product includes software developed by the University of$

ERROR: code indent should never use tabs
#145: FILE: bsd-user/netbsd/syscall_nr.h:388:
+ *^ICalifornia, Lawrence Berkeley Laboratory.$

ERROR: code indent should never use tabs
#171: FILE: bsd-user/netbsd/syscall_nr.h:414:
+ *^I@(#)trap.h^I8.1 (Berkeley) 6/11/93$

ERROR: line over 90 characters
#180: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define TARGET_NETBSD_SYSCALL_G2RFLAG 0x400 /* on success, return to %g2 rather than npc */

ERROR: code indent should never use tabs
#180: FILE: bsd-user/netbsd/syscall_nr.h:423:
+#define^ITARGET_NETBSD_SYSCALL_G2RFLAG^I0x400^I/* on success, return to %g2 rather than npc */$

WARNING: line over 80 characters
#181: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define TARGET_NETBSD_SYSCALL_G7RFLAG 0x800 /* use %g7 as above (deprecated) */

ERROR: code indent should never use tabs
#181: FILE: bsd-user/netbsd/syscall_nr.h:424:
+#define^ITARGET_NETBSD_SYSCALL_G7RFLAG^I0x800^I/* use %g7 as above (deprecated) */$

ERROR: line over 90 characters
#182: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define TARGET_NETBSD_SYSCALL_G5RFLAG 0xc00 /* use %g5 as above (only ABI compatible way) */

ERROR: code indent should never use tabs
#182: FILE: bsd-user/netbsd/syscall_nr.h:425:
+#define^ITARGET_NETBSD_SYSCALL_G5RFLAG^I0xc00^I/* use %g5 as above (only ABI compatible way) */$

total: 10 errors, 1 warnings, 149 lines checked

Commit e256a0ff22ca (bsd-user: improve support for sparc syscall flags) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#7 lore raw

Le 25/01/2020 à 12:55, [email protected] a écrit :

Quoted 9 lines

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Salvador,

you can use scripts/checkpatch.pl in the QEMU directory to check your patch for style before sending them.

And don't send them as a reply but as a new thread, using versioning in the subject ("[PATCH v4]").

Thanks,
Laurent

#8 lore raw
Quoted 10 lines · Laurent Vivier

Le 25/01/2020 à 12:55, [email protected] a écrit :

Quoted 9 lines

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Quoted 7 lines

Salvador,

you can use scripts/checkpatch.pl in the QEMU directory to check your patch for style before sending them.

And don't send them as a reply but as a new thread, using versioning in the subject ("[PATCH v4]").

ok, I will do that in the future.

In any case, the style problems found by patchew for the last version of the patch I have submitted are for a fragment of a file copied verbatim from the NetBSD source code (in the same way the equivalent fragment was copied from OpenBSD when support for that OS was added). It is mostly the copyright header and a few defines. IMO, style shouldn't be corrected there.