qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/48] bsd-user style and reorg patches
@ 2021-04-24 15:59 imp
  2021-04-24 15:59 ` [PATCH v2 01/48] bsd-user: whitespace changes imp
                   ` (48 more replies)
  0 siblings, 49 replies; 84+ messages in thread
From: imp @ 2021-04-24 15:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: kevans, arichardson, Warner Losh

From: Warner Losh <imp@bsdimp.com>

Version 2:

In version 2 I've fixed all the checkpatch.pl issues for all the files that I
touched. Since files are changed incrementally, some of the individual changes
may not pass checkpatch.pl due to pre-existing problems, but the cumulative
diff passes with just warnings. I've folded the 'if 0 should just be lost'
advice in the relevant hunks, as well as in a few places where things were
commented out.

I've included all the reviews I've got so far, but since this is my first time
with such a complex review here please let me know if I've missed following all
the conventions somehow.

I had to tweak patches 025 and 026, which had been previously reviewed (adding
static in 2 places to fix a warning). So I removed the Reviewed By: line from
it. I hope that's the proper protocol here, but if not I'm keen on suggestions.

Version 1:

This series starts to cleanup bsd-user. The current checkpatch.pl output is on
the order of 4500 lines long. These cleanups don't fix everything (there's still
plenty of errors, even in some of the files the patches touch). I've tried to
make things better in every case, but be advised that checkpatch.pl is unhappy
with many of the files still in the first 15 commits. I do plan on addressing
the issues in the future as I need to make real commits to those files. The
changes were ones that were trivial to do with scripts that I had to do for
main.c anyway. main.c is now completely clean. All the cleanup I've done
myself, and at the end of this patch trail the output is only 3500 lines...

Next, I've started to reorg the bsd-user sources. There's really 4 BSDs in the
wild (FreeBSD, NetBSD, OpenBSD and Dragonfly) that these could, in theory,
target. In the bsd-user branch, we've broken the emulation of these apart. It
largely preserves the other BSD's as is, and greatly expands FreeBSD so that we
can do package builds in user-land emulation. The other BSDs have not been
run-time tested, though the CI tooling builds some of them. It's my belief that
in the current state, even an old-school cat(1) would fail, though I am to fix
that at least for FreeBSD...

We've also added a number of other architectures than sparc and i386. Those
additions, though, are dependent on other things not yet reshuffled and or
merged, so they will be coming along in due time: mips (32 and 64 bit), arm,
aarch64 and riscv willl come in due time. powerpc might, but it's in a frightful
state. I'm open to other BSDs that wish to work along with me as well, though it
may be best to wait until after future patch sets as much is still set to
change. CHERI and related work may also happen, but that's still TBD.

In this installement, after the style stuff, I've created a
target_arch_cpu.h. Here, all the functions related to the cpu loop and similar
things are moved into there on a per-architecture basis to start to tame the
number of #ifdefs in mail. Linux-user did a similar thing years after we had
done it in the repo, and a number of different choices were made. Rather than
redo all the work from the bsd-user repo, I'm recreating / rebasing it on a
current qemu. Future patch series will address other aspects. Once they are
complete, we can look, potentially, at any refactoring between linux-user and
bsd-user. I very much explicitly want to push that to the end because otherwise
I'm completely recreating a lot of the work on the bsd-user branch rather than
just transitioning it forward to a newer qemu. This reorg was started by Stacey
Son and I've redone it with the latest code. I've added his signoff (with his
blanket permission) to those commits. Also, all of these commits pass
checkpatch.pl

Please let me know what you think, and how I might structure future patches if
there's ways I can do them better. I've switched to pull-requests with this series
since it will be easier to keep track of, especially in the future.

Warner

P.S. This has no relevance to 6.0 at all: we're too late and this feature
isn't fully integrated by this patch trail.



