Re: [PATCH v4 7/9] pcie_sriov: Release VFs failed to realize

2024-02-13 Thread Akihiko Odaki
On 2024/02/14 16:54, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:45PM +0900, Akihiko Odaki wrote: Release VFs failed to realize just as we do in unregister_vfs(). Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki

Re: [PATCH v6] util: Move dbus_display1 to util

2024-02-13 Thread Akihiko Odaki
On 2024/02/14 16:05, Marc-André Lureau wrote: Hi Akihiko On Wed, Feb 14, 2024 at 9:39 AM Akihiko Odaki wrote: Move dbus_display1 from ui to util as it's used not only by ui/dbus but also dbus-display-test. It doesn't seem like the right place either. So let's focus on what this is fixing.

Re: [PATCH v4 7/9] pcie_sriov: Release VFs failed to realize

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:45PM +0900, Akihiko Odaki wrote: > Release VFs failed to realize just as we do in unregister_vfs(). > > Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization > (SR/IOV)") > Signed-off-by: Akihiko Odaki Is this fixing an old bug or a bug

Re: [PATCH v4 6/9] pcie_sriov: Reuse SR-IOV VF device instances

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:44PM +0900, Akihiko Odaki wrote: > Disable SR-IOV VF devices by reusing code to power down PCI devices > instead of removing them when the guest requests to disable VFs. This > allows to realize devices and report VF realization errors at PF > realization time. > >

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Philippe Mathieu-Daudé
On 14/2/24 08:37, Philippe Mathieu-Daudé wrote: On 12/2/24 13:32, Peter Maydell wrote: So I would like to explore whether we can deprecate-and-drop some or all of them. This would let us delete the code entirely rather than spending a long time trying to bring it up to scratch for a probably

Re: [PATCH v4 4/4] qemu-options.hx: Add an entry for virtio-iommu-pci and document aw-bits

2024-02-13 Thread Cédric Le Goater
On 2/13/24 19:28, Eric Auger wrote: We are missing an entry for the virtio-iommu-pci device. Add the information on which machine it is currently supported and document the new aw-bits option. Signed-off-by: Eric Auger --- qemu-options.hx | 8 1 file changed, 8 insertions(+) diff

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Philippe Mathieu-Daudé
On 12/2/24 13:32, Peter Maydell wrote: So I would like to explore whether we can deprecate-and-drop some or all of them. This would let us delete the code entirely rather than spending a long time trying to bring it up to scratch for a probably very small to nonexistent userbase. The aim of

Re: [PATCH] target/ppc: Fix lxv/stxv MSR facility check

2024-02-13 Thread Cédric Le Goater
On 2/13/24 09:39, Nicholas Piggin wrote: The move to decodetree flipped the inequality test for the VEC / VSX MSR facility check. This caused application crashes under Linux, where these facility unavailable interrupts are used for lazy-switching of VEC/VSX register sets. Getting the incorrect

Re: [PATCH 4/4] hw/arm/stellaris: Add missing QOM 'SoC' parent

