mbox series

[v2,00/11] linux-user support for target/xtensa

Message ID 20180228221609.11265-1-jcmvbkbc@gmail.com
Headers show
Series linux-user support for target/xtensa | expand

Message

Max Filippov Feb. 28, 2018, 10:15 p.m. UTC
Hello,

this series adds linux-user support for target/xtensa.
It starts with a small cleanup for xtensa registers dumping.
It adds support for debugging linux-user process with xtensa-linux-gdb
(as opposed to xtensa-elf-gdb), which can only access unprivileged
registers.
It then enables MTTCG for xtensa.
It continues with a cleanup in linux-user/mmap area making sure that it
works correctly with limited 30-bit-wide user address space.
It then imports xtensa-specific definitions from the linux kernel,
conditionalizes user-only/softmmu-only code and adds handlers for signals
exceptions, process/thread creation and core registers dumping.

Changes v1->v2:
- add definition of TARGET_TIOCGPTPEER to linux-user/xtensa/termbits.h
- Cc linux-user maintainers

Max Filippov (11):
  target/xtensa: dump correct physical registers
  target/xtensa: mark register windows in the dump
  target/xtensa: use correct number of registers in gdbstub
  target/xtensa: support MTTCG
  linux-user: fix mmap/munmap/mprotect/mremap/shmat
  linux-user: fix assertion in shmdt
  linux-user: fix target_mprotect/target_munmap error return values
  linux-user: drop unused target_msync function
  target/xtensa: add linux-user support
  qemu-binfmt-conf.sh: add qemu-xtensa
  MAINTAINERS: fix W: address for xtensa

 MAINTAINERS                             |   2 +-
 configure                               |   1 +
 default-configs/xtensa-linux-user.mak   |   1 +
 default-configs/xtensaeb-linux-user.mak |   1 +
 include/exec/cpu-all.h                  |   2 +-
 include/exec/cpu_ldst.h                 |  12 +-
 linux-user/elfload.c                    |  58 +++++
 linux-user/main.c                       | 245 ++++++++++++++++++
 linux-user/mmap.c                       |  43 ++--
 linux-user/qemu.h                       |   1 -
 linux-user/signal.c                     | 257 ++++++++++++++++++-
 linux-user/syscall.c                    |  13 +-
 linux-user/syscall_defs.h               |  65 ++++-
 linux-user/xtensa/syscall.h             |   0
 linux-user/xtensa/syscall_nr.h          | 437 ++++++++++++++++++++++++++++++++
 linux-user/xtensa/target_cpu.h          |  22 ++
 linux-user/xtensa/target_elf.h          |  16 ++
 linux-user/xtensa/target_signal.h       |  28 ++
 linux-user/xtensa/target_structs.h      |  28 ++
 linux-user/xtensa/target_syscall.h      |  49 ++++
 linux-user/xtensa/termbits.h            | 328 ++++++++++++++++++++++++
 scripts/qemu-binfmt-conf.sh             |  12 +-
 target/xtensa/Makefile.objs             |   3 +-
 target/xtensa/cpu.c                     |  26 +-
 target/xtensa/cpu.h                     |  60 +++--
 target/xtensa/gdbstub.c                 |  14 +-
 target/xtensa/helper.c                  |  58 ++++-
 target/xtensa/helper.h                  |   4 +
 target/xtensa/op_helper.c               |  50 +++-
 target/xtensa/overlay_tool.h            |  11 +-
 target/xtensa/translate.c               |  99 ++++++--
 31 files changed, 1836 insertions(+), 110 deletions(-)
 create mode 100644 default-configs/xtensa-linux-user.mak
 create mode 100644 default-configs/xtensaeb-linux-user.mak
 create mode 100644 linux-user/xtensa/syscall.h
 create mode 100644 linux-user/xtensa/syscall_nr.h
 create mode 100644 linux-user/xtensa/target_cpu.h
 create mode 100644 linux-user/xtensa/target_elf.h
 create mode 100644 linux-user/xtensa/target_signal.h
 create mode 100644 linux-user/xtensa/target_structs.h
 create mode 100644 linux-user/xtensa/target_syscall.h
 create mode 100644 linux-user/xtensa/termbits.h