Warner Losh (48):
  bsd-user: whitespace changes
  bsd-user: whitespace changes
  bsd-user: whitespace changes
  bsd-user: style tweak: keyword space (
  bsd-user: style tweak: keyword space (
  bsd-user: style tweak: keyword space (
  bsd-user: style tweak: keyword space (
  bsd-user: style tweak: use C not C++ comments
  bsd-user: style tweak: use C not C++ comments
  bsd-user: Remove commented out code
  bsd-user: style tweak: Remove #if 0'd code
  bsd-user: style tweak: Remove #if 0'd code
  bsd-user: style tweak: Remove #if 0'd code
  bsd-user: style tweak: Remove #if 0'd code
  bsd-user: style tweak: return is not a function, eliminate ()
  bsd-user: style tweak: Put {} around all if/else/for statements
  bsd-user: style tweak: Fix commentary issues
  bsd-user: style tweak: Use preferred block comments
  bsd-user: style tweak: move extern to header file
  bsd-user: style tweak: use {} consistently in for / if / else
    statements
  bsd-user: style nits: return is not a function
  bsd-user: use qemu_strtoul in preference to strtol
  bsd-user: introduce host_os.h for bsd-specific code and defaults
  bsd-user: create target_arch_cpu.h
  bsd-user: move x86 (i386 and x86_64) cpu_loop to target_arch_cpu.h
  bsd-user: move sparc cpu_loop into target_arch_cpu.h as
    target_cpu_loop
  bsd-user: style tweak: space pedantry
  bsd-user: style tweak: comments
  bsd-user: style tweak: use {} correctly
  bsd-user: style tweak: fix block comments
  bsd-user: style tweak: use {} for all if statements, format else
    correctly
  bsd-user: style tweak: remove spacing after '*' and add after }
  bsd-user: style tweak: Use preferred block comments
  bsd-user: style tweak: don't assign in if statements
  bsd-user: style tweak: use {} for all if statements, format else
    correctly
  bsd-user: style tweak: Use preferred block comments
  bsd-user: style tweak: don't assign in if statements
  bsd-user: style tweak: use {} for all if statements, format else
    correctly
  bsd-user: style tweak: spaces around =, remove stray space
  bsd-user: style tweak: Use preferred block comments
  bsd-user: style tweak: don't assign in if statements
  bsd-user: style tweak: spaces around operators and commas
  bsd-user: style tweak: fold long lines
  bsd-user: style tweak: use preferred block comments
  bsd-user: style tweak: Use preferred {} in if/else statements.
  bsd-user: style tweak: Return is not a function call.
  bsd-user: style tweak: don't assign in if statement.
  bsd-user: put back a break; that had gone missing...

 bsd-user/arm/target_arch_cpu.h     |  22 +
 bsd-user/bsd-mman.h                |  42 +-
 bsd-user/bsdload.c                 |  55 +--
 bsd-user/elfload.c                 | 677 ++++++++++++++++-------------
 bsd-user/freebsd/host_os.h         |  25 ++
 bsd-user/i386/target_arch_cpu.h    | 197 +++++++++
 bsd-user/main.c                    | 657 +++-------------------------
 bsd-user/mmap.c                    | 185 +++++---
 bsd-user/netbsd/host_os.h          |  25 ++
 bsd-user/openbsd/host_os.h         |  25 ++
 bsd-user/qemu.h                    | 128 +++---
 bsd-user/sparc/target_arch_cpu.h   | 287 ++++++++++++
 bsd-user/sparc64/target_arch_cpu.h |  19 +
 bsd-user/strace.c                  |  21 +-
 bsd-user/syscall.c                 | 222 ++++++----
 bsd-user/uaccess.c                 |  27 +-
 bsd-user/x86_64/target_arch_cpu.h  |  19 +
 bsd-user/x86_64/target_syscall.h   |  15 -
 18 files changed, 1449 insertions(+), 1199 deletions(-)
 create mode 100644 bsd-user/arm/target_arch_cpu.h
 create mode 100644 bsd-user/freebsd/host_os.h
 create mode 100644 bsd-user/i386/target_arch_cpu.h
 create mode 100644 bsd-user/netbsd/host_os.h
 create mode 100644 bsd-user/openbsd/host_os.h
 create mode 100644 bsd-user/sparc/target_arch_cpu.h
 create mode 100644 bsd-user/sparc64/target_arch_cpu.h
 create mode 100644 bsd-user/x86_64/target_arch_cpu.h

-- 
2.22.1



^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2021-04-24 18:32 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24 15:59 [PATCH v2 00/48] bsd-user style and reorg patches imp
2021-04-24 15:59 ` [PATCH v2 01/48] bsd-user: whitespace changes imp
2021-04-24 15:59 ` [PATCH v2 02/48] " imp
2021-04-24 15:59 ` [PATCH v2 03/48] " imp
2021-04-24 15:59 ` [PATCH v2 04/48] bsd-user: style tweak: keyword space ( imp
2021-04-24 15:59 ` [PATCH v2 05/48] " imp
2021-04-24 15:59 ` [PATCH v2 06/48] " imp
2021-04-24 15:59 ` [PATCH v2 07/48] " imp
2021-04-24 15:59 ` [PATCH v2 08/48] bsd-user: style tweak: use C not C++ comments imp
2021-04-24 15:59 ` [PATCH v2 09/48] " imp
2021-04-24 15:59 ` [PATCH v2 10/48] bsd-user: Remove commented out code imp
2021-04-24 17:19   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 11/48] bsd-user: style tweak: Remove #if 0'd code imp
2021-04-24 17:21   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 12/48] " imp
2021-04-24 17:23   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 13/48] " imp
2021-04-24 17:23   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 14/48] " imp
2021-04-24 17:24   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 15/48] bsd-user: style tweak: return is not a function, eliminate () imp
2021-04-24 17:24   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for statements imp
2021-04-24 17:25   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 17/48] bsd-user: style tweak: Fix commentary issues imp
2021-04-24 15:59 ` [PATCH v2 18/48] bsd-user: style tweak: Use preferred block comments imp
2021-04-24 15:59 ` [PATCH v2 19/48] bsd-user: style tweak: move extern to header file imp
2021-04-24 15:59 ` [PATCH v2 20/48] bsd-user: style tweak: use {} consistently in for / if / else statements imp
2021-04-24 15:59 ` [PATCH v2 21/48] bsd-user: style nits: return is not a function imp
2021-04-24 17:27   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 22/48] bsd-user: use qemu_strtoul in preference to strtol imp
2021-04-24 17:34   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 23/48] bsd-user: introduce host_os.h for bsd-specific code and defaults imp
2021-04-24 15:59 ` [PATCH v2 24/48] bsd-user: create target_arch_cpu.h imp
2021-04-24 15:59 ` [PATCH v2 25/48] bsd-user: move x86 (i386 and x86_64) cpu_loop to target_arch_cpu.h imp
2021-04-24 17:43   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 26/48] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop imp
2021-04-24 17:45   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 27/48] bsd-user: style tweak: space pedantry imp
2021-04-24 17:46   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 28/48] bsd-user: style tweak: comments imp
2021-04-24 17:51   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 29/48] bsd-user: style tweak: use {} correctly imp
2021-04-24 17:55   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 30/48] bsd-user: style tweak: fix block comments imp
2021-04-24 17:59   ` Richard Henderson
2021-04-24 15:59 ` [PATCH v2 31/48] bsd-user: style tweak: use {} for all if statements, format else correctly imp
2021-04-24 18:01   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 32/48] bsd-user: style tweak: remove spacing after '*' and add after } imp
2021-04-24 18:03   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 33/48] bsd-user: style tweak: Use preferred block comments imp
2021-04-24 18:07   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 34/48] bsd-user: style tweak: don't assign in if statements imp
2021-04-24 18:09   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 35/48] bsd-user: style tweak: use {} for all if statements, format else correctly imp
2021-04-24 18:12   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 36/48] bsd-user: style tweak: Use preferred block comments imp
2021-04-24 18:13   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements imp
2021-04-24 18:14   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, format else correctly imp
2021-04-24 18:15   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 39/48] bsd-user: style tweak: spaces around =, remove stray space imp
2021-04-24 18:16   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 40/48] bsd-user: style tweak: Use preferred block comments imp
2021-04-24 18:16   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements imp
2021-04-24 18:17   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 42/48] bsd-user: style tweak: spaces around operators and commas imp
2021-04-24 18:18   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 43/48] bsd-user: style tweak: fold long lines imp
2021-04-24 18:18   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 44/48] bsd-user: style tweak: use preferred block comments imp
2021-04-24 18:19   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 45/48] bsd-user: style tweak: Use preferred {} in if/else statements imp
2021-04-24 18:21   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 46/48] bsd-user: style tweak: Return is not a function call imp
2021-04-24 18:21   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 47/48] bsd-user: style tweak: don't assign in if statement imp
2021-04-24 18:21   ` Richard Henderson
2021-04-24 16:00 ` [PATCH v2 48/48] bsd-user: put back a break; that had gone missing imp
2021-04-24 18:22   ` Richard Henderson
2021-04-24 16:55 ` [PATCH v2 00/48] bsd-user style and reorg patches no-reply
2021-04-24 17:00   ` Warner Losh

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 NNTP newsgroup(s).