2024-02-13 Thread Cédric Le Goater
On 2/13/24 16:36, Philippe Mathieu-Daudé wrote: On 1/2/24 17:46, Peter Maydell wrote: On Tue, 30 Jan 2024 at 19:03, Philippe Mathieu-Daudé wrote: QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). Since we don't model the

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:47PM +0900, Akihiko Odaki wrote: > NumVFs may not equal to the current effective number of VFs because VF > Enable is cleared, NumVFs is set after VF Enable is set, or NumVFs is > greater than TotalVFs. > > Fixes: 11871f53ef8e ("hw/nvme: Add support for the

Re: [PATCH v6] util: Move dbus_display1 to util

2024-02-13 Thread Marc-André Lureau
Hi Akihiko On Wed, Feb 14, 2024 at 9:39 AM Akihiko Odaki wrote: > > Move dbus_display1 from ui to util as it's used not only by ui/dbus but > also dbus-display-test. It doesn't seem like the right place either. So let's focus on what this is fixing. > dbus_display1 is now added to util_ss

Re: [PATCH 4/7] hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h'

2024-02-13 Thread Philippe Mathieu-Daudé
On 13/2/24 19:57, Bernhard Beschow wrote: Am 13. Februar 2024 12:01:49 UTC schrieb "Philippe Mathieu-Daudé" : Since pc_madt_cpu_entry() is only used by: - hw/i386/acpi-build.c // single call - hw/i386/acpi-common.c // definition there is no need to expose it outside of hw/i386/. Declare

Re: [PATCH v4 8/9] pcie_sriov: Do not reset NumVFs after unregistering VFs

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:46PM +0900, Akihiko Odaki wrote: > I couldn't find such a behavior specified. Is it fixing a bug or just removing unnecessary code? Is this guest visible at all? > Signed-off-by: Akihiko Odaki > --- > hw/pci/pcie_sriov.c | 1 - > 1 file changed, 1 deletion(-) > >

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:43PM +0900, Akihiko Odaki wrote: > The guest may write NumVFs greater than TotalVFs and that can lead > to buffer overflow in VF implementations. > > Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization > (SR/IOV)") > Signed-off-by: Akihiko

Re: [PATCH v4 2/9] hw/pci: Determine if rombar is explicitly enabled

2024-02-13 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 02:13:40PM +0900, Akihiko Odaki wrote: > vfio determines if rombar is explicitly enabled by inspecting QDict. > Inspecting QDict is not nice because QDict is untyped and depends on the > details on the external interface. Add an infrastructure to determine if > rombar is

[PULL v2 1/4] chardev/parallel: Don't close stdin on inappropriate device

2024-02-13 Thread Markus Armbruster
The __linux__ version of qemu_chr_open_pp_fd() tries to claim the parport device with a PPCLAIM ioctl(). On success, it stores the file descriptor in the chardev object, and returns success. On failure, it closes the file descriptor, and returns failure. chardev_new() then passes the Chardev to

[PULL v2 3/4] qapi/char: Make backend types properly conditional

2024-02-13 Thread Markus Armbruster
Character backends are actually QOM types. When a backend's compile-time conditional QOM type is not compiled in, creation fails with "'FOO' is not a valid char driver name". Okay, except introspecting chardev-add with query-qmp-schema doesn't work then: the backend type is there even though the

[PULL v2 4/4] qapi/char: Deprecate backend type "memory"

2024-02-13 Thread Markus Armbruster
It's an alias for "ringbuf" we kept for backward compatibility; see commit 3a1da42eb35 (qapi: Rename ChardevBackend member "memory" to "ringbuf"). Deprecation is long overdue. Signed-off-by: Markus Armbruster Message-ID: <20240203080228.2766159-5-arm...@redhat.com> Reviewed-by: Marc-André

[PULL v2 0/4] Character device backend patches for 2024-02-12

2024-02-13 Thread Markus Armbruster
I offered Marc-André to do this pull request, and he accepted. The following changes since commit 5d1fc614413b10dd94858b07a1b2e26b1aa0296c: Merge tag 'migration-staging-pull-request' of https://gitlab.com/peterx/qemu into staging (2024-02-09 11:22:20 +) are available in the Git

[PULL v2 2/4] tests/unit/test-char: Fix qemu_socket(), make_udp_socket() check

2024-02-13 Thread Markus Armbruster
qemu_socket() and make_udp_socket() return a file descriptor on success, -1 on failure. The check misinterprets 0 as failure. Fix that. Signed-off-by: Markus Armbruster Message-ID: <20240203080228.2766159-3-arm...@redhat.com> Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake ---

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Tony Lindgren
* Aaro Koskinen [240214 01:27]: > On Tue, Feb 13, 2024 at 09:11:38PM +0100, Arnd Bergmann wrote: > > I think Tony still tests these on both hardware and qemu. > > The platform side here is much more modern than any of the > > others above since it does use DT and it has enough RAM > > to be

[PATCH v6] util: Move dbus_display1 to util

2024-02-13 Thread Akihiko Odaki
Move dbus_display1 from ui to util as it's used not only by ui/dbus but also dbus-display-test. dbus_display1 is now added to util_ss accordingly. It ensures that the source will be linked with audio/dbus, and also avoids recompilation when linking with dbus-display-test. dbus-display.h is also

[PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-13 Thread Akihiko Odaki
The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-13 Thread Akihiko Odaki
NumVFs may not equal to the current effective number of VFs because VF Enable is cleared, NumVFs is set after VF Enable is set, or NumVFs is greater than TotalVFs. Fixes: 11871f53ef8e ("hw/nvme: Add support for the Virtualization Management command") Signed-off-by: Akihiko Odaki ---

[PATCH v4 8/9] pcie_sriov: Do not reset NumVFs after unregistering VFs

2024-02-13 Thread Akihiko Odaki
I couldn't find such a behavior specified. Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 9d668b8d6c17..410bc090fc58 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -209,7

[PATCH v4 2/9] hw/pci: Determine if rombar is explicitly enabled

2024-02-13 Thread Akihiko Odaki
vfio determines if rombar is explicitly enabled by inspecting QDict. Inspecting QDict is not nice because QDict is untyped and depends on the details on the external interface. Add an infrastructure to determine if rombar is explicitly enabled to hw/pci. Signed-off-by: Akihiko Odaki ---

[PATCH v4 4/9] hw/qdev: Remove opts member

2024-02-13 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 4 hw/core/qdev.c | 1 - system/qdev-monitor.c | 12 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/hw/qdev-core.h

[PATCH v4 0/9] hw/pci: SR-IOV related fixes and improvements

2024-02-13 Thread Akihiko Odaki
I submitted a RFC series[1] to add support for SR-IOV emulation to virtio-net-pci. During the development of the series, I fixed some trivial bugs and made improvements that I think are independently useful. This series extracts those fixes and improvements from the RFC series. Below is an

[PATCH v4 1/9] hw/pci: Use -1 as a default value for rombar

2024-02-13 Thread Akihiko Odaki
Currently there is no way to distinguish the case that rombar is explicitly specified as 1 and the case that rombar is not specified. Set rombar -1 by default to distinguish these cases just as it is done for addr and romsize. It was confirmed that changing the default value to -1 will not change

[PATCH v4 7/9] pcie_sriov: Release VFs failed to realize

2024-02-13 Thread Akihiko Odaki
Release VFs failed to realize just as we do in unregister_vfs(). Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci/pcie_sriov.c

[PATCH v4 6/9] pcie_sriov: Reuse SR-IOV VF device instances

2024-02-13 Thread Akihiko Odaki
Disable SR-IOV VF devices by reusing code to power down PCI devices instead of removing them when the guest requests to disable VFs. This allows to realize devices and report VF realization errors at PF realization time. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 8 ++--

[PATCH v4 3/9] vfio: Avoid inspecting option QDict for rombar

2024-02-13 Thread Akihiko Odaki
Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly enabled. Signed-off-by: Akihiko Odaki --- hw/vfio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 4fa387f0430d..647f15b2a060 100644 --- a/hw/vfio/pci.c +++

[PATCH] linux-user: Remove pgb_dynamic alignment assertion

2024-02-13 Thread Richard Henderson
The assertion was never correct, because the alignment is a composite of the image alignment and SHMLBA. Even if the alignment didn't match the image an assertion would not be correct -- more appropriate would be an error message about an ill formed image. But the image cannot be held to SHMLBA

[PATCH v10 2/6] ui/cocoa: Scale with NSView instead of Core Graphics

2024-02-13 Thread Akihiko Odaki
Core Graphics is not accelerated and slow. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 23 +-- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index fe0eb74b0743..cb6090905999 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -496,10 +496,8

[PATCH v10 6/6] ui/cocoa: Remove stretch_video flag

2024-02-13 Thread Akihiko Odaki
Evaluate [normalWindow styleMask] & NSWindowStyleMaskResizable instead. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index aeec3c48859c..0ed40cd97d28 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m

[PATCH v10 5/6] ui/cocoa: Call console_select() with the BQL

2024-02-13 Thread Akihiko Odaki
console_select() can be called anytime so explicitly take the BQL. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index a1f54b3ebb9a..aeec3c48859c 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1390,7

[PATCH v10 4/6] ui/cocoa: Make window resizable

2024-02-13 Thread Akihiko Odaki
The window will be resizable when zoom-to-fit is on. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index 518fae26f6f4..a1f54b3ebb9a 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1378,8 +1378,10 @@ - (void)zoomToFit:(id)

[PATCH v10 3/6] ui/cocoa: Let the platform toggle fullscreen

2024-02-13 Thread Akihiko Odaki
It allows making the window full screen by clicking full screen button provided by the platform (the left-top green button) and save some code. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 423 ++--- 1 file changed, 207 insertions(+), 216

[PATCH v10 0/6] ui/cocoa: Use NSWindow's ability to resize

2024-02-13 Thread Akihiko Odaki
V5 -> V6: Rebased. Signed-off-by: Akihiko Odaki --- Changes in v10: - Removed relative mouse input scaling. - Link to v9: https://lore.kernel.org/r/20240213-cocoa-v9-0-d5a5e1bf0...@daynix.com Changes in v9: - Split patch "ui/cocoa: Use NSWindow's ability to resize" into patche

[PATCH v10 1/6] ui/cocoa: Release specific mouse buttons

2024-02-13 Thread Akihiko Odaki
ui/cocoa used to release all mouse buttons when it sees NSEventTypeLeftMouseUp, NSEventTypeRightMouseUp, or NSEventTypeOtherMouseUp, but it can instead release specific one according to the delivered event. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 132

[PATCH v3 1/3] Hexagon (target/hexagon) Pass P0 explicitly to helpers that need it

2024-02-13 Thread Taylor Simpson
Rather than reading P0 from the env, pass it explicitly Signed-off-by: Taylor Simpson Reviewed-by: Anton Johansson Tested-by: Anton Johansson --- target/hexagon/macros.h | 4 ++-- target/hexagon/hex_common.py | 12 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff

[PATCH v3 0/3] Hexagon (target/hexagon) Only pass env to generated helper when needed

2024-02-13 Thread Taylor Simpson
Currently, we pass env to every generated helper. When the semantics of the instruction only depend on the arguments, this is unnecessary and adds extra overhead to the helper call. Changes in v3 Update copyright year to 2024 Mark Reviewed-by/Tested-by: Anton Johansson Changes

[PATCH v3 2/3] Hexagon (target/hexagon) Pass SP explicitly to helpers that need it

2024-02-13 Thread Taylor Simpson
Rather than reading SP from the env, pass it explicitly Signed-off-by: Taylor Simpson Reviewed-by: Anton Johansson Tested-by: Anton Johansson --- target/hexagon/macros.h | 2 +- target/hexagon/attribs_def.h.inc | 3 ++- target/hexagon/hex_common.py | 11 +++ 3 files

[PATCH v3 3/3] Hexagon (target/hexagon) Only pass env to generated helper when needed

2024-02-13 Thread Taylor Simpson
Currently, we pass env to every generated helper. When the semantics of the instruction only depend on the arguments, this is unnecessary and adds extra overhead to the helper call. We add the TCG_CALL_NO_RWG_SE flag to any non-HVX helpers that don't get the ptr to env. The A2_nop and

Re: [External] [PATCH v2 05/23] migration/multifd: Drop MultiFDSendParams.normal[] array

2024-02-13 Thread Hao Xiang
On Fri, Feb 9, 2024 at 4:20 AM Fabiano Rosas wrote: > > Hao Xiang writes: > > > On Fri, Feb 2, 2024 at 2:30 AM wrote: > >> > >> From: Peter Xu > >> > >> This array is redundant when p->pages exists. Now we extended the life of > >> p->pages to the whole period where pending_job is set, it

[PULL 0/2] tcg patch queue

2024-02-13 Thread Richard Henderson
at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240213 for you to fetch changes up to e41f1825b43796c3508ef309ed0b150ef89acc44: tcg/arm: Fix goto_tb for large translation blocks (2024-02-13 07:42:45 -1000) tcg: Increase

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Aaro Koskinen
Hi, On Tue, Feb 13, 2024 at 09:11:38PM +0100, Arnd Bergmann wrote: > On Tue, Feb 13, 2024, at 16:36, Guenter Roeck wrote: > >> > > OMAP1 machines: > >> > > > >> > > cheetah Palm Tungsten|E aka. Cheetah PDA (OMAP310) > >> > > sx1 Siemens SX1 (OMAP310) V2 > >> > >

[PATCH 1/2] tcg: Increase width of temp_subindex

2024-02-13 Thread Richard Henderson
We need values 0-3 for TCG_TYPE_I128 on 32-bit hosts. Cc: qemu-sta...@nongnu.org Fixes: 43eef72f4109 ("tcg: Add temp allocation for TCGv_i128") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2159 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael

[PATCH 0/2] tcg patch queue

2024-02-13 Thread Richard Henderson
The following changes since commit bc2e8b18fba33f30f25b7c2d74328493c0a2231d: Merge tag 'hppa64-pull-request' of https://github.com/hdeller/qemu-hppa into staging (2024-02-13 13:56:46 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240213

[PATCH 2/2] tcg/arm: Fix goto_tb for large translation blocks

2024-02-13 Thread Richard Henderson
Correct arithmetic for separating high and low on a large negative number. Cc: qemu-sta...@nongnu.org Fixes: 79ffece4447 ("tcg/arm: Implement direct branch for goto_tb") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1714 Signed-off-by: Richard Henderson Reviewed-by: Michael Tokarev

Re: [PATCH v15 0/9] rutabaga_gfx + gfxstream

2024-02-13 Thread Gurchetan Singh
On Tue, Jan 30, 2024 at 7:10 PM Gurchetan Singh wrote: > > > On Fri, Jan 26, 2024 at 6:23 AM Alyssa Ross wrote: > >> Gurchetan Singh writes: >> >> > On Sat, Jan 20, 2024 at 4:19 AM Alyssa Ross wrote: >> > >> >> Gurchetan Singh writes: >> >> >> >> > On Fri, Jan 19, 2024 at 1:13 PM Alyssa Ross

Re: [PATCH v3 29/33] linux-user: Allow TARGET_PAGE_BITS_VARY

2024-02-13 Thread Richard Henderson
On 1/30/24 03:47, Ilya Leoshkevich wrote: I wonder if it would make sense to add something like the following to this patch? --- a/page-vary-target.c +++ b/page-vary-target.c @@ -26,8 +26,7 @@ bool set_preferred_target_page_bits(int bits) { #ifdef TARGET_PAGE_BITS_VARY -assert(bits >=

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Linus Walleij
On Tue, Feb 13, 2024 at 9:12 PM Arnd Bergmann wrote: > On Tue, Feb 13, 2024, at 16:36, Guenter Roeck wrote: > > On Tue, Feb 13, 2024 at 03:14:21PM +, Peter Maydell wrote: > >> On Mon, 12 Feb 2024 at 14:36, Guenter Roeck wrote: > >> > On 2/12/24 04:32, Peter Maydell wrote: > >> > > The one

Re: [PATCH 3/3] monitor: only run coroutine commands in qemu_aio_context

2024-02-13 Thread Stefan Hajnoczi
On Sat, 3 Feb 2024 at 06:30, Michael Tokarev wrote: > > 03.02.2024 12:01, Michael Tokarev wrote: > ... > > This change broke something in 7.2. I'm still debugging it, will > > come with a follow-up once some more details are found, I'll also > > check current master with and without this commit.

[PULL 62/88] esp.c: zero command register when TI command terminates due to phase change

2024-02-13 Thread Mark Cave-Ayland
This is the behaviour documented in the datasheet and allows the state machine to correctly process multiple consecutive TI commands. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-63-mark.cave-ayl...@ilande.co.uk>

[PULL 60/88] esp.c: use deferred interrupts for both DATA IN and DATA OUT phases

2024-02-13 Thread Mark Cave-Ayland
This brings DATA OUT transfers in line with DATA IN transfers by ensuring that the guest visible function complete interrupt is only set once the SCSI layer has returned. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 73/88] esp.c: remove restriction on FIFO read access when DMA memory routines defined

2024-02-13 Thread Mark Cave-Ayland
The latest state machines can handle mixing DMA and non-DMA FIFO access for all SCSI phases except DATA IN and DATA OUT. For DATA IN and DATA OUT phases, the transfer is complete when TC == 0 and the updated logic will now handle TC underflow correctly, which makes it just about impossible to

[PULL 66/88] esp.c: process non-DMA FIFO writes in esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
Currently any write to the ESP FIFO in the MESSAGE OUT or COMMAND phases will manually raise the bus service interrupt. Instead of duplicating the interrupt logic in esp_reg_write(), update esp_do_nodma() to correctly process incoming FIFO data during the MESSAGE OUT and COMMAND phases. Part of

[PULL 52/88] esp.c: move CMD_SELATNS end of command logic to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The special logic in satn_stop_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-53-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark

[PULL 87/88] esp.c: switch TypeInfo registration to use DEFINE_TYPES() macro

2024-02-13 Thread Mark Cave-Ayland
The use of the DEFINE_TYPES() macro will soon be recommended over the use of calling type_init() directly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240112125420.514425-88-mark.cave-ayl...@ilande.co.uk>

Re: [PATCH v4 11/12] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-13 Thread Mark Cave-Ayland
On 13/02/2024 13:03, Philippe Mathieu-Daudé wrote: Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Note that with the previous new patch included in the series, qdev_init_gpio_in_named_with_opaque() should be replaced by

Re: [PATCH v4 10/12] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in()

2024-02-13 Thread Mark Cave-Ayland
On 13/02/2024 13:03, Philippe Mathieu-Daudé wrote: By passing a DeviceState context to a QDev IRQ handler, we can simplify and use qdev_init_gpio_in_named() instead of qdev_init_gpio_in_named_with_opaque(). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé ---

Re: possible deprecation and removal of some old QEMU Arm machine types (pxa2xx, omap, sa1110)

2024-02-13 Thread Arnd Bergmann
On Tue, Feb 13, 2024, at 16:36, Guenter Roeck wrote: > On Tue, Feb 13, 2024 at 03:14:21PM +, Peter Maydell wrote: >> On Mon, 12 Feb 2024 at 14:36, Guenter Roeck wrote: >> > On 2/12/24 04:32, Peter Maydell wrote: >> > > The machines I have in mind are: >> > > >> > > PXA2xx machines: >> > > >>

[PULL 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
This moves the remaining non-DMA STATUS and MESSAGE IN phase logic from write_response() to esp_do_nodma(). Note that we can also now drop the extra fifo_reset() which is no longer required. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 86/88] esp.c: keep track of the DRQ state during DMA

2024-02-13 Thread Mark Cave-Ayland
Currently the DRQ IRQ is updated every time DMA data is sent/received which is both inefficient and causes excessive logging of the DRQ state. Add a new drq_state bool that only updates the DRQ IRQ if its state changes. This commit adds the new drq_state bool to the migration state: since the

[PULL 53/88] esp.c: replace do_dma_pdma_cb() with esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
Now that the DMA logic is identical between do_dma_pdma_cb() and esp_do_dma() we can replace do_dma_pdma_cb() with esp_do_dma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-54-mark.cave-ayl...@ilande.co.uk> Signed-off-by:

[PULL 80/88] esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 58/88] esp.c: separate logic based upon ESP command in esp_command_complete()

2024-02-13 Thread Mark Cave-Ayland
The handling of the INTR_FC and INTR_BS bits is different depending upon the last command executed by the ESP. Note that currently INTR_FC is managed elsewhere, but that will change soon. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 75/88] esp.c: improve ESP_RSEQ logic consolidation

