aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
5 dayschardev/mux: introduce `mux_chr_attach_frontend() callRoman Penyaev3-8/+20
Move away logic which attaches frontend device to a mux from `char-fe.c` to actual `char-mux.c` implementation and make it a separate function. No logic changes are made. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-6-r.peniaev@gmail.com>
5 dayschardev/mux: convert size members to unsigned intRoman Penyaev4-11/+11
There is no sense to keep `focus`, `mux_cnt`, `prod`, `cons` and `tag` variables as signed, those represent either size, either position in array, which both are unsigned. `focus` member of `MuxChardev` is kept signed, because initially set to -1. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-5-r.peniaev@gmail.com>
5 dayschardev/mux: use bool type for `linestart` and `term_got_escape`Roman Penyaev2-7/+7
Those are boolean variables, not signed integers. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-4-r.peniaev@gmail.com>
5 dayschardev/chardev-internal: remove unused `max_size` struct memberRoman Penyaev1-1/+0
Clean up forgotten leftovers. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-3-r.peniaev@gmail.com>
5 dayschardev/char: fix qemu_chr_is_busy() checkRoman Penyaev1-1/+1
`mux_cnt` struct member never goes negative or decrements, so mux chardev can be !busy only when there are no frontends attached. This patch fixes the always-true check. Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend") Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-2-r.peniaev@gmail.com>
5 daysMerge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into ↵Peter Maydell15-172/+444
staging UI-related fixes & shareable 2d memory with -display dbus # -----BEGIN PGP SIGNATURE----- # # iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmcNHtIcHG1hcmNhbmRy # ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5SYTD/9fRNrgnZIvIbIGf0kv # j3LguzwEsfn8eIUbJEIxtDnoS17zX1t981kP9J9ctUM6wnb0iQNYCXeTrF8Xrq0z # psiPhHGwPyWMdn9SWRfj597ShPn75z340Qve5GUm7clGu2KILh7TqqACH8LzaX+5 # 6jqoZc3kqD+PYZHnYAi6v1YFfLIYfj0n6EaO/J4RRRZSrknpgct7jpmqL4wVzTIo # KYlG5afdUUfhmSIv5ZDpuuEJppdG74K2H+hJKDPIOOQ8/i/IU2EQPJ00ppiOPbET # nA0+piLGtHQwU24u5kDdbDlGL/y1KBKvGclOtzLQxWNStch5A6hqllNsuIg+0dJW # MRO2WZ8C7P7LD1eGmtYVZF/NzjnlTW/hbM5i0poPqhfcwbVmlIXjDs8GUfMGfINr # 1MVFGNjxfgadYZ1f6Q/JU/KWPJMR4Ik3C/SmGrRBlfra5YIts0ItDeGgfQIW9JGb # 1CpOng6/3SvW01B6psrPL+wP+6PsK333KPIA77KafOEMyOyEyuSOUrTShXbyXBHc # r/nLbWw2lZs4U0kgGRQ21+R3huTyw8LnikYpCnGwTWGCpb9NDFYg7z3CRrZW0hWx # DIWfN7M6YymeYygPUV9Wjo6i4yq4QqWPp7/QXtkSdX3v44/D7NWytKGST+Hwjkpa # h6U2vrsLdep2m47bnX/dEEP61g== # =xdt/ # -----END PGP SIGNATURE----- # gpg: Signature made Mon 14 Oct 2024 14:38:26 BST # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full] # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu: audio/pw: Report more accurate error when connecting to PipeWire fails tests: add basic -display dbus Map.Unix test ui: refactor using a common qemu_pixman_shareable virtio-gpu: allocate shareable 2d resources on !win32 ui/dbus: implement Unix.Map ui/dbus: add Listener.Unix.Map interface XML ui/dbus: make Listener.Win32.Map win32-specific meson: find_program('gdbus-codegen') directly ui/surface: allocate shared memory on !win32 ui/dbus: add trace for can_share_map ui/dbus: do not limit to one listener per connection / bus name ui/pixman: generalize shared_image_destroy util/memfd: report potential errors on free ui/dbus: discard pending CursorDefine on new one ui/dbus: discard display messages on disable ui/dbus: fix filtering all update messages ui/win32: fix potential use-after-free with dbus shared memory ui/dbus: fix leak on message filtering hw/audio/hda: fix memory leak on audio setup hw/audio/hda: free timer on exit Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 daystests: update lcitool to fix freebsd py311-yaml renameDaniel P. Berrangé4-2/+3
This addresses the py311-yaml -> py311-pyyaml rename in FreeBSD. The change to the OpenSUSE dockerfile is something that will allow QEMU to access rust bindgen in future. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20241014130255.10119-1-berrange@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 daysconfigure, meson: synchronize defaults for configure and Meson Rust optionsPaolo Bonzini2-2/+2
If the defaults for --enable-rust ($rust in configure) and Meson's rust option are out of sync, incremental builds will pick Meson's default. This happens because, on an incremental build, configure does not run Meson, Make does instead. Meson then gets the command line options from either coredata.dat (which has everything cached in Python's pickle format) or cmd_line.txt (slow path when Meson version is upgraded), but neither knows about the rust option, and the meson_options.txt default is used. This will cause have_rust to be true if rustc is available; and the build to fail because configure did not put a RUST_TARGET_TRIPLE in config-host.mak. When in the Rust pull request I changed the $rust default from auto to disabled, I should have made the same change to meson_options.txt; do it now. Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reported-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20241014110113.173946-1-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 daysmeson: check in main meson.build for native Rust compilerPaolo Bonzini2-3/+2
A working native Rust compiler is always needed in order to compile Rust code, even when cross compiling, in order to build the procedural macros that QEMU uses. Right now, the check is done in rust/qemu-api-macros/meson.build, but this has two disadvantages. First, it makes the build fail when the Meson "rust" option is set to "auto" (instead, Rust support should be disabled). Second, add_languages() is one of the few functions that are executed even by "meson introspect", except that "meson introspect" executes both branches of "if" statements! Therefore, "meson introspect" tries to look for a Rust compiler even if the option is disabled---and then fails because the compiler is required by rust/qemu-api-macros/meson.build. This is visible for example if the compilation host has a stale scripts/meson-buildoptions.sh and no rustc installed. Both issues can be fixed by moving the check to the main meson.build, together with the check for the cross compiler. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 daysaudio/pw: Report more accurate error when connecting to PipeWire failsMichal Privoznik1-4/+4
According to its man page [1], pw_context_connect() sets errno on failure: Returns a Core on success or NULL with errno set on error. It may be handy to see errno when figuring out why PipeWire failed to connect. That leaves us with just one possible path to reach 'fail_error' label which is then moved to that path and also its error message is adjusted slightly. 1: https://docs.pipewire.org/group__pw__core.html#ga5994e3a54e4ec718094ca02a1234815b Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <3a78811ad5b0e87816b7616ab21d2eeef00b9c52.1726647033.git.mprivozn@redhat.com>
5 daystests: add basic -display dbus Map.Unix testMarc-André Lureau1-5/+67
Only check we eventually get a shared memory scanout. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-20-marcandre.lureau@redhat.com>
5 daysui: refactor using a common qemu_pixman_shareableMarc-André Lureau7-140/+142
Use a common shareable type for win32 & unix, and helper functions. This simplify the code as it avoids a lot of #ifdef'ery. Note: if it helps review, commits could be reordered to introduce the common type before introducing shareable memory for unix. Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-19-marcandre.lureau@redhat.com>
5 daysvirtio-gpu: allocate shareable 2d resources on !win32Marc-André Lureau2-12/+29
Similar to what was done in commit 9462ff46 ("virtio-gpu/win32: allocate shareable 2d resources/images") for win32, allocate resource memory with memfd, so the associated display surface memory can be shared with a different process. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-18-marcandre.lureau@redhat.com>
5 daysui/dbus: implement Unix.MapMarc-André Lureau1-5/+73
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-17-marcandre.lureau@redhat.com>
5 daysui/dbus: add Listener.Unix.Map interface XMLMarc-André Lureau1-0/+47
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-16-marcandre.lureau@redhat.com>
5 daysui/dbus: make Listener.Win32.Map win32-specificMarc-André Lureau1-0/+2
There are no types specific to Windows, so the code compiles on other platforms, but its useless on !Windows. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-15-marcandre.lureau@redhat.com>
5 daysmeson: find_program('gdbus-codegen') directlyMarc-André Lureau1-1/+1
gio.pc variable is a bit bogus in context of cross-compilation, since it contains an absolute path, relative to the sysroot directory. On Fedora, it ends up as: /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/usr/bin/gdbus-codegen path which does not exist because it is not shipped by Fedora mingw packages. Instead, we can rely on meson find_program() behaviour to do a better job based on its search order and capabilities. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-14-marcandre.lureau@redhat.com>
5 daysui/surface: allocate shared memory on !win32Marc-André Lureau2-2/+32
Use qemu_memfd_alloc() to allocate the display surface memory, which will fallback on tmpfile/mmap() on systems without memfd, and allow to share the display with other processes. This is similar to how display memory is allocated on win32 since commit 09b4c198 ("console/win32: allocate shareable display surface"). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-13-marcandre.lureau@redhat.com>
5 daysui/dbus: add trace for can_share_mapMarc-André Lureau2-0/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-12-marcandre.lureau@redhat.com>
5 daysui/dbus: do not limit to one listener per connection / bus nameMarc-André Lureau1-18/+5
This is an arbitrary limitation that doesn't concern QEMU directly and may make some use cases unnecessarily more complicated. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-11-marcandre.lureau@redhat.com>
5 daysui/pixman: generalize shared_image_destroyMarc-André Lureau4-12/+16
Learn to free memfd-allocated shared memory. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-10-marcandre.lureau@redhat.com>
5 daysutil/memfd: report potential errors on freeMarc-André Lureau1-2/+7
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-9-marcandre.lureau@redhat.com>
5 daysui/dbus: discard pending CursorDefine on new oneMarc-André Lureau1-0/+28
Similar to scanout updates, let's discard pending cursor changes. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-8-marcandre.lureau@redhat.com>
5 daysui/dbus: discard display messages on disableMarc-André Lureau1-0/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-7-marcandre.lureau@redhat.com>
5 daysui/dbus: fix filtering all update messagesMarc-André Lureau1-12/+33
Filtering pending messages when a new scanout is given shouldn't discard pending cursor changes, for example. Since filtering happens in a different thread, use atomic set/get. Fixes: fa88b85dea ("ui/dbus: filter out pending messages when scanout") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-6-marcandre.lureau@redhat.com>
5 daysui/win32: fix potential use-after-free with dbus shared memoryMarc-André Lureau4-34/+21
DisplaySurface may be free before the pixman image is freed, since the image is refcounted and used by different objects, including pending dbus messages. Furthermore, setting the destroy function in create_displaysurface_from() isn't appropriate, as it may not be used, and may be overriden as in ramfb. Set the destroy function when the shared handle is set, use the HANDLE directly for destroy data, using a single common helper qemu_pixman_win32_image_destroy(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-5-marcandre.lureau@redhat.com>
5 daysui/dbus: fix leak on message filteringMarc-André Lureau1-0/+1
A filter function that wants to drop a message should return NULL, in which case it must also unref the message itself. Fixes: fa88b85de ("ui/dbus: filter out pending messages when scanout") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-4-marcandre.lureau@redhat.com>
5 dayshw/audio/hda: fix memory leak on audio setupMarc-André Lureau1-13/+20
When SET_STREAM_FORMAT is called, we should clear the existing setup. Factor out common function to close a stream. Direct leak of 144 byte(s) in 3 object(s) allocated from: #0 0x7f91d38f7350 in calloc (/lib64/libasan.so.8+0xf7350) (BuildId: a4ad7eb954b390cf00f07fa10952988a41d9fc7a) #1 0x7f91d2ab7871 in g_malloc0 (/lib64/libglib-2.0.so.0+0x64871) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649) #2 0x562fa2f447ee in timer_new_full /home/elmarco/src/qemu/include/qemu/timer.h:538 #3 0x562fa2f4486f in timer_new /home/elmarco/src/qemu/include/qemu/timer.h:559 #4 0x562fa2f448a9 in timer_new_ns /home/elmarco/src/qemu/include/qemu/timer.h:577 #5 0x562fa2f47955 in hda_audio_setup ../hw/audio/hda-codec.c:490 #6 0x562fa2f4897e in hda_audio_command ../hw/audio/hda-codec.c:605 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-3-marcandre.lureau@redhat.com>
5 dayshw/audio/hda: free timer on exitMarc-André Lureau1-1/+1
Fixes: 280c1e1cd ("audio/hda: create millisecond timers that handle IO") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-2-marcandre.lureau@redhat.com>
6 daysMerge tag 'pull-tcg-20241013' of https://gitlab.com/rth7680/qemu into stagingPeter Maydell41-358/+463
linux-user/i386: Emulate orig_ax linux-user/vm86: Fix compilation with Clang tcg: remove singlestep_enabled from DisasContextBase accel/tcg: Add TCGCPUOps.tlb_fill_align target/hppa: Handle alignment faults in hppa_get_physical_address target/arm: Fix alignment fault priority in get_phys_addr_lpae # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmcMRU4dHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9dSQf+MUJq//oig+bDeUlQ # v3uBMFVi1DBYI1Y/xVODADpn8Ltv5s9v7N+/phi+St2W65OzGNYviHvq/abeyhdo # M40LGtOvjO6Mns+Z9NKTobtT8n4ap4JJyoFjuXFTHkMMDiQ/v7FkEJJoS3W2bemi # zmKYF/vWe3bwI+d3+dyaUjA92gSs+Hlj8uEVBlzn3ubA19ZdvtyfKURPQynrkwlo # dFtAOFRFBU6vrlJSBElxUfYO4jC4Cng19EOrWvIsuKAkACuhiHgah10i3WKw8Asz # 1iRUYXe0EOlX2RYNTD+Oj5j0cViRylirgPtIhEIPBuDP7m1Jy1JO4dVARUJBBU71 # Zd4Uuw== # =EX+a # -----END PGP SIGNATURE----- # gpg: Signature made Sun 13 Oct 2024 23:10:22 BST # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * tag 'pull-tcg-20241013' of https://gitlab.com/rth7680/qemu: (27 commits) target/arm: Fix alignment fault priority in get_phys_addr_lpae target/arm: Implement TCGCPUOps.tlb_fill_align target/arm: Move device detection earlier in get_phys_addr_lpae target/arm: Pass MemOp to get_phys_addr_lpae target/arm: Pass MemOp through get_phys_addr_twostage target/arm: Pass MemOp to get_phys_addr_nogpc target/arm: Pass MemOp to get_phys_addr_gpc target/arm: Pass MemOp to get_phys_addr_with_space_nogpc target/arm: Pass MemOp to get_phys_addr target/hppa: Implement TCGCPUOps.tlb_fill_align target/hppa: Handle alignment faults in hppa_get_physical_address target/hppa: Fix priority of T, D, and B page faults target/hppa: Perform access rights before protection id check target/hppa: Add MemOp argument to hppa_get_physical_address accel/tcg: Use the alignment test in tlb_fill_align accel/tcg: Add TCGCPUOps.tlb_fill_align include/exec/memop: Introduce memop_atomicity_bits include/exec/memop: Rename get_alignment_bits include/exec/memop: Move get_alignment_bits from tcg.h accel/tcg: Assert noreturn from write-only page for atomics ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 daystarget/arm: Fix alignment fault priority in get_phys_addr_lpaeRichard Henderson1-21/+30
Now that we have the MemOp for the access, we can order the alignment fault caused by memory type before the permission fault for the page. For subsequent page hits, permission and stage 2 checks are known to pass, and so the TLB_CHECK_ALIGNED fault raised in generic code is not mis-ordered. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Implement TCGCPUOps.tlb_fill_alignRichard Henderson4-34/+23
Fill in the tlb_fill_align hook. Handle alignment not due to memory type, since that's no longer handled by generic code. Pass memop to get_phys_addr. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Move device detection earlier in get_phys_addr_lpaeRichard Henderson1-24/+25
Determine cache attributes, and thence Device vs Normal memory, earlier in the function. We have an existing regime_is_stage2 if block into which this can be slotted. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp to get_phys_addr_lpaeRichard Henderson1-2/+4
Pass the value through from get_phys_addr_nogpc. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp through get_phys_addr_twostageRichard Henderson1-4/+6
Pass memop through get_phys_addr_twostage with its recursion with get_phys_addr_nogpc. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp to get_phys_addr_nogpcRichard Henderson1-6/+8
Zero is the safe do-nothing value for callers to use. Pass the value through from get_phys_addr_gpc and get_phys_addr_with_space_nogpc. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp to get_phys_addr_gpcRichard Henderson1-5/+6
Zero is the safe do-nothing value for callers to use. Pass the value through from get_phys_addr. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp to get_phys_addr_with_space_nogpcRichard Henderson3-6/+8
Zero is the safe do-nothing value for callers to use. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/arm: Pass MemOp to get_phys_addrRichard Henderson4-7/+8
Zero is the safe do-nothing value for callers to use. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/hppa: Implement TCGCPUOps.tlb_fill_alignRichard Henderson3-13/+16
Convert hppa_cpu_tlb_fill to hppa_cpu_tlb_fill_align so that we can recognize alignment exceptions in the correct priority order. Resolves: https://bugzilla.kernel.org/show_bug.cgi?id=219339 Tested-by: Helge Deller <deller@gmx.de> Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/hppa: Handle alignment faults in hppa_get_physical_addressRichard Henderson1-1/+6
In Chapter 5, Interruptions, the group 3 exceptions lists "Unaligned data reference trap" has higher priority than "Data memory break trap". Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/hppa: Fix priority of T, D, and B page faultsRichard Henderson1-3/+5
Drop the 'else' so that ret is overridden with the highest priority fault. Fixes: d8bc1381250 ("target/hppa: Implement PSW_X") Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/hppa: Perform access rights before protection id checkRichard Henderson1-6/+6
In Chapter 5, Interruptions, the group 3 exceptions lists "Data memory access rights trap" in priority order ahead of "Data memory protection ID trap". Swap these checks in hppa_get_physical_address. Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daystarget/hppa: Add MemOp argument to hppa_get_physical_addressRichard Henderson4-7/+8
Just add the argument, unused at this point. Zero is the safe do-nothing value for all callers. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysaccel/tcg: Use the alignment test in tlb_fill_alignRichard Henderson1-43/+45
When we have a tlb miss, defer the alignment check to the new tlb_fill_align hook. Move the existing alignment check so that we only perform it with a tlb hit. Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysaccel/tcg: Add TCGCPUOps.tlb_fill_alignRichard Henderson4-25/+67
Add a new callback to handle softmmu paging. Return the page details directly, instead of passing them indirectly to tlb_set_page. Handle alignment simultaneously with paging so that faults are handled with target-specific priority. Route all calls of the two hooks through a tlb_fill_align function local to cputlb.c. As yet no targets implement the new hook. As yet cputlb.c does not use the new alignment check. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysinclude/exec/memop: Introduce memop_atomicity_bitsRichard Henderson2-14/+26
Split out of mmu_lookup. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysinclude/exec/memop: Rename get_alignment_bitsRichard Henderson9-16/+16
Rename to use "memop_" prefix, like other functions that operate on MemOp. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysinclude/exec/memop: Move get_alignment_bits from tcg.hRichard Henderson2-23/+23
This function is specific to MemOp, not TCG in general. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 daysaccel/tcg: Assert noreturn from write-only page for atomicsRichard Henderson1-3/+2
There should be no "just in case"; the page is already in the tlb, and known to be not readable. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>