aboutsummaryrefslogtreecommitdiff
path: root/bsd-user
AgeCommit message (Collapse)Author
2021-06-11accel/tcg: Merge tcg_exec_init into tcg_init_machineRichard Henderson
There is only one caller, and shortly we will need access to the MachineState, which tcg_init_machine already has. Reviewed-by: Luis Pires <luis.pires@eldorado.org.br> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-06-11tcg: Re-order tcg_region_init vs tcg_prologue_initRichard Henderson
Instead of delaying tcg_region_init until after tcg_prologue_init is complete, do tcg_region_init first and let tcg_prologue_init shrink the first region by the size of the generated prologue. Reviewed-by: Luis Pires <luis.pires@eldorado.org.br> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-05-20Merge remote-tracking branch 'remotes/bsdimp/tags/pull-bsd-user-20210511' ↵Peter Maydell
into staging pull-bsd-user-20210511 is the next round of cleanups to bsd-user in merging the bsd-user fork into qemu. It contains a number of style commits, as well as 3 commits that start to change things: Some unused files are deleted, building the sparc and sparc64 targets are removed, and a structure is renamed. The next set of pull requests will start to execute the following plan: 1. Move existing code around to have a structure similar to the bsd-user fork. 2. Incrementally merge groups of system calls, focused on making x86 work. 3. Once the groups of system calls are all merged, additional platforms will be added back. 4. Concurrently, as changes are requested as part of the merge happen, those changes will be merged into the fork. An experimental merge to tip of master is under test and is what will be updated. 5. Eventually, there will be no diference, and the bsd-user fork will only be a staging area for cutting-edge features prior to upstreaming into qemu mainline. The bsd-user code in qemu has a lot of style issues. This cleans up a number in the files touched. However, the checkpatch.pl detects some incremental issues in the commits. The following are expected, but are corrected in later hashes in this branch. MAINTAINERS does not need to be updated, since all the files added or deleted are covered under existing regexp in MAINTAINERS. Checking all commits since f9a576a818044133f8564e0d243ebd97df0b3280... d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:101: ERROR: consider using qemu_strtol in preference to strtol d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:142: ERROR: braces {} are necessary for all arms of this statement d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:145: ERROR: braces {} are necessary for all arms of this statement total: 3 errors, 0 warnings, 119 lines checked b4bebeee1dee8d333bfa105a6c28fec5eb34b147:148: WARNING: line over 80 characters b4bebeee1dee8d333bfa105a6c28fec5eb34b147:330: ERROR: braces {} are necessary for all arms of this statement b4bebeee1dee8d333bfa105a6c28fec5eb34b147:340: ERROR: braces {} are necessary for all arms of this statement b4bebeee1dee8d333bfa105a6c28fec5eb34b147:381: ERROR: space prohibited between function name and open parenthesis '(' b4bebeee1dee8d333bfa105a6c28fec5eb34b147:390: ERROR: spaces required around that '<' (ctx:VxV) b4bebeee1dee8d333bfa105a6c28fec5eb34b147:408: WARNING: Block comments use a leading /* on a separate line b4bebeee1dee8d333bfa105a6c28fec5eb34b147:409: WARNING: Block comments use * on subsequent lines b4bebeee1dee8d333bfa105a6c28fec5eb34b147:409: WARNING: Block comments use a trailing */ on a separate line b4bebeee1dee8d333bfa105a6c28fec5eb34b147:441: WARNING: line over 80 characters b4bebeee1dee8d333bfa105a6c28fec5eb34b147:445: WARNING: line over 80 characters b4bebeee1dee8d333bfa105a6c28fec5eb34b147:502: ERROR: line over 90 characters b4bebeee1dee8d333bfa105a6c28fec5eb34b147:551: ERROR: space required after that ',' (ctx:VxV) b4bebeee1dee8d333bfa105a6c28fec5eb34b147:552: ERROR: space required after that ',' (ctx:VxV) b4bebeee1dee8d333bfa105a6c28fec5eb34b147:587: ERROR: space required after that ';' (ctx:VxV) b4bebeee1dee8d333bfa105a6c28fec5eb34b147:623: ERROR: suspect code indent for conditional statements (12, 14) total: 9 errors, 6 warnings, 664 lines checked 86545e7afe3f822b8561c7ceee7540fc3b19c3f0:31: ERROR: space required after that ';' (ctx:VxV) 86545e7afe3f822b8561c7ceee7540fc3b19c3f0:40: ERROR: space required after that ';' (ctx:VxV) total: 2 errors, 0 warnings, 60 lines checked Use of uninitialized value $acpi_testexpected in string eq at scripts/checkpatch.pl line 1529. 65d58c91ef1a15ad945ece367983437576f8e82b:22: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? total: 0 errors, 1 warnings, 14 lines checked Use of uninitialized value $acpi_testexpected in string eq at scripts/checkpatch.pl line 1529. f8ce39701b5be032fb3f9c05e8adb4055f70eec2:21: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? total: 0 errors, 1 warnings, 0 lines checked FAIL one or more commits failed scripts/checkpatch.pl Cleaning up file based variables ERROR: Job failed: exit code 1 # gpg: Signature made Wed 12 May 2021 17:40:34 BST # gpg: using RSA key 2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 # gpg: Good signature from "Warner Losh <wlosh@netflix.com>" [unknown] # gpg: aka "Warner Losh <imp@bsdimp.com>" [unknown] # gpg: aka "Warner Losh <imp@freebsd.org>" [unknown] # gpg: aka "Warner Losh <imp@village.org>" [unknown] # gpg: aka "Warner Losh <wlosh@bsdimp.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2035 F894 B00A A3CF 7CCD E1B7 6C1C D128 7DB0 1100 * remotes/bsdimp/tags/pull-bsd-user-20210511: bsd-user: rename linux_binprm to bsd_binprm bsd-user: Stop building the sparc targets bsd-user: remove target_signal.h, it's unused bsd-user: style tweak: keyword space ( bsd-user: style tweak: Remove #if 0'd code bsd-user: style tweak: keyword space ( bsd-user: style tweak: keyword space ( bsd-user: whitespace changes bsd-user: use qemu_strtoul in preference to strtol bsd-user: style tweak: use {} consistently in for / if / else statements bsd-user: style tweak: use {} for all if statements, format else correctly bsd-user: style tweak: don't assign in if statements bsd-user: style tweak: Use preferred block comments bsd-user: style tweak: remove spacing after '*' and add after } bsd-user: style tweak: move extern to header file bsd-user: Remove commented out code bsd-user: style tweak: Use preferred block comments bsd-user: style tweak: Remove #if 0'd code bsd-user: style tweak: use C not C++ comments bsd-user: whitespace changes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-11bsd-user: rename linux_binprm to bsd_binprmWarner Losh
Rename linux_binprm to bsd_binprm to reflect that we're loading BSD binaries, not ELF ones. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: remove target_signal.h, it's unusedWarner Losh
Remove the target_signal.h file. None of its contents are currently used and the bsd-user fork doesn't use them (so this reduces the diffs there). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: keyword space (Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: Remove #if 0'd codeWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: keyword space (Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: keyword space (Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: whitespace changesWarner 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 <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: use qemu_strtoul in preference to strtolWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: use {} consistently in for / if / else statementsWarner 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 <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: use {} for all if statements, format else correctlyWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: don't assign in if statementsWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: Use preferred block commentsWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: remove spacing after '*' and add after }Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: move extern to header fileWarner 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-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: Remove commented out codeWarner Losh
Remove dead code that's been commented out forever. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: Use preferred block commentsWarner Losh
Use the preferred block comment style. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: Remove #if 0'd codeWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: style tweak: use C not C++ commentsWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-11bsd-user: whitespace changesWarner Losh
Space after keywords, no space for function calls and spaces around operators. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-05-10accel: move call to accel_init_interfacesClaudio Fontana
move the call for sysemu specifically in machine_run_board_init, mirror the calling sequence for user mode too. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20210322132800.7470-23-cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-05Merge remote-tracking branch ↵Peter Maydell
'remotes/vivier2/tags/trivial-branch-for-6.1-pull-request' into staging Trivial patches pull request 20210503 # gpg: Signature made Mon 03 May 2021 09:34:56 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-for-6.1-pull-request: (23 commits) hw/rx/rx-gdbsim: Do not accept invalid memory size docs: More precisely describe memory-backend-*::id's user scripts: fix generation update-binfmts templates docs/system: Document the removal of "compat" property for POWER CPUs mc146818rtc: put it into the 'misc' category Do not include exec/address-spaces.h if it's not really necessary Do not include cpu.h if it's not really necessary Do not include hw/boards.h if it's not really necessary Do not include sysemu/sysemu.h if it's not really necessary hw: Do not include qemu/log.h if it is not necessary hw: Do not include hw/irq.h if it is not necessary hw: Do not include hw/sysbus.h if it is not necessary hw: Remove superfluous includes of hw/hw.h ui: Fix memory leak in qemu_xkeymap_mapping_table() hw/usb: Constify VMStateDescription hw/display/qxl: Constify VMStateDescription hw/arm: Constify VMStateDescription vmstate: Constify some VMStateDescriptions Fix typo in CFI build documentation hw/pcmcia: Do not register PCMCIA type if not required ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-05-02Do not include cpu.h if it's not really necessaryThomas Huth
Stop including cpu.h in files that don't need it. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <20210416171314.2074665-4-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2021-04-30bsd-user: style tweak: Put {} around all if/else/for statementsWarner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-04-30bsd-user: put back a break; that had gone missing...Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-04-30bsd-user: style tweak: return is not a function, eliminate ()Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-04-30bsd-user: style tweak: keyword space (Warner Losh
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-04-30bsd-user: whitespace changesWarner Losh
keyword space paren, no space before ( in function calls, spaces around operators. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Warner Losh <imp@bsdimp.com>
2021-02-16exec: Use cpu_untagged_addr in g2h; split out g2h_untaggedRichard Henderson
Use g2h_untagged in contexts that have no cpu, e.g. the binary loaders that operate before the primary cpu is created. As a colollary, target_mmap and friends must use untagged addresses, since they are used by the loaders. Use g2h_untagged on values returned from target_mmap, as the kernel never applies a tag itself. Use g2h_untagged on all pc values. The only current user of tags, aarch64, removes tags from code addresses upon branch, so "pc" is always untagged. Use g2h with the cpu context on hand wherever possible. Use g2h_untagged in lock_user, which will be updated soon. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-13-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-02-16bsd-user: Tidy VERIFY_READ/VERIFY_WRITERichard Henderson
These constants are only ever used with access_ok, and friends. Rather than translating them to PAGE_* bits, let them equal the PAGE_* bits to begin. Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210212184902.1251044-9-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-02-16exec: Use uintptr_t for guest_baseRichard Henderson
This is more descriptive than 'unsigned long'. No functional change, since these match on all linux+bsd hosts. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210212184902.1251044-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-02-05accel: replace struct CpusAccel with AccelOpsClassClaudio Fontana
This will allow us to centralize the registration of the cpus.c module accelerator operations (in accel/accel-softmmu.c), and trigger it automatically using object hierarchy lookup from the new accel_init_interfaces() initialization step, depending just on which accelerators are available in the code. Rename all tcg-cpus.c, kvm-cpus.c, etc to tcg-accel-ops.c, kvm-accel-ops.c, etc, matching the object type names. Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20210204163931.7358-18-cfontana@suse.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-02-05accel: extend AccelState and AccelClass to user-modeClaudio Fontana
Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> [claudio: rebased on Richard's splitwx work] Signed-off-by: Claudio Fontana <cfontana@suse.de> Message-Id: <20210204163931.7358-17-cfontana@suse.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-01-18gdbstub: drop CPUEnv from gdb_exit()Alex Bennée
gdb_exit() has never needed anything from env and I doubt we are going to start now. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210108224256.2321-8-alex.bennee@linaro.org>
2021-01-11bsd-user: Update strace.list for FreeBSD's latest syscallsWarner Losh
Update strace.list to include all of FreeBSD's syscalls up through svn r331280. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Sean Bruno <sburno@FreeBSD.org> Signed-off-by: Alexander Kabaev <kan@FreeBSD.org> Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Author: Michal Meloun <mmel@FreeBSD.org> Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com> [imp moved this change to early in the sequence] Signed-off-by: Warner Losh <imp@FreeBSD.org> Message-Id: <20201218205451.10559-5-imp@freebsd.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-01-11bsd-user: move strace OS/arch dependent code to host/arch dirsStacey 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 <sson@FreeBSD.org> Signed-off-by: Sean Bruno <sburno@FreeBSD.org> [ imp integrated minor build fixes from sbruno ] Signed-off-by: Warner Losh <imp@FreeBSD.org> Message-Id: <20201218205451.10559-4-imp@freebsd.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-01-11bsd-user: regenerate FreeBSD's system call numbersWarner 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 comprehensive system can be put in place. Signed-off-by: Warner Losh <imp@FreeBSD.org> Message-Id: <20201218205451.10559-2-imp@freebsd.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-01-07tcg: Add --accel tcg,split-wx propertyRichard Henderson
Plumb the value through to alloc_code_gen_buffer. This is not supported by any os or tcg backend, so for now enabling it will result in an error. Reviewed-by: Joelle van Dyne <j@getutm.app> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-12-18bsd-user: Silence warnings about missing fallthrough statementThomas Huth
When compiling with -Werror=implicit-fallthrough, the compiler complains about a missing fallthrough annotation in this file. Looking at the code, the fallthrough is indeed wanted here, so let's add a proper comment. Message-Id: <20201217154138.1547274-1-thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-11trace: remove argument from trace_init_filePaolo Bonzini
It is not needed, all the callers are just saving what was retrieved from -trace and trace_init_file can retrieve it on its own. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20201102115841.4017692-1-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-08-21meson: bsd-userMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-06-29linux-user/sparc64: Fix the handling of window spill trapGiuseppe Musacchio
Fix the handling of window spill traps by keeping cansave into account when calculating the new CWP. Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200625091204.3186186-3-laurent@vivier.eu>
2020-05-15exec/cpu-all: Use bool for have_guest_baseRichard Henderson
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200513175134.19619-6-alex.bennee@linaro.org>
2020-05-06gdbstub/linux-user: support debugging over a unix socketAlex Bennée
While debugging over TCP is fairly straightforward now we have test cases that want to orchestrate via make and currently a parallel build fails as two processes can't use the same listening port. While system emulation offers a wide cornucopia of connection methods thanks to the chardev abstraction we are a little more limited for linux user. Thankfully the programming API for a TCP socket and a local UNIX socket is pretty much the same once it's set up. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200430190122.4592-7-alex.bennee@linaro.org>
2020-03-16misc: Replace zero-length arrays with flexible array member (automatic)Philippe Mathieu-Daudé
Description copied from Linux kernel commit from Gustavo A. R. Silva (see [3]): --v-- description start --v-- The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member [1], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being unadvertenly introduced [2] to the Linux codebase from now on. --^-- description end --^-- Do the similar housekeeping in the QEMU codebase (which uses C99 since commit 7be41675f7cb). All these instances of code were found with the help of the following Coccinelle script: @@ identifier s, m, a; type t, T; @@ struct s { ... t m; - T a[0]; + T a[]; }; @@ identifier s, m, a; type t, T; @@ struct s { ... t m; - T a[0]; + T a[]; } QEMU_PACKED; [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76497732932f [3] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=17642a2fbd2c1 Inspired-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-02-12build: move TARGET_GPROF to config-host.makPaolo Bonzini
TARGET_GPROF is the same for all targets, write it to config-host.mak instead. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: <20200204161104.21077-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-01-15tcg: Search includes from the project root source directoryPhilippe Mathieu-Daudé
We currently search both the root and the tcg/ directories for tcg files: $ git grep '#include "tcg/' | wc -l 28 $ git grep '#include "tcg[^/]' | wc -l 94 To simplify the preprocessor search path, unify by expliciting the tcg/ directory. Patch created mechanically by running: $ for x in \ tcg.h tcg-mo.h tcg-op.h tcg-opc.h \ tcg-op-gvec.h tcg-gvec-desc.h; do \ sed -i "s,#include \"$x\",#include \"tcg/$x\"," \ $(git grep -l "#include \"$x\""); \ done Acked-by: David Gibson <david@gibson.dropbear.id.au> (ppc parts) Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200101112303.20724-2-philmd@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2019-12-19linux-user: log page table changes under -d pageAlex Bennée
The CPU_LOG_PAGE flag is woefully underused and could stand to do extra duty tracking page changes. If the user doesn't want to see the details as things change they still have the tracepoints available. We push the locking into log_page_dump and pass a reason for the banner text. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20191205122518.10010-5-alex.bennee@linaro.org>