2024-02-13 Thread Mark Cave-Ayland
The ESP_RSEQ logic is scattered in a few places throughout the ESP state machine which is mainly because the ESP_RSEQ register isn't always reset when executing an ESP select command. Once this is done, the ESP_RSEQ register only needs to be updated at the point where the sequencer command

[PULL 56/88] esp.c: remove unused PDMA callback implementation

2024-02-13 Thread Mark Cave-Ayland
Note that this is a migration break for the q800 machine because the extra PDMA information is no longer included. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-57-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland

[PULL 85/88] esp.c: rename irq_data IRQ to drq_irq

2024-02-13 Thread Mark Cave-Ayland
The IRQ represented by irq_data is actually the DRQ (DMA request) line so rename it accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-86-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland ---

[PULL 65/88] esp.c: move non-DMA TI logic to separate esp_nodma_ti_dataout() function

2024-02-13 Thread Mark Cave-Ayland
This is to allow the logic to be moved during the next commit. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-66-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 51

[PULL 72/88] esp.c: handle TC underflow for DMA SCSI requests

2024-02-13 Thread Mark Cave-Ayland
Detect the case where the guest underflows TC by requesting a DMA transfer which is larger than the available data. If this case is detected, immediately complete the SCSI request and handle any remaining FIFO accesses in the STATUS phase by raising INTR_BS once the FIFO is below the threshold.

