summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bsd-user: add host-os.hWarner Losh2021-09-103-0/+69
| | | | | | | | Host OS specific bits for this implementation go in this file. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: assume pthreads and support of __threadWarner Losh2021-09-102-10/+2Star
| | | | | | | | | | | All compilers for some time have supported this. Follow linux-user and eliminate the #define THREAD and unconditionally insert __thread where needed. Please insert: "(see 24cb36a61c6: "configure: Make NPTL non-optional")" Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* bsd-user: elfload: simplify bswap a bit.Warner Losh2021-09-101-50/+47Star
| | | | | | | | Reduce the number of ifdefs by always calling the swapping routine, but making them empty when swapping isn't needed. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: TARGET_NGROUPS unused in this file, removeWarner Losh2021-09-101-2/+0Star
| | | | | Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: remove a.out supportWarner Losh2021-09-103-95/+21Star
| | | | | | | | | | | | Remove still-born a.out support. The BSDs switched from a.out to ELF 20+ years ago. It's out of scope for bsd-user, and what little support there was would simply wind up at a not-implemented message. Simplify the whole mess by removing it entirely. Should future support be required, it would be better to start from scratch. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* bsd-user: Eliminate elf personalityWarner Losh2021-09-102-88/+0Star
| | | | | | | | | | 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. Simply the code as a result. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: implement path searchingWarner Losh2021-09-102-2/+37
| | | | | | | | | | | Use the PATH to find the executable given a bare argument. We need to do this so we can implement mixing native and emulated binaries (e.g., execing a x86 native binary from an emulated arm binary to optimize parts of the build). By finding the binary, we will know how to exec it. Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Fix calculation of size to allocateWarner Losh2021-09-101-3/+2Star
| | | | | | | | | | 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: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: pass the bsd_param into loader_execWarner Losh2021-09-103-20/+27
| | | | | | | | | | Pass the bsd_param into loader_exec, and adjust. We use it to track the inital stack allocation and to set stack, open files, and other state shared between bsdload.c and elfload.c Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
* bsd-user: move arch specific defines out of elfload.cWarner Losh2021-09-103-79/+150
| | | | | | | | | Move the architecture specific defines to target_arch_elf.h and delete them from elfload.c. Only retain ifdefs appropriate for i386 and x86_64. Add the copyright/license comments, and guard ifdefs. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Remove all non-x86 code from elfload.cWarner Losh2021-09-071-345/+2Star
| | | | | | | | | | 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 <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: style nits: bsdload.c whitespace to qemu standardWarner Losh2021-09-071-2/+2
| | | | | Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: add license to bsdload.cWarner Losh2021-09-071-1/+16
| | | | | | | | 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 <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: Add Stacey's copyright to main.cWarner Losh2021-09-071-1/+2
| | | | | | | | Add Stacey's updated copyright to main.c Signed-off-by: Warner Losh <imp@bsdimp.com> Signed-off-by: Stacey Son <sson@FreeBSD.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: add copyright header to elfload.cWarner Losh2021-09-071-1/+18
| | | | | | | | Add Stacey's copyright to elfload.c Signed-off-by: Stacey Son <sson@FreeBSD.org> Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* bsd-user: remove sparc and sparc64Warner Losh2021-09-076-477/+0Star
| | | | | | | | | | 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 <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
* Merge remote-tracking branch 'remotes/mjt/tags/patch-fetch' into stagingPeter Maydell2021-09-071-8/+5Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu-socket unix socket bugfix 2021-09-06 # gpg: Signature made Mon 06 Sep 2021 16:19:32 BST # gpg: using RSA key 7B73BAD68BE7A2C289314B22701B4F6B1A693E59 # gpg: issuer "mjt@tls.msk.ru" # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" [full] # gpg: aka "Michael Tokarev <mjt@corpit.ru>" [full] # gpg: aka "Michael Tokarev <mjt@debian.org>" [full] # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * remotes/mjt/tags/patch-fetch: qemu-sockets: fix unix socket path copy (again) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qemu-sockets: fix unix socket path copy (again)Michael Tokarev2021-09-061-8/+5Star
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4cfd970ec188558daa6214f26203fe553fb1e01f added an assert which ensures the path within an address of a unix socket returned from the kernel is at least one byte and does not exceed sun_path buffer. Both of this constraints are wrong: A unix socket can be unnamed, in this case the path is completely empty (not even \0) And some implementations (notable linux) can add extra trailing byte (\0) _after_ the sun_path buffer if we passed buffer larger than it (and we do). So remove the assertion (since it causes real-life breakage) but at the same time fix the usage of sun_path. Namely, we should not access sun_path[0] if kernel did not return it at all (this is the case for unnamed sockets), and use the returned salen when copyig actual path as an upper constraint for the amount of bytes to copy - this will ensure we wont exceed the information provided by the kernel, regardless whenever there is a trailing \0 or not. This also helps with unnamed sockets. Note the case of abstract socket, the sun_path is actually a blob and can contain \0 characters, - it should not be passed to g_strndup and the like, it should be accessed by memcpy-like functions. Fixes: 4cfd970ec188558daa6214f26203fe553fb1e01f Fixes: http://bugs.debian.org/993145 Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> CC: qemu-stable@nongnu.org
* Merge remote-tracking branch ↵Peter Maydell2021-09-0611-124/+192
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/thuth-gitlab/tags/pull-request-2021-09-06' into staging * Add definitions of terms for CI/testing * Fix g_setenv problem discovered by Coverity * Gitlab CI improvements * Build system improvements (configure script + meson.build) * Removal of the show-fixed-bugs.sh script * Clean up of the sdl and curses options # gpg: Signature made Mon 06 Sep 2021 10:51:49 BST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/thuth-gitlab/tags/pull-request-2021-09-06: softmmu/vl: Deprecate the -sdl and -curses option softmmu/vl: Deprecate the old grab options softmmu/vl: Add a "grab-mod" parameter to the -display sdl option scripts: Remove the "show-fixed-bugs.sh" file configure / meson: Move the GBM handling to meson.build meson.build: Don't use internal libfdt if the user requested the system libfdt meson.build: Fix the check for a usable libfdt gitlab-ci: Don't try to use the system libfdt in the debian job libqtest: check for g_setenv() failure docs: add definitions of terms for CI/testing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * softmmu/vl: Deprecate the -sdl and -curses optionThomas Huth2021-09-062-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | It's not that much complicated to type "-display sdl" or "-display curses", so we should not clutter our main option name space with such simple wrapper options and rather present the users with a concise interface instead. Thus let's deprecate the "-sdl" and "-curses" wrapper options now. Message-Id: <20210825092023.81396-4-thuth@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * softmmu/vl: Deprecate the old grab optionsThomas Huth2021-09-063-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The alt_grab and ctrl_grab parameter of the -display sdl option prevent the QAPIfication of the "sdl" part of the -display option, so we should eventually remove them. And since this feature is also rather niche anyway, we should not clutter the top-level option list with these, so let's also deprecate the "-alt-grab" and the "-ctrl-grab" options while we're at it. Once the deprecation period of "alt_grab" and "ctrl_grab" is over, we then can finally switch the -display sdl option to use QAPI internally, too. Message-Id: <20210825092023.81396-3-thuth@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * softmmu/vl: Add a "grab-mod" parameter to the -display sdl optionThomas Huth2021-09-062-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -display sdl option is not using QAPI internally yet, and uses hand- crafted parsing instead (see parse_display() in vl.c), which is quite ugly, since most of the other code is using the QAPIfied DisplayOption already. Unfortunately, the "alt_grab" and "ctrl_grab" use underscores in their names which has recently been forbidden in new QAPI code, so a straight conversion is not possible. While we could add some exceptions to the QAPI schema parser for this, the way these parameters have been designed was maybe a bad idea anyway: First, it's not possible to enable both parameters at the same time, thus instead of two boolean parameters it would be better to have only one multi-choice parameter instead. Second, the naming is also somewhat unfortunate since the "alt_grab" parameter is not about the ALT key, but rather about the left SHIFT key that has to be used additionally when the parameter is enabled. So instead of trying to QAPIfy "alt_grab" and "ctrl_grab", let's rather introduce an alternative to these parameters instead, a new parameter called "grab-mod" which can either be set to "lshift-lctrl-lalt" or to "rctrl". In case we ever want to support additional modes later, we can then also simply extend the list of supported strings here. Message-Id: <20210825092023.81396-2-thuth@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * scripts: Remove the "show-fixed-bugs.sh" fileThomas Huth2021-09-061-91/+0Star
| | | | | | | | | | | | | | | | | | | | Since we are not using Launchpad anymore, there is no more need for this script. Message-Id: <20210825142143.142037-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * configure / meson: Move the GBM handling to meson.buildThomas Huth2021-09-063-23/+10Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The GBM library detection does not need to be in the configure script, since it does not have any user-facing options (there are no --enable-gbm or --disable-gbm switches). Let's move it to meson.build instead, so we don't have to clutter config-host.mak with the related switches. Additionally, only check for GBM if it is really required, i.e. if we either compile with OpenGL or with virglrenderer support. Message-Id: <20210714085045.797168-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * meson.build: Don't use internal libfdt if the user requested the system libfdtThomas Huth2021-09-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | If the users ran configure with --enable-libfdt=system, they likely did that on purpose. We should not silently fall back to the internal libfdt if the system libfdt is not usable, but report the problem with a proper message instead. Message-Id: <20210827120901.150276-3-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * meson.build: Fix the check for a usable libfdtThomas Huth2021-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for libfdt currently has a flaw: If there is a system libfdt, the meson.build code initialized the fdt variable with fdt = cc.find_library(...). However, if this libfdt is too old and there is no internal dtc module available, it continues with "fdt" pointing to the old and unusable version. The check later in the file that tries to detect whether libfdt is necessary then fails to trigger: if not fdt.found() and fdt_required.length() > 0 error('fdt not available but required by targets ' + ', '.join(fdt_required)) endif The build fails then during compilation instead, which is of course bad since this is quite confusing and already wasted quite some time of the user. Thus if libfdt is not usable, we should unset the "fdt" variable immediately again, so that the build already fails during the configuration phase. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/255 Message-Id: <20210827120901.150276-2-thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * gitlab-ci: Don't try to use the system libfdt in the debian jobThomas Huth2021-09-061-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | libfdt in Debian is too old to be usable for QEMU. So far we were silently falling back to the internal dtc submodule, but since this is wrong, let's remove the --enable-fdt=system switch here now. Message-Id: <20210827151718.178988-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * libqtest: check for g_setenv() failurePeter Maydell2021-09-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g_setenv() can fail; check for it when starting a QEMU process when we set the QEMU_AUDIO_DRV environment variable. Because this happens after fork() reporting an exact message via printf() is a bad idea; just exit(1), as we already do for the case of execlp() failure. Fixes: Coverity CID 1460117 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210820163750.9106-1-peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
| * docs: add definitions of terms for CI/testingWillian Rampazzo2021-09-062-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | To understand the current state of QEMU CI/testing and have a base to discuss the plans for the future, it is important to define some usual terms. This patch defines the terms for "Automated tests", "Unit testing", "Functional testing", "System testing", "Flaky tests", "Gating", and "Continuous Integration". Signed-off-by: Willian Rampazzo <willianr@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210831152939.97570-2-willianr@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
* | Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2021-09-0540-213/+440
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pc,pci,virtio: fixes, cleanups Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sat 04 Sep 2021 22:34:10 BST # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (35 commits) vhost-vdpa: remove the unncessary queue_index assignment vhost-vdpa: fix the wrong assertion in vhost_vdpa_init() vhost-vdpa: tweak the error label in vhost_vdpa_add() vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add() vhost-vdpa: don't cleanup twice in vhost_vdpa_add() vhost-vdpa: remove the unnecessary check in vhost_vdpa_add() vhost_net: do not assume nvqs is always 2 vhost: use unsigned int for nvqs vhost_net: remove the meaningless assignment in vhost_net_start_one() vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap() vhost-vdpa: remove unused variable "acked_features" tests/vhost-user-bridge.c: Fix typo in help message tests/vhost-user-bridge.c: Sanity check socket path length hw/virtio: Add flatview update in vhost_user_cleanup() hw/virtio: Remove NULL check in virtio_free_region_cache() hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCU MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem hw/acpi: use existing references to pci device struct within functions hw/pci: remove all references to find_i440fx function hw/i386/acpi-build: Get NUMA information from struct NumaState ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vhost-vdpa: remove the unncessary queue_index assignmentJason Wang2021-09-041-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | The queue_index of NetClientState should be assigned in set_netdev() afterwards, so trying to net_vhost_vdpa_init() is meaningless. This patch removes this. Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-12-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: fix the wrong assertion in vhost_vdpa_init()Jason Wang2021-09-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Vhost_vdpa_add() can fail for various reasons, so the assertion of the succeed is wrong. Instead, we should free the NetClientState and propagate the error to the caller Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-11-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: tweak the error label in vhost_vdpa_add()Jason Wang2021-09-041-7/+6Star
| | | | | | | | | | | | | | | | | | | | | | Introduce new error label to avoid the unnecessary checking of net pointer. Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-10-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add()Jason Wang2021-09-041-0/+1
| | | | | | | | | | | | | | | | | | Fixes: 1e0a84ea49b68 ("vhost-vdpa: introduce vhost-vdpa net client") Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-9-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: don't cleanup twice in vhost_vdpa_add()Jason Wang2021-09-041-11/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | The previous vhost_net_cleanup is sufficient for freeing, calling vhost_vdpa_del() in this case will lead an extra round of free. Note that this kind of "double free" is safe since vhost_dev_cleanup() zero the whole structure. Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-8-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: remove the unnecessary check in vhost_vdpa_add()Jason Wang2021-09-041-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | The VhostVDPAState is just allocated by qemu_new_net_client() via g_malloc0() in net_vhost_vdpa_init(). So s->vhost_net is NULL for sure, let's remove this unnecessary check in vhost_vdpa_add(). Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-7-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost_net: do not assume nvqs is always 2Jason Wang2021-09-045-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch switches to initialize dev.nvqs from the VhostNetOptions instead of assuming it was 2. This is useful for implementing control virtqueue support which will be a single vhost_net structure with a single cvq. Note that nvqs is still set to 2 for all users and this patch does not change functionality. Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Eli Cohen <elic@nvidia.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-6-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost: use unsigned int for nvqsJason Wang2021-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Switch to use unsigned int for nvqs since it's not expected to be negative. Reviewed-by: Eli Cohen <elic@nvidia.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-5-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost_net: remove the meaningless assignment in vhost_net_start_one()Jason Wang2021-09-041-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | The nvqs and vqs have been initialized during vhost_net_init() and are not expected to change during the life cycle of vhost_net structure. So this patch removes the meaningless assignment. Reviewed-by: Eli Cohen <elic@nvidia.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-4-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap()Jason Wang2021-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | We should return error code instead of zero, otherwise there's no way for the caller to detect the failure. Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-3-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * vhost-vdpa: remove unused variable "acked_features"Jason Wang2021-09-041-1/+0Star
| | | | | | | | | | | | | | | | | | "acked_features" is unused, let's remove that. Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20210903091031.47303-2-jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * tests/vhost-user-bridge.c: Fix typo in help messagePeter Maydell2021-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix a typo in the help message printed by vhost-user-bridge. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210901152713.25701-1-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * tests/vhost-user-bridge.c: Sanity check socket path lengthPeter Maydell2021-09-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The vhost-user-bridge binary accepts a UNIX socket path on the command line. Sanity check that this is short enough to fit into a sockaddr_un before copying it in. Fixes: Coverity CID 1432866 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20210901152632.25511-1-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
| * hw/virtio: Add flatview update in vhost_user_cleanup()Yuwei Zhang2021-09-041-1/+2
| | | | | | | | | | | | | | | | | | | | Qemu will crash on vhost backend unexpected exit and re-connect │ in some case due to access released memory. Signed-off-by: Yuwei Zhang <zhangyuwei.9149@bytedance.com> Message-Id: <20210830123433.45727-1-zhangyuwei.9149@bytedance.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/virtio: Remove NULL check in virtio_free_region_cache()Philippe Mathieu-Daudé2021-09-041-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio_free_region_cache() is called within call_rcu(), always with a non-NULL argument. Ensure new code keep it that way by replacing the NULL check by an assertion. Add a comment this function is called within call_rcu(). Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210826172658.2116840-3-philmd@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
| * hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCUPhilippe Mathieu-Daudé2021-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While virtio_queue_packed_empty_rcu() uses the '_rcu' suffix, it is not obvious it is called within rcu_read_lock(). All other functions from this file called with the RCU locked have a comment describing it. Document this one similarly for consistency. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210826172658.2116840-2-philmd@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
| * MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystemAni Sinha2021-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | I have developed an interest in this space and hopefully can lend some helping hand to Igor and Michael in reviewing simpler patches. Signed-off-by: Ani Sinha <ani@anisinha.ca> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20210825031949.919376-4-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/acpi: use existing references to pci device struct within functionsAni Sinha2021-09-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | There is no need to use fresh typecasts to get references to pci device structs when there is an existing reference to pci device struct. Use existing reference. Minor cleanup. Signed-off-by: Ani Sinha <ani@anisinha.ca> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210825031949.919376-3-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/pci: remove all references to find_i440fx functionAni Sinha2021-09-044-15/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c0e427d6eb5fefc538 ("hw/acpi/ich9: Enable ACPI PCI hot-plug") removed all uses of find_i440fx() function. This has been replaced by the more generic call acpi_get_i386_pci_host() which maybe able to find the root bus both for i440fx machine type as well as for the q35 machine type. There seems to be no more any need to maintain a i440fx specific version of the api call. Remove it. Tested by building from a clean tree successfully. Signed-off-by: Ani Sinha <ani@anisinha.ca> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210825031949.919376-2-ani@anisinha.ca> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * hw/i386/acpi-build: Get NUMA information from struct NumaStateJingqi Liu2021-09-043-18/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commits aa57020774b ("numa: move numa global variable nb_numa_nodes into MachineState") and 7e721e7b10e ("numa: move numa global variable numa_info into MachineState"), we can get NUMA information completely from MachineState::numa_state. Remove PCMachineState::numa_nodes and PCMachineState::node_mem, since they are just copied from MachineState::numa_state. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Jingqi Liu <jingqi.liu@intel.com> Message-Id: <20210823011254.28506-1-jingqi.liu@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>