Comments

no-reply@patchew.org Feb. 28, 2018, 10:29 p.m. UTC | #1
Hi,

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

Type: series
Message-id: 20180228221609.11265-1-jcmvbkbc@gmail.com
Subject: [Qemu-devel] [PATCH v2 00/11] linux-user support for target/xtensa

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 t [tag update]            patchew/1519709965-29833-1-git-send-email-cota@braap.org -> patchew/1519709965-29833-1-git-send-email-cota@braap.org
 * [new tag]               patchew/20180228221609.11265-1-jcmvbkbc@gmail.com -> patchew/20180228221609.11265-1-jcmvbkbc@gmail.com
Switched to a new branch 'test'
dcccaafe47 MAINTAINERS: fix W: address for xtensa
e98bb39328 qemu-binfmt-conf.sh: add qemu-xtensa
c76d7fa337 target/xtensa: add linux-user support
623d335530 linux-user: drop unused target_msync function
a482435763 linux-user: fix target_mprotect/target_munmap error return values
1a5815f993 linux-user: fix assertion in shmdt
c126572faf linux-user: fix mmap/munmap/mprotect/mremap/shmat
6394f2caff target/xtensa: support MTTCG
bd2fa3e12c target/xtensa: use correct number of registers in gdbstub
7c57593be6 target/xtensa: mark register windows in the dump
2443667b5c target/xtensa: dump correct physical registers

=== OUTPUT BEGIN ===
Checking PATCH 1/11: target/xtensa: dump correct physical registers...
Checking PATCH 2/11: target/xtensa: mark register windows in the dump...
Checking PATCH 3/11: target/xtensa: use correct number of registers in gdbstub...
Checking PATCH 4/11: target/xtensa: support MTTCG...
Checking PATCH 5/11: linux-user: fix mmap/munmap/mprotect/mremap/shmat...
Checking PATCH 6/11: linux-user: fix assertion in shmdt...
Checking PATCH 7/11: linux-user: fix target_mprotect/target_munmap error return values...
Checking PATCH 8/11: linux-user: drop unused target_msync function...
Checking PATCH 9/11: target/xtensa: add linux-user support...
ERROR: code indent should never use tabs
#677: FILE: linux-user/syscall_defs.h:1396:
+#define TARGET_MAP_FIXED^I0x10^I^I/* Interpret addr exactly */$

ERROR: code indent should never use tabs
#678: FILE: linux-user/syscall_defs.h:1397:
+#define TARGET_MAP_ANONYMOUS^I0x0800^I^I/* don't use a file */$

ERROR: code indent should never use tabs
#679: FILE: linux-user/syscall_defs.h:1398:
+#define TARGET_MAP_GROWSDOWN^I0x1000^I^I/* stack-like segment */$

ERROR: code indent should never use tabs
#680: FILE: linux-user/syscall_defs.h:1399:
+#define TARGET_MAP_DENYWRITE^I0x2000^I^I/* ETXTBSY */$

ERROR: code indent should never use tabs
#681: FILE: linux-user/syscall_defs.h:1400:
+#define TARGET_MAP_EXECUTABLE^I0x4000^I^I/* mark it as an executable */$

ERROR: code indent should never use tabs
#682: FILE: linux-user/syscall_defs.h:1401:
+#define TARGET_MAP_LOCKED^I0x8000^I^I/* pages are locked */$

WARNING: line over 80 characters
#683: FILE: linux-user/syscall_defs.h:1402:
+#define TARGET_MAP_NORESERVE	0x0400		/* don't check for reservations */

ERROR: code indent should never use tabs
#683: FILE: linux-user/syscall_defs.h:1402:
+#define TARGET_MAP_NORESERVE^I0x0400^I^I/* don't check for reservations */$

WARNING: line over 80 characters
#684: FILE: linux-user/syscall_defs.h:1403:
+#define TARGET_MAP_POPULATE	0x10000		/* populate (prefault) pagetables */

ERROR: code indent should never use tabs
#684: FILE: linux-user/syscall_defs.h:1403:
+#define TARGET_MAP_POPULATE^I0x10000^I^I/* populate (prefault) pagetables */$