[PULL 76/88] esp.c: only transfer non-DMA COMMAND phase data for specific commands

2024-02-13 Thread Mark Cave-Ayland
The contents of the FIFO should only be copied to cmdfifo for ESP commands that are sending data to the SCSI bus, which are the SEL_* commands and the TI command. Otherwise any incoming data should be held in the FIFO as normal. This fixes booting of really old 32-bit SPARC Linux kernels such as

[PULL 74/88] esp.c: handle non-DMA FIFO writes used to terminate DMA commands

2024-02-13 Thread Mark Cave-Ayland
Certain versions of MacOS send the first 5 bytes of the CDB using DMA and then send the last byte of the CDB by writing to the FIFO. Update the non-DMA state machine to detect the end of the CDB and execute the SCSI command using similar logic as that which already exists for transferring the

[PULL 61/88] esp.c: remove DATA IN phase logic when reading from FIFO

2024-02-13 Thread Mark Cave-Ayland
Whilst the FIFO is used a storage buffer for both DMA and non-DMA requests, the loading and unloading is managed directly issuing commands to the ESP. As a result there is no need to manually invoke the non-DMA command handler. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by:

[PULL 59/88] esp.c: separate logic based upon ESP command in esp_transfer_data()

2024-02-13 Thread Mark Cave-Ayland
The handling of the INTR_FC and INTR_BS bits is different depending upon the last command executed by the ESP. Note that currently INTR_FC is managed elsewhere, but that will change soon. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 50/88] esp.c: move CMD_TI end of message phase detection to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The existing check for TC == 0 is only valid during a TI command. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-51-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 32

