[PULL 00/24] bsd-user style and reorg patches

2021-04-23 Thread imp
From: Warner Losh Greetings, 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 c

[PULL 03/24] bsd-user: whitespace changes

2021-04-23 Thread imp
From: Warner Losh Space after keywords, no space for function calls and spaces around operators. Signed-off-by: Warner Losh --- bsd-user/main.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index

[PULL 05/24] bsd-user: style tweak: keyword space (

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index d2bcaab741..b836b603af 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -233,7 +233,7 @@ static inline bool acces

[PULL 02/24] bsd-user: whitespace changes

2021-04-23 Thread imp
From: Warner Losh Fix various whitespace-only issues from checkpatch: keyword space ( no space before ( on function calls spaces around operators suspect indentations (including one functions reindented) extra spaces around unary operators Signed-off-by: Warner Losh --- bsd

[PULL 01/24] bsd-user: whitespace changes

2021-04-23 Thread imp
From: Warner Losh keyword space paren, no space before ( in function calls, spaces around operators. Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index

[PULL 11/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 87154283ef..07a00ddbd5 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1270,7 +1270,7 @@ int loa

[PULL 06/24] bsd-user: style tweak: keyword space (

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index adc3d21b54..3352735c68 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -95,7 +95,7

[PULL 09/24] bsd-user: style tweak: use C not C++ comments

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 455b8eddab..ff886de98e 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -148,7 +148,7 @@ void cpu_lo

[PULL 04/24] bsd-user: style tweak: keyword space (

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/mmap.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 01ec808003..0ac1b92706 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -93,11 +93,11 @@ int

[PULL 17/24] bsd-user: move extern to header file

2021-04-23 Thread imp
From: Warner Losh extern char **environ has no standard home, so move the declaration from the .c file to a handy .h file. Since this is a standard, old-school UNIX interface dating from the 5th edition, it's not quite the same issue that the rule is supposed to protect against, though. Signed-o

[PULL 14/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/x86_64/target_syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/x86_64/target_syscall.h b/bsd-user/x86_64/target_syscall.h index a8e6274b76..9a6e072f87 100644 --- a/bsd-user/x86_64/target_syscall.h ++

[PULL 10/24] bsd-user: style tweak: use C not C++ comments

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index b836b603af..3480db890d 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -71,7 +71,7 @@ struct image_info {

[PULL 07/24] bsd-user: style tweak: keyword space (

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/uaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c index 91e2067933..89163257f4 100644 --- a/bsd-user/uaccess.c +++ b/bsd-user/uaccess.c @@ -46,7 +46,7 @@ abi_long target

[PULL 16/24] bsd-user: Use preferred block comments

2021-04-23 Thread imp
From: Warner Losh Use the preferred block comment style. Signed-off-by: Warner Losh --- bsd-user/main.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 91603f5ac2..5958b07e62 100644 --- a/bsd-user/main.c

[PULL 24/24] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop

2021-04-23 Thread imp
From: Warner Losh Move the sparc cpu_loop out of main.c and into target_arch_cpu.h and rename it from cpu_loop to target_cpu_loop. Remove the #ifdef around the catch-all cpu_loop. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 305 -

[PULL 13/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/strace.c b/bsd-user/strace.c index 2c3b59caf0..6a78dd7efa 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -128,7 +128,7 @@ static void print_

[PULL 08/24] bsd-user: style tweak: use C not C++ comments

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 3c9d8c2845..87154283ef 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1010,7 +1010,7 @@ static

[PULL 15/24] bsd-user: Fix commentary issues

2021-04-23 Thread imp
From: Warner Losh Lines > 80 or 90 characters C++ comments BSD /*- block comment convention removed. Signed-off-by: Warner Losh --- bsd-user/bsd-mman.h | 42 ++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/bsd-user/bsd-mman.h b/bsd-use

[PULL 12/24] bsd-user: style tweak: if 0 -> ifdef notyet for code needed in future

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index ff886de98e..91603f5ac2 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -245,7 +245,7 @@ void cpu_loop(C

[PULL 19/24] bsd-user: use qemu_strtol in preference to strtol

2021-04-23 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 69e5525607..95fda8c5ae 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -821,7 +821,7 @@ int main(int argc, char

[PULL 18/24] bsd-user: style changes for {}

2021-04-23 Thread imp
From: Warner Losh Fix various issues with {} not being present on if / for / case statements. Tweak indentation where needed to appease checkpatch after this. Minor line length tweaks Signed-off-by: Warner Losh --- bsd-user/main.c | 100 +--- 1 file

[PULL 22/24] bsd-user: create target_arch_cpu.h

2021-04-23 Thread imp
From: Warner Losh Create target_arch_cpu.h to house the target_cpu_loop and target_cpu_init functions. These are the empty files that will be populated by moving the appropriate cpu-specific functions out of main.c. This work pre-dates the linux-user work that moved these to cpu-loop.c, so was do

[PULL 20/24] bsd-user: introduce host_os.h for bsd-specific code and defaults

2021-04-23 Thread imp
From: Warner Losh Introduce host_os.h for frebsd, netbsd and openbsd. This sets the default bsd being implemented today. In the future it will have code that is per-BSD specific. Abstracted from a larger c93465b6208c4c95cc0a394ffef4180ba6ccf27a in the qemu-bsd-user repo. Signed-off-by: Stacey So

[PULL 21/24] bsd-user: add arm target_signal.h

2021-04-23 Thread imp
From: Warner Losh Add a arm target_signal.h to complete the files currently in the tree. The arm directory isn't compiled, so it was missing target_signal.h. Update it to the same level as x86 and sparc. This was abstracted from the target_arch_vmparam.h file in the bsd-user branch. Signed-off-b

[PULL 23/24] bsd-user: move x86 (i386 and x86_64) cpu_loop to target_arch_cpu.h

2021-04-23 Thread imp
From: Warner Losh Move the x86 version of the cpu_loop to target_arch_cpu.h as target_cpu_loop. Create a cpu_loop that calls the target_cpu_loop function, but only for x86 for now. This is code-movement only commit. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target

[PATCH v2 01/48] bsd-user: whitespace changes

2021-04-24 Thread imp
From: Warner Losh keyword space paren, no space before ( in function calls, spaces around operators. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bsd-user

[PATCH v2 00/48] bsd-user style and reorg patches

2021-04-24 Thread imp
From: Warner Losh 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'

[PATCH v2 03/48] bsd-user: whitespace changes

2021-04-24 Thread imp
From: Warner Losh Space after keywords, no space for function calls and spaces around operators. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/main.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bsd-use

[PATCH v2 04/48] bsd-user: style tweak: keyword space (

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/mmap.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 01ec808003..0ac1b92706 100644 --- a/bsd-user/mmap.c +++ b/bsd-use

[PATCH v2 09/48] bsd-user: style tweak: use C not C++ comments

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 455b8eddab..ff886de98e 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c

[PATCH v2 12/48] bsd-user: style tweak: Remove #if 0'd code

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 143 1 file changed, 143 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index ff886de98e..3c6c0ec687 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -244,118 +

[PATCH v2 02/48] bsd-user: whitespace changes

2021-04-24 Thread imp
From: Warner Losh Fix various whitespace-only issues from checkpatch: keyword space ( no space before ( on function calls spaces around operators suspect indentations (including one functions reindented) extra spaces around unary operators Reviewed-by: Richard Henderson Sign

[PATCH v2 06/48] bsd-user: style tweak: keyword space (

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/syscall.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index adc3d21b54..3352735c68 100644 --- a/bsd-user/syscall.c +++ b/b

[PATCH v2 15/48] bsd-user: style tweak: return is not a function, eliminate ()

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 546946b91d..fd14ffa4cd 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -28,7 +28,7 @@ s

[PATCH v2 30/48] bsd-user: style tweak: fix block comments

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/mmap.c | 51 - 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 0ac1b92706..0ff06d7349 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mma

[PATCH v2 05/48] bsd-user: style tweak: keyword space (

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/qemu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index d2bcaab741..b836b603af 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -233,7 +2

[PATCH v2 08/48] bsd-user: style tweak: use C not C++ comments

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 3c9d8c2845..87154283ef 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload

[PATCH v2 18/48] bsd-user: style tweak: Use preferred block comments

2021-04-24 Thread imp
From: Warner Losh Use the preferred block comment style. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/main.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 3c6c0ec687..60a62e0

[PATCH v2 40/48] bsd-user: style tweak: Use preferred block comments

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/strace.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-user/strace.c b/bsd-user/strace.c index e4153fd0a1..aa4ab8cee7 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -159,8 +159,10 @@ static void

[PATCH v2 07/48] bsd-user: style tweak: keyword space (

2021-04-24 Thread imp
From: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/uaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c index 91e2067933..89163257f4 100644 --- a/bsd-user/uaccess.c +++ b/bsd-user/uaccess.c @

[PATCH v2 10/48] bsd-user: Remove commented out code

2021-04-24 Thread imp
From: Warner Losh Remove dead code that's been commented out forever. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 4 1 file changed, 4 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index b836b603af..7ccc8ad397 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -71,7

[PATCH v2 20/48] bsd-user: style tweak: use {} consistently in for / if / else statements

2021-04-24 Thread imp
From: Warner Losh Fix various issues with {} not being present on if / for statements. Minor line length tweaks Move an assignment in an if out. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/main.c | 66 - 1 file changed

[PATCH v2 47/48] bsd-user: style tweak: don't assign in if statement.

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 40 +++- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 1f6b93923c..1851311acd 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/

[PATCH v2 13/48] bsd-user: style tweak: Remove #if 0'd code

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/strace.c | 8 1 file changed, 8 deletions(-) diff --git a/bsd-user/strace.c b/bsd-user/strace.c index 2c3b59caf0..be40b8a20c 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -128,14 +128,6 @@ static void print_syscall_

[PATCH v2 17/48] bsd-user: style tweak: Fix commentary issues

2021-04-24 Thread imp
From: Warner Losh Lines > 80 or 90 characters C++ comments BSD /*- block comment convention removed. Reviewed-by: Richard Henderson Signed-off-by: Warner Losh --- bsd-user/bsd-mman.h | 42 ++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git

[PATCH v2 27/48] bsd-user: style tweak: space pedantry

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 243a5a5048..f455a3812a 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -756,

[PATCH v2 11/48] bsd-user: style tweak: Remove #if 0'd code

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 12 1 file changed, 12 deletions(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 87154283ef..2c6764d372 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1270,9 +1270,6 @@ int load_elf_b

[PATCH v2 21/48] bsd-user: style nits: return is not a function

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/elfload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c index 2c6764d372..243a5a5048 100644 --- a/bsd-user/elfload.c +++ b/bsd-user/elfload.c @@ -1544,7 +1544,7 @@ int load_el

[PATCH v2 28/48] bsd-user: style tweak: comments

2021-04-24 Thread imp
From: Warner Losh Use the preferred block comment style, move comments as needed for line length restrictions, delete some dead code that looked like a comment, break some lines > 80 columns at the same time since there are many associated with comments. Signed-off-by: Warner Losh --- bsd-user

[PATCH v2 14/48] bsd-user: style tweak: Remove #if 0'd code

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/x86_64/target_syscall.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/bsd-user/x86_64/target_syscall.h b/bsd-user/x86_64/target_syscall.h index a8e6274b76..ec99354e15 100644 --- a/bsd-user/x86_64/target_syscall.h ++

[PATCH v2 24/48] bsd-user: create target_arch_cpu.h

2021-04-24 Thread imp
From: Warner Losh Create target_arch_cpu.h to house the target_cpu_loop and target_cpu_init functions. These are the empty files that will be populated by moving the appropriate cpu-specific functions out of main.c. This work pre-dates the linux-user work that moved these to cpu-loop.c, so was do

[PATCH v2 33/48] bsd-user: style tweak: Use preferred block comments

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 74 - 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index de20e8329a..7f3cfa68aa 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qem

[PATCH v2 16/48] bsd-user: style tweak: Put {} around all if/else/for statements

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/bsdload.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index fd14ffa4cd..e1ed3b7b60 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload.c @@ -13,8 +13,9 @@ ab

[PATCH v2 26/48] bsd-user: move sparc cpu_loop into target_arch_cpu.h as target_cpu_loop

2021-04-24 Thread imp
From: Warner Losh Move the sparc cpu_loop out of main.c and into target_arch_cpu.h and rename it from cpu_loop to target_cpu_loop. Remove the #ifdef around the catch-all cpu_loop. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/main.c | 270 -

[PATCH v2 36/48] bsd-user: style tweak: Use preferred block comments

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/uaccess.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c index 89163257f4..7eb4546fed 100644 --- a/bsd-user/uaccess.c +++ b/bsd-user/uaccess.c @@ -4,9 +4,10 @@

[PATCH v2 23/48] bsd-user: introduce host_os.h for bsd-specific code and defaults

2021-04-24 Thread imp
From: Warner Losh Introduce host_os.h for frebsd, netbsd and openbsd. This sets the default bsd being implemented today. In the future it will have code that is per-BSD specific. Abstracted from a larger c93465b6208c4c95cc0a394ffef4180ba6ccf27a in the qemu-bsd-user repo. Reviewed-by: Richard Hen

[PATCH v2 31/48] bsd-user: style tweak: use {} for all if statements, format else correctly

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/mmap.c | 112 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 0ff06d7349..1aec1916c0 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mma

[PATCH v2 35/48] bsd-user: style tweak: use {} for all if statements, format else correctly

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 2494d9209d..8d3767964d 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -358,16 +358,18 @@ abi_

[PATCH v2 22/48] bsd-user: use qemu_strtoul in preference to strtol

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/main.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 8f5cb7162d..a98a45df21 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -37,6 +37,7 @@ #include "tcg/tc

[PATCH v2 32/48] bsd-user: style tweak: remove spacing after '*' and add after }

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 5a82722281..de20e8329a 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -124,19 +124,19 @@ struct

[PATCH v2 37/48] bsd-user: style tweak: don't assign in if statements

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/uaccess.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c index 7eb4546fed..aab5e995a9 100644 --- a/bsd-user/uaccess.c +++ b/bsd-user/uaccess.c @@ -14,7 +14,8 @@ abi_long

[PATCH v2 19/48] bsd-user: style tweak: move extern to header file

2021-04-24 Thread imp
From: Warner Losh extern char **environ has no standard home, so move the declaration from the .c file to a handy .h file. Since this is a standard, old-school UNIX interface dating from the 5th edition, it's not quite the same issue that the rule is supposed to protect against, though. Reviewed

[PATCH v2 29/48] bsd-user: style tweak: use {} correctly

2021-04-24 Thread imp
From: Warner Losh Format if/for/while statements with {} always, on a separate line and fix a couple indentations issues for singletons. Signed-off-by: Warner Losh --- bsd-user/elfload.c | 147 - 1 file changed, 92 insertions(+), 55 deletions(-) dif

[PATCH v2 39/48] bsd-user: style tweak: spaces around =, remove stray space

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/strace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/strace.c b/bsd-user/strace.c index be40b8a20c..e4153fd0a1 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -147,11 +147,11 @@ static void

[PATCH v2 25/48] bsd-user: move x86 (i386 and x86_64) cpu_loop to target_arch_cpu.h

2021-04-24 Thread imp
From: Warner Losh Move the x86 version of the cpu_loop to target_arch_cpu.h as target_cpu_loop. Create a cpu_loop that calls the target_cpu_loop function, but only for x86 for now. This is code-movement only commit. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/i386/target

[PATCH v2 38/48] bsd-user: style tweak: use {} for all if statements, format else correctly

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/uaccess.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c index aab5e995a9..2e8ad2982f 100644 --- a/bsd-user/uaccess.c +++ b/bsd-user/uaccess.c @@ -54,8 +54,9 @@ abi_long

[PATCH v2 43/48] bsd-user: style tweak: fold long lines

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 5e033e8bf4..46c0e29841 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/

[PATCH v2 34/48] bsd-user: style tweak: don't assign in if statements

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/qemu.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 7f3cfa68aa..2494d9209d 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -288,7 +288,8 @@ static inline bool acc

[PATCH v2 41/48] bsd-user: style tweak: don't assign in if statements

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/strace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/strace.c b/bsd-user/strace.c index aa4ab8cee7..94f2b59565 100644 --- a/bsd-user/strace.c +++ b/bsd-user/strace.c @@ -80,7 +80,8 @@ static void print_

[PATCH v2 44/48] bsd-user: style tweak: use preferred block comments

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 46c0e29841..fbe3b3b2fe 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -140,8

[PATCH v2 46/48] bsd-user: style tweak: Return is not a function call.

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 36ffa6a880..1f6b93923c 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -187,7 +187,7 @@ oidfmt(int *o

[PATCH v2 42/48] bsd-user: style tweak: spaces around operators and commas

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 3352735c68..5e033e8bf4 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -77,8

[PATCH v2 48/48] bsd-user: put back a break; that had gone missing...

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 1851311acd..d5c3168a6d 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -209,6 +209,7 @@ static int sysctl_oldcvt(void

[PATCH v2 45/48] bsd-user: style tweak: Use preferred {} in if/else statements.

2021-04-24 Thread imp
From: Warner Losh Signed-off-by: Warner Losh --- bsd-user/syscall.c | 120 + 1 file changed, 78 insertions(+), 42 deletions(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index fbe3b3b2fe..36ffa6a880 100644 --- a/bsd-user/syscall.c +++ b/bsd

[PATCH 3/4] bsd-user: move strace OS/arch dependent code to host/arch dirs

2020-12-18 Thread imp
From: Stacey Son This change moves host OS and arch dependent code for the sysarch system call related to the -strace functionality into the appropriate host OS and target arch directories. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno [ imp integrated minor build fixes from sbruno

[PATCH 1/4] bsd-user: regenerate FreeBSD's system call numbers

2020-12-18 Thread imp
From: Warner Losh Recreate the FreeBSD system call numbers from current sys/syscall.h. Since this isn't guaranteed to be on all systems, continue the practice of generating it with some variation on: sed -e s/SYS_/TARGET_NR_/ < $FREEBSD_SRC/sys/syscall.h > syscall_nr.h until a more compre

[PATCH 0/4] A few preliminary bsd-user patches

2020-12-18 Thread imp
From: Warner Losh Here's the first round of bsd-user patches. There's on the order of 280 that we've done, but that's too much to review all at once. In addition, 3.1 release was the last rebase point that we've been successful with for a number of reasons unrelated to qemu. Now that those have

[PATCH 4/4] bsd-user: Update strace.list for FreeBSD's latest syscalls

2020-12-18 Thread imp
From: Warner Losh Update strace.list to include all of FreeBSD's syscalls up through svn r331280. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno Signed-off-by: Alexander Kabaev Signed-off-by: Jung-uk Kim Author: Michal Meloun Signed-off-by: Mikaël Urankar [imp moved this chan

[PATCH 2/4] tcg: Additional Trap type for FreeBSD

2020-12-18 Thread imp
From: Sean Bruno FreeBSD can generate a trap 0xc as well as 0xe when writing to a read-only page. Signed-off-by: Juergen Lock [imp rewored commit message for clarity] Signed-off-by: Warner Losh --- accel/tcg/user-exec.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[PATCH 0/4] A few preliminary bsd-user patches

2020-12-19 Thread imp
From: Warner Losh Here's the first round of bsd-user patches. There's on the order of 280 that we've done, but that's too much to review all at once. In addition, 3.1 release was the last rebase point that we've been successful with for a number of reasons unrelated to qemu. Now that those have

[PATCH 2/4] tcg: Additional Trap type for FreeBSD

2020-12-19 Thread imp
From: Sean Bruno FreeBSD can generate a trap 0xc as well as 0xe when writing to a read-only page. Signed-off-by: Juergen Lock [imp rewored commit message for clarity] Signed-off-by: Warner Losh --- accel/tcg/user-exec.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[PATCH 1/4] bsd-user: regenerate FreeBSD's system call numbers

2020-12-19 Thread imp
From: Warner Losh Recreate the FreeBSD system call numbers from current sys/syscall.h. Since this isn't guaranteed to be on all systems, continue the practice of generating it with some variation on: sed -e s/SYS_/TARGET_NR_/ < $FREEBSD_SRC/sys/syscall.h > syscall_nr.h until a more compre

[PATCH 4/4] bsd-user: Update strace.list for FreeBSD's latest syscalls

2020-12-19 Thread imp
From: Warner Losh Update strace.list to include all of FreeBSD's syscalls up through svn r331280. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno Signed-off-by: Alexander Kabaev Signed-off-by: Jung-uk Kim Author: Michal Meloun Signed-off-by: Mikaël Urankar [imp moved this chan

[PATCH 3/4] bsd-user: move strace OS/arch dependent code to host/arch dirs

2020-12-19 Thread imp
From: Stacey Son This change moves host OS and arch dependent code for the sysarch system call related to the -strace functionality into the appropriate host OS and target arch directories. Signed-off-by: Stacey Son Signed-off-by: Sean Bruno [ imp integrated minor build fixes from sbruno

[PATCH v2 02/43] bsd-user: add copyright header to elfload.c

2021-08-26 Thread imp
From: Warner Losh Add Stacey's copyright to elfload.c Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c ind

[PATCH v2 03/43] bsd-user: Add Stacey's copyright to main.c

2021-08-26 Thread imp
From: Warner Losh Add Stacey's updated copyright to main.c Signed-off-by: Warner Losh Signed-off-by: Stacey Son Reviewed-by: Richard Henderson --- bsd-user/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 38185da111..39c4a0f

[PATCH v2 05/43] bsd-user: style nits: bsdload.c whitespace to qemu standard

2021-08-26 Thread imp
From: Warner Losh Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c index 0ade58b9e2..ec71c5e923 100644 --- a/bsd-user/bsdload.c +++ b/bsd-user/bsdload

[PATCH v2 01/43] bsd-user: remove sparc and sparc64

2021-08-26 Thread imp
From: Warner Losh These are broken here and in the bsd-user fork. They won't be fixed as FreeBSD has dropped support for sparc. If people wish to support this in other BSDs, you're better off starting over than starting from these files. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson

[PATCH v2 16/43] bsd-user: add host-os.h

2021-08-26 Thread imp
From: Warner Losh Host OS specific bits for this implementation go in this file. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/host-os.h | 23 +++ bsd-user/netbsd/host-os.h | 23 +++ bsd-user/

[PATCH v2 04/43] bsd-user: add license to bsdload.c

2021-08-26 Thread imp
From: Warner Losh Pull in the license statement at the top of the bsdload.c file from the bsd-user fork version of this file. No functional changes. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 17 - 1 file changed, 16 insertions(+), 1 del

[PATCH v2 06/43] bsd-user: Remove all non-x86 code from elfload.c

2021-08-26 Thread imp
From: Warner Losh bsd-user only builds x86 at the moment. Remove all non x86 code from elfload.c. We'll move the x86 code to {i386,x86_64}/target_arch_elf.h and bring it that support code from the forked bsd-user when the time comes. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --

[PATCH v2 00/43] bsd-user updates to run hello world

2021-08-26 Thread imp
From: Warner Losh This series of patches gets me to the point that I can run "Hello World" on i386 and x86_64. This is for static binaries only, that are relatively small, but it's better than the 100% instant mmap failre that is the current state of all things bsd-user in upstream qemu. Future p

[PATCH v2 25/43] bsd-user: Add architecture specific signal tramp code

2021-08-26 Thread imp
From: Warner Losh Add a stubbed out version of setup_sigtramp. This is not yet used for x86, but is used for other architectures. This will be connected in future commits. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch_sigtra

[PATCH v2 07/43] bsd-user: move arch specific defines out of elfload.c

2021-08-26 Thread imp
From: Warner Losh Move the arcitecture specific defines to target_arch_elf.h and delete them from elfload.c. unifdef as appropriate for i386 vs x86_64 versions. Add the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/elfload

[PATCH v2 19/43] bsd-user: start to move target CPU functions to target_arch*

2021-08-26 Thread imp
From: Warner Losh Move the CPU functons into target_arch_cpu.c that are unique to each CPU. These are defined in target_arch.h. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/i386/target_arch.h | 31 + bsd-user/i386/target_a

[PATCH v2 08/43] bsd-user: pass the bsd_param into loader_exec

2021-08-26 Thread imp
From: Warner Losh Pass the bsd_param into loader_exec, and adjust. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/bsdload.c | 37 +++-- bsd-user/main.c| 7 ++- bsd-user/qemu.h| 3 ++- 3 files changed, 27 insertions(+), 20 d

[PATCH v2 35/43] bsd-user: Add target_os_user.h to capture the user/kernel structures

2021-08-26 Thread imp
From: Warner Losh This file evolved over the years to capture the user/kernel interfaces, including those that changed over time. Signed-off-by: Stacey Son Signed-off-by: Michal Meloun Signed-off-by: Warner Losh Acked-by: Richard Henderson --- bsd-user/freebsd/target_os_user.h | 429 +++

[PATCH v2 09/43] bsd-user: Fix calculation of size to allocate

2021-08-26 Thread imp
From: Warner Losh It was incorrect to subtract off the size of an unsigned int here. In bsd-user fork, this change was made when moving the arch specific items to specific files. The size in BSD that's available for the arguments does not need a return address subtracted from it. Signed-off-by

[PATCH v2 11/43] bsd-user: Eliminate elf personality

2021-08-26 Thread imp
From: Warner Losh The linux kernel supports a number of different ELF binaries. The Linux userland emulator inheritted some of that. And we inheritted it from there. However, for BSD there's only one kind of ELF file supported per platform, so there's no need to cope with historical quirks. Simpl

[PATCH v2 27/43] bsd-user: Move stack initializtion into a per-os file.

2021-08-26 Thread imp
From: Warner Losh Move all of the stack initialization into target_os_stack.h. Each BSD sets up processes a little differently. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/target_os_stack.h | 180 + bsd-

  1   2   3   >