ERROR: code indent should never use tabs
#685: FILE: linux-user/syscall_defs.h:1404:
+#define TARGET_MAP_NONBLOCK^I0x20000^I^I/* do not block on IO */$

ERROR: code indent should never use tabs
#686: FILE: linux-user/syscall_defs.h:1405:
+#define TARGET_MAP_STACK^I0x40000$

WARNING: line over 80 characters
#848: FILE: linux-user/xtensa/syscall_nr.h:87:
+#define TARGET_NR_utime                               64     /* glibc 2.3.3 ?? */

WARNING: line over 80 characters
#950: FILE: linux-user/xtensa/syscall_nr.h:189:
+#define TARGET_NR_reserved152                        152     /* set_thread_area */

WARNING: line over 80 characters
#951: FILE: linux-user/xtensa/syscall_nr.h:190:
+#define TARGET_NR_reserved153                        153     /* get_thread_area */

WARNING: line over 80 characters
#1669: FILE: linux-user/xtensa/termbits.h:292:
+#define TARGET_TCSBRKP     _IOW('T', 37, int)   /* Needed for POSIX tcsendbreak()*/

ERROR: line over 90 characters
#1679: FILE: linux-user/xtensa/termbits.h:302:
+#define TARGET_TIOCGPTN    _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */

ERROR: space required after that ',' (ctx:VxV)
#1679: FILE: linux-user/xtensa/termbits.h:302:
+#define TARGET_TIOCGPTN    _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
                                    ^

ERROR: space required after that ',' (ctx:VxV)
#1680: FILE: linux-user/xtensa/termbits.h:303:
+#define TARGET_TIOCSPTLCK  _IOW('T',0x31, int)  /* Lock/unlock Pty */
                                    ^

ERROR: line over 90 characters
#1681: FILE: linux-user/xtensa/termbits.h:304:
+#define TARGET_TIOCGDEV    _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */

ERROR: space required after that ',' (ctx:VxV)
#1681: FILE: linux-user/xtensa/termbits.h:304:
+#define TARGET_TIOCGDEV    _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
                                    ^

WARNING: line over 80 characters
#1682: FILE: linux-user/xtensa/termbits.h:305:
+#define TARGET_TIOCSIG     _IOW('T',0x36, int)  /* Generate signal on Pty slave */

ERROR: space required after that ',' (ctx:VxV)
#1682: FILE: linux-user/xtensa/termbits.h:305:
+#define TARGET_TIOCSIG     _IOW('T',0x36, int)  /* Generate signal on Pty slave */
                                    ^

WARNING: line over 80 characters
#1695: FILE: linux-user/xtensa/termbits.h:318:
+#define TARGET_TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* Get line status reg. */

WARNING: line over 80 characters
#1697: FILE: linux-user/xtensa/termbits.h:320:
+# define TARGET_TIOCSER_TEMT    0x01            /* Transmitter physically empty */

WARNING: line over 80 characters
#1703: FILE: linux-user/xtensa/termbits.h:326:
+#define TARGET_TIOCMIWAIT  _IO('T', 92) /* wait for a change on serial input line(s) */

WARNING: line over 80 characters
#1704: FILE: linux-user/xtensa/termbits.h:327:
+#define TARGET_TIOCGICOUNT 0x545D  /* read serial port inline interrupt counts */

total: 16 errors, 11 warnings, 2190 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 10/11: qemu-binfmt-conf.sh: add qemu-xtensa...
WARNING: line over 80 characters
#35: FILE: scripts/qemu-binfmt-conf.sh:103:
+xtensa_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e\x00'

ERROR: line over 90 characters
#36: FILE: scripts/qemu-binfmt-conf.sh:104:
+xtensa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'

WARNING: line over 80 characters
#39: FILE: scripts/qemu-binfmt-conf.sh:107:
+xtensaeb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x5e'

ERROR: line over 90 characters
#40: FILE: scripts/qemu-binfmt-conf.sh:108:
+xtensaeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'

total: 2 errors, 2 warnings, 26 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 11/11: MAINTAINERS: fix W: address for xtensa...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org