[PULL 77/88] esp.c: only transfer non-DMA MESSAGE OUT phase data for specific commands

2024-02-13 Thread Mark Cave-Ayland
The contents of the FIFO should only be copied to cmdfifo for ESP commands that are sending data to the SCSI bus, which are the SEL_* commands and the TI command. Otherwise any incoming data should be held in the FIFO as normal. This fixes booting of NetBSD m68k under the Q800 machine once again.

[PULL 55/88] esp.c: always use esp_do_dma() in pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
There is now only a single implementation contained within esp_do_dma() so call it directly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-56-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c |

[PULL 84/88] esp.c: implement DMA Transfer Pad command for DATA phases

2024-02-13 Thread Mark Cave-Ayland
The Transfer Pad command is used to either drop incoming FIFO data during the DATA IN phase or generate a series of zero bytes in the FIFO during the DATA OUT phase. Implement the DMA Transfer Pad command for the DATA phases which is used by the NeXTCube firmware in the DATA IN phase to ignore

[PULL 82/88] esp.c: consolidate DMA and PDMA logic in STATUS and MESSAGE IN phases

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 71/88] esp.c: don't clear the SCSI phase when reading ESP_RINTR

2024-02-13 Thread Mark Cave-Ayland
According to the documentation ESP_RSTAT is cleared (except the STAT_TC bit) when ESP_RINTR is read. This should not include the SCSI bus phase bits which are currently live from the SCSI bus, otherwise the current SCSI phase is lost when clearing an end-of-transfer interrupt. Signed-off-by: Mark

[PULL 83/88] esp.c: replace n variable with len in esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
This brings esp_do_nodma() in line with esp_do_dma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-84-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 40

[PULL 67/88] esp.c: replace get_cmd() with esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
Now that the esp_do_nodma() state machine correctly handles incoming FIFO data, all remaining users of get_cmd() can be replaced with esp_do_nodma() and the get_cmd() function removed completely. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 88/88] esp.c: add my copyright to the file

2024-02-13 Thread Mark Cave-Ayland
This series has involved rewriting and/or updating a considerable part of the ESP emulation so update the copyright in esp.c to reflect this. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-89-mark.cave-ayl...@ilande.co.uk>

[PULL 57/88] esp.c: rename data_in_ready to to data_ready

2024-02-13 Thread Mark Cave-Ayland
This field is currently used to handle deferred interrupts for the DATA IN phase but the code will soon be updated to do the same for the DATA OUT phase. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 51/88] esp.c: don't use get_cmd() for CMD_SEL DMA commands

2024-02-13 Thread Mark Cave-Ayland
This can now be done using the existing logic in esp_do_dma() and do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-52-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 22

[PULL 63/88] esp.c: remove unneeded ti_cmd field

2024-02-13 Thread Mark Cave-Ayland
According to the datasheet the previous ESP command remains in the ESP_CMD register, which caused a problem when consecutive TI commands were issued as it becomes impossible for the state machine to know when the first TI command finishes. This was the original reason for introducing the ti_cmd

[PULL 81/88] esp.c: remove redundant n variable in PDMA COMMAND phase

2024-02-13 Thread Mark Cave-Ayland
This variable can be replaced by the existing len variable. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-82-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 8 +++- 1 file changed, 3

[PULL 79/88] esp.c: consolidate DMA and PDMA logic in DATA IN phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

[PULL 54/88] esp.c: move CMD_ICCS command logic to esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
The special logic in write_response_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-55-mark.cave-ayl...@ilande.co.uk> Signed-off-by:

[PULL 64/88] esp.c: don't raise INTR_BS interrupt in DATA IN phase until TI command issued

2024-02-13 Thread Mark Cave-Ayland
In the case where a SCSI command with a DATA IN phase has been issued, the host may preload the FIFO with unaligned bytes before issuing the main DMA transfer. When accumulating data in the FIFO don't raise the INTR_BS interrupt until the TI command is issued, otherwise the unexpected interrupt

[PULL 70/88] esp.c: ensure that STAT_INT is cleared when reading ESP_RINTR

2024-02-13 Thread Mark Cave-Ayland
Both esp_raise_irq() and esp_lower_irq() check the STAT_INT bit in ESP_RSTAT to ensure that the IRQ is raised or lowered if its state changes. When reading ESP_RINTR, esp_lower_irq() was being called *after* ESP_RSTAT had been cleared meaning that STAT_INT was already clear, and so if STAT_INT was

[PULL 69/88] esp.c: consolidate end of command sequence after ICCS command

2024-02-13 Thread Mark Cave-Ayland
The end of command sequences for the ICCS command are currently different between the DMA and non-DMA versions, and also different from the description in the datasheet. Update the sequence so that only INTR_FC is asserted in both cases, and keep all the logic in esp_do_dma() and esp_do_nodma()

[PULL 78/88] esp.c: consolidate DMA and PDMA logic in DATA OUT phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id:

Re: [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g

2024-02-13 Thread Richard Henderson
On 1/29/24 05:26, Ilya Leoshkevich wrote: On Tue, Jan 02, 2024 at 12:57:57PM +1100, Richard Henderson wrote: Work much harder to get alignment and mapping beyond the end of the file correct. Both of which are excercised by our test-mmap for alpha (8k pages) on any 4k page host. Signed-off-by:

Re: [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g

2024-02-13 Thread Richard Henderson
On 1/29/24 05:26, Ilya Leoshkevich wrote: On Tue, Jan 02, 2024 at 12:57:57PM +1100, Richard Henderson wrote: Work much harder to get alignment and mapping beyond the end of the file correct. Both of which are excercised by our test-mmap for alpha (8k pages) on any 4k page host. Signed-off-by:

Re: [PATCH v3 21/33] linux-user: Split out mmap_h_eq_g

2024-02-13 Thread Richard Henderson
On 1/29/24 05:12, Ilya Leoshkevich wrote: On Tue, Jan 02, 2024 at 12:57:56PM +1100, Richard Henderson wrote: Move the MAX_FIXED_NOREPLACE check for reserved_va earlier. Move the computation of host_prot earlier. Signed-off-by: Richard Henderson --- linux-user/mmap.c | 66

[PULL 49/88] esp.c: move CMD_SELATN end of message phase detection to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The special logic in satn_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-50-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark

  1   2   3   4   >