Re: [PATCH v3] hw/audio/virtio-snd: Use device endianness instead of target one

2024-04-24 Thread Mark Cave-Ayland
On 23/04/2024 12:05, Philippe Mathieu-Daudé wrote: On 23/4/24 11:18, Manos Pitsidianakis wrote: On Tue, 23 Apr 2024 at 11:47, Manos Pitsidianakis wrote: On Tue, 23 Apr 2024 at 00:11, Michael S. Tsirkin wrote: On Mon, Apr 22, 2024 at 11:07:21PM +0200, Philippe Mathieu-Daudé wrote: On

Re: [PATCH] target/i386/translate.c: always write 32-bits for SGDT and SIDT

2024-04-23 Thread Mark Cave-Ayland
On 23/04/2024 10:18, Paolo Bonzini wrote: On Mon, Apr 22, 2024 at 9:10 PM Volker Rümelin wrote: Am 20.04.24 um 07:40 schrieb Mark Cave-Ayland: Current documentation agrees that all 32 bits are written, so I don't think you need this comment: Ah that's good to know the docs are now correct

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-19 Thread Mark Cave-Ayland
On 20/04/2024 00:14, Brad Smith wrote: On 2024-04-18 4:27 p.m., Mark Cave-Ayland wrote: On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed

Re: [PATCH] target/i386/translate.c: always write 32-bits for SGDT and SIDT

2024-04-19 Thread Mark Cave-Ayland
On 20/04/2024 02:21, Richard Henderson wrote: On 4/19/24 12:51, Mark Cave-Ayland wrote: The various Intel CPU manuals claim that SGDT and SIDT can write either 24-bits or 32-bits depending upon the operand size, but this is incorrect. Not only do the Intel CPU manuals give contradictory

[PATCH] target/i386/translate.c: always write 32-bits for SGDT and SIDT

2024-04-19 Thread Mark Cave-Ayland
matches the behaviour on real hardware. Signed-off-by: Mark Cave-Ayland Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2198 -- MCA: Whilst I don't have a copy of OS/2 Warp handy, I've confirmed that this patch fixes the issue in WFW 3.11 with Win32s. For more technical information I highly

Re: [PATCH v2 3/4] docs/system/target-sparc: Improve the Sparc documentation

2024-04-19 Thread Mark Cave-Ayland
Solaris. Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-18 Thread Mark Cave-Ayland
On 19/04/2024 05:59, Thomas Huth wrote: On 18/04/2024 22.27, Mark Cave-Ayland wrote: On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed

[PATCH] hw/sparc64: set iommu_platform=on for virtio devices attached to the sun4u machine

2024-04-18 Thread Mark Cave-Ayland
virtio driver where this is not the case. Set the sun4u machine defaults for all virtio devices so that disable-legacy=on and iommu_platform=on to ensure a default configuration will allow virtio devices to function correctly on both Linux and NetBSD. Signed-off-by: Mark Cave-Ayland --- hw/sparc64

Re: [PATCH 0/5] Sparc CPU naming and help text improvements

2024-04-18 Thread Mark Cave-Ayland
On 18/04/2024 21:08, Mark Cave-Ayland wrote: On 15/04/2024 08:26, Thomas Huth wrote: On 07/03/2024 18.43, Thomas Huth wrote: The Sparc CPU naming and the corresponding help text is somewhat confusing for the users. We should avoid spaces in the Names and provide clear information

Re: [PATCH 5/5] docs/about: Deprecate the old "UltraSparc" CPU names that contain a "+"

2024-04-18 Thread Mark Cave-Ayland
''' See my previous comment about the CPU names, otherwise: Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 4/5] docs/system/target-sparc: Improve the Sparc documentation

2024-04-18 Thread Mark Cave-Ayland
On 07/03/2024 17:43, Thomas Huth wrote: Add some words about how to enable or disable boolean features, and remove the note about a Linux kernel being available on the QEMU website (they have been removed long ago already). Signed-off-by: Thomas Huth --- docs/system/target-sparc.rst | 8

Re: [PATCH 0/5] Sparc CPU naming and help text improvements

2024-04-18 Thread Mark Cave-Ayland
On 15/04/2024 08:26, Thomas Huth wrote: On 07/03/2024 18.43, Thomas Huth wrote: The Sparc CPU naming and the corresponding help text is somewhat confusing for the users. We should avoid spaces in the Names and provide clear information to the users what can be passed to the "-cpu" option.

Re: [PATCH 1/5] target/sparc/cpu: Rename the CPU models with a "+" in their names

2024-04-18 Thread Mark Cave-Ayland
ocessors in the form "UltraSparc IIIi plus" so I'd be inclined to use that form for the new type names e.g. "UltraSparc-IIIi-plus". Otherwise looks good to me, thanks for having a look at this! Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 2/5] target/sparc/cpu: Avoid spaces by default in the CPU names

2024-04-18 Thread Mark Cave-Ayland
sparc_defs[] = { .features = CPU_DEFAULT_FEATURES, }, { -.name = "TI SuperSparc 60", /* STP1020APGA */ +.name = "TI-SuperSparc-60", /* STP1020APGA */ .iu_version = 0x4000, /* SuperSPARC 3.x */ .fpu_version = 0 << FSR_VER_SHIFT, .mmu_version = 0x01000800, /* SuperSPARC 3.x, no MXCC */ @@ -484,7 +484,7 @@ static const sparc_def_t sparc_defs[] = { .features = CPU_DEFAULT_FEATURES, }, { -.name = "TI SuperSparc 61", +.name = "TI-SuperSparc-61", .iu_version = 0x4400, /* SuperSPARC 3.x */ .fpu_version = 0 << FSR_VER_SHIFT, .mmu_version = 0x0100, /* SuperSPARC 3.x, MXCC */ @@ -498,7 +498,7 @@ static const sparc_def_t sparc_defs[] = { .features = CPU_DEFAULT_FEATURES, }, { -.name = "TI SuperSparc II", +.name = "TI-SuperSparc-II", .iu_version = 0x4000, /* SuperSPARC II 1.x */ .fpu_version = 0 << FSR_VER_SHIFT, .mmu_version = 0x0800, /* SuperSPARC II 1.x, MXCC */ Thanks Thomas, this looks much better! Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH] target/sparc: Use GET_ASI_CODE for ASI_KERNELTXT and ASI_USERTXT

2024-04-12 Thread Mark Cave-Ayland
d(); +#endif + default: /* ??? In theory we've handled all of the ASIs that are valid for ldda, and this should raise DAE_invalid_asi. However, Thanks for the excellent analysis, and also thanks to Richard for improving the correctness of the patch: Acked-by: Mark Cave-Ayland ATB, Mark.

[PULL 07/17] esp.c: use esp_fifo_push() instead of fifo8_push()

2024-04-04 Thread Mark Cave-Ayland
There are still a few places that use fifo8_push() instead of esp_fifo_push() in order to push a value into the FIFO. Update those places to use esp_fifo_push() instead. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id

[PULL 08/17] esp.c: change esp_fifo_pop_buf() to take ESPState

2024-04-04 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop_buf() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-9-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 13/17] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file

2024-04-04 Thread Mark Cave-Ayland
This allows these functions to be used earlier in the file without needing a separate forward declaration. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-14-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 15/17] esp.c: update esp_fifo_{push, pop}() to call esp_update_drq()

2024-04-04 Thread Mark Cave-Ayland
This ensures that the DRQ line is always set correctly when reading/writing single bytes to/from the FIFO. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-16-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 17/17] esp.c: remove explicit setting of DRQ within ESP state machine

2024-04-04 Thread Mark Cave-Ayland
Now the esp_update_drq() is called for all reads/writes to the FIFO, there is no need to manually raise and lower the DRQ signal. Signed-off-by: Mark Cave-Ayland Resolves: https://gitlab.com/qemu-project/qemu/-/issues/611 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1831 Reviewed

[PULL 10/17] esp.c: don't assert() if FIFO empty when executing non-DMA SELATNS

2024-04-04 Thread Mark Cave-Ayland
The current logic assumes that at least 1 byte is present in the FIFO when executing a non-DMA SELATNS command, but this may not be the case if the guest executes an invalid ESP command sequence. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Reviewed

[PULL 03/17] esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf() in do_message_phase()

2024-04-04 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_message_phase() use the underlying esp_fifo8_pop_buf() function directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu

[PULL 16/17] esp.c: ensure esp_pdma_write() always calls esp_fifo_push()

2024-04-04 Thread Mark Cave-Ayland
This ensures that esp_update_drq() is called via esp_fifo_push() whenever the host uses PDMA to transfer data to a SCSI device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-17-mark.cave-ayl...@ilande.co

[PULL 02/17] esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf() in do_command_phase()

2024-04-04 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying esp_fifo8_pop_buf() function directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu

[PULL 14/17] esp.c: introduce esp_update_drq() and update esp_fifo_{push, pop}_buf() to use it

2024-04-04 Thread Mark Cave-Ayland
-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-15-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 48 +++- 1 file changed, 47 insertions(+), 1 deletion(-)

[PULL 05/17] esp.c: change esp_fifo_push() to take ESPState

2024-04-04 Thread Mark Cave-Ayland
Now that all users of esp_fifo_push() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-6-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 11/17] esp.c: rework esp_cdb_length() into esp_cdb_ready()

2024-04-04 Thread Mark Cave-Ayland
callers. Suggested-by: Paolo Bonzini Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240324191707.623175-12-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 30 ++-

[PULL 09/17] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO

2024-04-04 Thread Mark Cave-Ayland
Instead of pushing data into the FIFO directly with fifo8_push_all(), add a new esp_fifo_push_buf() function and use it accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-10-mark.cave-

[PULL 01/17] esp.c: move esp_fifo_pop_buf() internals to new esp_fifo8_pop_buf() function

2024-04-04 Thread Mark Cave-Ayland
Update esp_fifo_pop_buf() to be a simple wrapper onto the new esp_fifo8_pop_buf() function. Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240324191707.623175-2-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-

[PULL 12/17] esp.c: prevent cmdfifo overflow in esp_cdb_ready()

2024-04-04 Thread Mark Cave-Ayland
the end of the FIFO data buffer. Add an extra check to fifo8_peek_buf() to ensure that if the cmdfifo has wrapped internally then esp_cdb_ready() will exit rather than allow scsi_cdb_length() to access data outside the cmdfifo data buffer. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland

[PULL 00/17] qemu-sparc queue 20240404

2024-04-04 Thread Mark Cave-Ayland
by fuzzing (with thanks to Chuhong Yuan ) Mark Cave-Ayland (17): esp.c: move esp_fifo_pop_buf() internals to new esp_fifo8_pop_buf() function esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf() in do_command_phase

[PULL 06/17] esp.c: change esp_fifo_pop() to take ESPState

2024-04-04 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-7-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 04/17] esp.c: replace cmdfifo use of esp_fifo_pop() in do_message_phase()

2024-04-04 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paolo Bonzini Message-Id: <20240324191707.623175-5-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/h

Re: [PATCH v3 00/17] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine

2024-04-04 Thread Mark Cave-Ayland
On 04/04/2024 11:28, Philippe Mathieu-Daudé wrote: Hi Mark, On 24/3/24 20:16, Mark Cave-Ayland wrote: Mark Cave-Ayland (17):    esp.c: move esp_fifo_pop_buf() internals to new esp_fifo8_pop_buf() function    esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf

Re: [PATCH-for-9.0 v2] hw/i386/pc: Deprecate 64-bit CPUs on ISA-only PC machine

2024-03-28 Thread Mark Cave-Ayland
warn that way? FWIW I'd be amazed if anyone were actually overriding the default and trying to do this, but I guess that's what the warn_report() is for anyhow: Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-28 Thread Mark Cave-Ayland
On 27/03/2024 07:09, Gerd Hoffmann wrote: On Tue, Mar 26, 2024 at 01:30:48PM +, Mark Cave-Ayland wrote: Heh I've actually been using isapc over the past couple of weeks to fire up some old programs in a Windows 3 VM :) I'm wondering why these use cases can't simply use the 'pc' machine

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-26 Thread Mark Cave-Ayland
On 26/03/2024 12:51, Igor Mammedov wrote: ISAPC machine was introduced 25 years ago and it's a lot of time since such machine was around with real ISA only PC hardware practically defunct. Also it's slowly bit-rots (for example: I was able to boot RHEL6 on RHEL9 host in only TCG mode, while in

Re: [PATCH v3 10/17] esp.c: don't assert() if FIFO empty when executing non-DMA SELATNS

2024-03-25 Thread Mark Cave-Ayland
On 25/03/2024 10:49, Philippe Mathieu-Daudé wrote: On 24/3/24 20:16, Mark Cave-Ayland wrote: The current logic assumes that at least 1 byte is present in the FIFO when executing a non-DMA SELATNS command, but this may not be the case if the guest executes an invalid ESP command sequence

Re: [PATCH v3 12/17] esp.c: prevent cmdfifo overflow in esp_cdb_ready()

2024-03-25 Thread Mark Cave-Ayland
On 25/03/2024 10:26, Philippe Mathieu-Daudé wrote: On 24/3/24 20:17, Mark Cave-Ayland wrote: During normal use the cmdfifo will never wrap internally and cmdfifo_cdb_offset will always indicate the start of the SCSI CDB. However it is possible that a malicious guest could issue an invalid ESP

[PATCH v3 10/17] esp.c: don't assert() if FIFO empty when executing non-DMA SELATNS

2024-03-24 Thread Mark Cave-Ayland
The current logic assumes that at least 1 byte is present in the FIFO when executing a non-DMA SELATNS command, but this may not be the case if the guest executes an invalid ESP command sequence. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file

[PATCH v3 02/17] esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf() in do_command_phase()

2024-03-24 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying esp_fifo8_pop_buf() function directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v3 08/17] esp.c: change esp_fifo_pop_buf() to take ESPState

2024-03-24 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop_buf() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH v3 07/17] esp.c: use esp_fifo_push() instead of fifo8_push()

2024-03-24 Thread Mark Cave-Ayland
There are still a few places that use fifo8_push() instead of esp_fifo_push() in order to push a value into the FIFO. Update those places to use esp_fifo_push() instead. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 6 +++--- 1 file changed, 3

[PATCH v3 06/17] esp.c: change esp_fifo_pop() to take ESPState

2024-03-24 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw

[PATCH v3 11/17] esp.c: rework esp_cdb_length() into esp_cdb_ready()

2024-03-24 Thread Mark Cave-Ayland
callers. Suggested-by: Paolo Bonzini Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index f3aa5364cf..f47abc36d6 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c

[PATCH v3 15/17] esp.c: update esp_fifo_{push, pop}() to call esp_update_drq()

2024-03-24 Thread Mark Cave-Ayland
This ensures that the DRQ line is always set correctly when reading/writing single bytes to/from the FIFO. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/scsi/esp.c b

[PATCH v3 16/17] esp.c: ensure esp_pdma_write() always calls esp_fifo_push()

2024-03-24 Thread Mark Cave-Ayland
This ensures that esp_update_drq() is called via esp_fifo_push() whenever the host uses PDMA to transfer data to a SCSI device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH v3 14/17] esp.c: introduce esp_update_drq() and update esp_fifo_{push, pop}_buf() to use it

2024-03-24 Thread Mark Cave-Ayland
This new function sets the DRQ line correctly according to the current transfer mode, direction and FIFO contents. Update esp_fifo_push_buf() and esp_fifo_pop_buf() to use it so that DRQ is always set correctly when reading/writing multiple bytes to/from the FIFO. Signed-off-by: Mark Cave

[PATCH v3 04/17] esp.c: replace cmdfifo use of esp_fifo_pop() in do_message_phase()

2024-03-24 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 9386704a58..5b169b3720 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -315,7 +315,8 @@ static void

[PATCH v3 09/17] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO

2024-03-24 Thread Mark Cave-Ayland
Instead of pushing data into the FIFO directly with fifo8_push_all(), add a new esp_fifo_push_buf() function and use it accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff

[PATCH v3 17/17] esp.c: remove explicit setting of DRQ within ESP state machine

2024-03-24 Thread Mark Cave-Ayland
Now the esp_update_drq() is called for all reads/writes to the FIFO, there is no need to manually raise and lower the DRQ signal. Signed-off-by: Mark Cave-Ayland Resolves: https://gitlab.com/qemu-project/qemu/-/issues/611 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1831 --- hw/scsi

[PATCH v3 03/17] esp.c: replace esp_fifo_pop_buf() with esp_fifo8_pop_buf() in do_message_phase()

2024-03-24 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_message_phase() use the underlying esp_fifo8_pop_buf() function directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v3 12/17] esp.c: prevent cmdfifo overflow in esp_cdb_ready()

2024-03-24 Thread Mark Cave-Ayland
the end of the FIFO data buffer. Add an extra check to fifo8_peek_buf() to ensure that if the cmdfifo has wrapped internally then esp_cdb_ready() will exit rather than allow scsi_cdb_length() to access data outside the cmdfifo data buffer. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland

[PATCH v3 13/17] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file

2024-03-24 Thread Mark Cave-Ayland
This allows these functions to be used earlier in the file without needing a separate forward declaration. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff

[PATCH v3 00/17] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine

2024-03-24 Thread Mark Cave-Ayland
all manual calls to esp_raise_drq() and esp_lower_drq() since the DRQ signal is now updated correctly upon each FIFO read/write access. Signed-off-by: Mark Cave-Ayland v3: - Rebase onto master - Add patch 1 to move the internals of esp_fifo_pop_buf() to a new esp_fifo8_pop_buf() function. T

[PATCH v3 01/17] esp.c: move esp_fifo_pop_buf() internals to new esp_fifo8_pop_buf() function

2024-03-24 Thread Mark Cave-Ayland
Update esp_fifo_pop_buf() to be a simple wrapper onto the new esp_fifo8_pop_buf() function. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 590ff99744..1b7b118a0b 100644 --- a/hw

[PATCH v3 05/17] esp.c: change esp_fifo_push() to take ESPState

2024-03-24 Thread Mark Cave-Ayland
Now that all users of esp_fifo_push() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw

Re: [PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()

2024-03-13 Thread Mark Cave-Ayland
On 13/03/2024 11:03, Philippe Mathieu-Daudé wrote: On 13/3/24 09:57, Mark Cave-Ayland wrote: The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying Fifo8 functions directly. Signed

[PATCH v2 06/16] esp.c: use esp_fifo_push() instead of fifo8_push()

2024-03-13 Thread Mark Cave-Ayland
There are still a few places that use fifo8_push() instead of esp_fifo_push() in order to push a value into the FIFO. Update those places to use esp_fifo_push() instead. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v2 07/16] esp.c: change esp_fifo_pop_buf() to take ESPState

2024-03-13 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop_buf() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH v2 15/16] esp.c: ensure esp_pdma_write() always calls esp_fifo_push()

2024-03-13 Thread Mark Cave-Ayland
This ensures that esp_update_drq() is called via esp_fifo_push() whenever the host uses PDMA to transfer data to a SCSI device. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index

[PATCH v2 16/16] esp.c: remove explicit setting of DRQ within ESP state machine

2024-03-13 Thread Mark Cave-Ayland
Now the esp_update_drq() is called for all reads/writes to the FIFO, there is no need to manually raise and lower the DRQ signal. Signed-off-by: Mark Cave-Ayland Resolves: https://gitlab.com/qemu-project/qemu/-/issues/611 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1831 --- hw/scsi

[PATCH v2 12/16] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file

2024-03-13 Thread Mark Cave-Ayland
This allows these functions to be used earlier in the file without needing a separate forward declaration. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH v2 13/16] esp.c: introduce esp_update_drq() and update esp_fifo_{push, pop}_buf() to use it

2024-03-13 Thread Mark Cave-Ayland
This new function sets the DRQ line correctly according to the current transfer mode, direction and FIFO contents. Update esp_fifo_push_buf() and esp_fifo_pop_buf() to use it so that DRQ is always set correctly when reading/writing multiple bytes to/from the FIFO. Signed-off-by: Mark Cave

[PATCH v2 11/16] esp.c: don't overflow cmdfifo if cmdfifo_cdb_offset >= ESP_CMDFIFO_SZ

2024-03-13 Thread Mark Cave-Ayland
reading past the end of the cmdfifo data in this case. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 0050493e18..05784b3f77 100644 --- a/hw/scsi/esp.c +++ b/hw

[PATCH v2 05/16] esp.c: change esp_fifo_pop() to take ESPState

2024-03-13 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index b898e43e2b..0e42ff50e7

[PATCH v2 14/16] esp.c: update esp_fifo_{push, pop}() to call esp_update_drq()

2024-03-13 Thread Mark Cave-Ayland
This ensures that the DRQ line is always set correctly when reading/writing single bytes to/from the FIFO. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 53a1c7ceaf

[PATCH v2 08/16] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO

2024-03-13 Thread Mark Cave-Ayland
Instead of pushing data into the FIFO directly with fifo8_push_all(), add a new esp_fifo_push_buf() function and use it accordingly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH v2 00/16] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine

2024-03-13 Thread Mark Cave-Ayland
all manual calls to esp_raise_drq() and esp_lower_drq() since the DRQ signal is now updated correctly upon each FIFO read/write access. Signed-off-by: Mark Cave-Ayland v2: - Rebase onto master - Add patches 9-12 to handle FIFO assert()s and cmdfifo overflow as reported by Chuhong Yuan Mark C

[PATCH v2 10/16] esp.c: don't assert() if FIFO empty when executing esp_cdb_length()

2024-03-13 Thread Mark Cave-Ayland
This does not happen during normal usage, but can occur if the guest issues an invalid ESP command sequence. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index

[PATCH v2 03/16] esp.c: replace cmdfifo use of esp_fifo_pop() in do_message_phase()

2024-03-13 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 100560244b..7a24515bb9 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -312,7 +312,8 @@ static void do_message_phase(ESPState *s

[PATCH v2 09/16] esp.c: don't assert() if FIFO empty when executing non-DMA SELATNS

2024-03-13 Thread Mark Cave-Ayland
The current logic assumes that at least 1 byte is present in the FIFO when executing a non-DMA SELATNS command, but this may not be the case if the guest executes an invalid ESP command sequence. Reported-by: Chuhong Yuan Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file

[PATCH v2 04/16] esp.c: change esp_fifo_push() to take ESPState

2024-03-13 Thread Mark Cave-Ayland
Now that all users of esp_fifo_push() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 7a24515bb9

[PATCH v2 02/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase()

2024-03-13 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_message_phase() use the underlying Fifo8 functions directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH v2 01/16] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()

2024-03-13 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying Fifo8 functions directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH] target/i386: fix direction of "32-bit MMU" test

2024-03-11 Thread Mark Cave-Ayland
above 4G. Analyzed-by: Mark Cave-Ayland Fixes: b1661801c18 ("target/i386: Fix physical address truncation", 2024-02-28) Cc: qemu-sta...@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2206 Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 2 +- target/i386/cpu.c

[PATCH] sun4u: remap ebus BAR0 to use unassigned_io_ops instead of alias to PCI IO space

2024-03-11 Thread Mark Cave-Ayland
ch allows these accesses to succeed and so allows OpenBSD to boot once again. Fixes: 4aa07e8649 ("hw/sparc64/ebus: Access memory regions via pci_address_space_io()") Signed-off-by: Mark Cave-Ayland --- [MCA: I'd like to merge this for 9.0 since I've been carrying various local workarou

Re: [PATCH 3/7] scripts/nsis.py: Automatically package required DLLs of QEMU executables

2024-03-10 Thread Mark Cave-Ayland
On 26/02/2024 06:30, Stefan Weil via wrote: Am 26.02.24 um 05:35 schrieb Bin Meng: On Mon, Feb 26, 2024 at 1:37 AM Stefan Weil wrote: Am 10.09.22 um 02:37 schrieb Bin Meng: On Sat, Sep 10, 2022 at 12:49 AM Mark Cave-Ayland wrote: On 08/09/2022 14:28, Bin Meng wrote: From: Bin Meng

Re: [PATCH] virt: set the CPU type in BOOTINFO

2024-03-07 Thread Mark Cave-Ayland
QEMU_VERSION, Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 00/41] target/sparc: Implement VIS4

2024-03-05 Thread Mark Cave-Ayland
On 02/03/2024 05:15, Richard Henderson wrote: I whipped this up over the Christmas break, but I'm just now getting around to posting. I have not attempted to model the newer cpus that have these features, but it is possible to enable the features manually via -cpu properties. Possibly the

[PATCH] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine

2024-03-03 Thread Mark Cave-Ayland
was unable to find any regressions from this change. Signed-off-by: Mark Cave-Ayland --- hw/ppc/mac_newworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3e796d2f6d..ff9e490c4e 100644 --- a/hw/ppc/mac_newworld.c ++

Re: [PATCH] target/m68k: Fix exception frame format for 68010

2024-02-22 Thread Mark Cave-Ayland
On 22/02/2024 13:37, Peter Maydell wrote: On Thu, 22 Feb 2024 at 13:34, Mark Cave-Ayland wrote: This is also: Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2164 "Resolves:" for gitlab bug URLs; "Fixes:" is for git commits. I think GitLab will happily accept eit

Re: [PATCH] target/m68k: Fix exception frame format for 68010

2024-02-22 Thread Mark Cave-Ayland
On 22/02/2024 09:57, Thomas Huth wrote: On 15/01/2024 11.16, Daniel Palmer wrote:  From the 68010 a word with the frame format and exception vector are placed on the stack before the PC and SR. M68K_FEATURE_QUAD_MULDIV is currently checked to workout if to do this or not for the configured CPU

Re: [PATCH v2 0/7] hw/ide: Clean up hw/ide/qdev.c and include/hw/ide/internal.h

2024-02-21 Thread Mark Cave-Ayland
s like a good tidy-up to me so: Acked-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-21 Thread Mark Cave-Ayland
On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the PIIX and ICH south bridges, so instantiate it there. The isapc machine now needs to instantiate it explicitly, analoguous to the RTC. Note that due to migration compatibility, port92 is optional in the south

Re: [PATCH 00/10] reset: Make whole system three-phase-reset aware

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 16:06, Peter Maydell wrote: This patchset is an incremental improvement to our reset handling that tries to roll out the "three-phase-reset" design we have for devices to a wider scope. At the moment devices and buses have a three-phase reset system, with separate 'enter', 'hold'

Re: [PATCH 1/5] hw/isa/meson.build: Sort alphabetically

2024-02-21 Thread Mark Cave-Ayland
s.add(when: 'CONFIG_FDC37M81X', if_true: files('fdc37m81x-superio.c')) system_ss.add(when: 'CONFIG_SMC37C669', if_true: files('smc37c669-superio.c')) system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c')) Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-21 Thread Mark Cave-Ayland
On 19/02/2024 13:35, Peter Maydell wrote: On Mon, 19 Feb 2024 at 13:33, Mark Cave-Ayland wrote: On 19/02/2024 13:05, Peter Maydell wrote: On Mon, 19 Feb 2024 at 12:49, Mark Cave-Ayland wrote: On 19/02/2024 12:00, BALATON Zoltan wrote: For new people trying to contribute to QEMU QDev

Re: [RFC PATCH 0/2] hw: Replace cpu_interrupt() calls by qemu_irq(QDev GPIO)

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 19:26, Philippe Mathieu-Daudé wrote: Hi, cpu_interrupt() doesn't scale well with heterogenous machines because its mask is target specific (defined in target/ARCH/cpu.h). While it is (often...) used by target-specific hw to notify cpu, there is no restriction to use such

Re: [PATCH 2/5] hw/i386/port92: Allow for TYPE_PORT92 to be embedded in devices

2024-02-21 Thread Mark Cave-Ayland
-events @@ -10,6 +10,10 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" +# port92.c +port92_read(uint8_t val) "port92: read 0x%02x" +port92_write(uint8_t val) "port92: write 0x%02x" + # apm.c apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x" Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-19 Thread Mark Cave-Ayland
On 19/02/2024 13:05, Peter Maydell wrote: On Mon, 19 Feb 2024 at 12:49, Mark Cave-Ayland wrote: On 19/02/2024 12:00, BALATON Zoltan wrote: For new people trying to contribute to QEMU QDev is overwhelming so having some way to need less of it to do simple things would help them to get

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-19 Thread Mark Cave-Ayland
On 19/02/2024 12:00, BALATON Zoltan wrote: On Mon, 19 Feb 2024, Philippe Mathieu-Daudé wrote: On 19/2/24 12:27, BALATON Zoltan wrote: On Mon, 19 Feb 2024, Philippe Mathieu-Daudé wrote: On 16/2/24 20:54, Philippe Mathieu-Daudé wrote: On 16/2/24 18:14, BALATON Zoltan wrote: On Fri, 16 Feb

[PATCH 07/13] esp.c: change esp_fifo_pop_buf() to take ESPState

2024-02-16 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop_buf() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH 09/13] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file

2024-02-16 Thread Mark Cave-Ayland
This allows these functions to be used earlier in the file without needing a separate forward declaration. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH 03/13] esp.c: replace cmdfifo use of esp_fifo_pop() in do_message_phase()

2024-02-16 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 100560244b..7a24515bb9 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -312,7 +312,8 @@ static void do_message_phase(ESPState *s

[PATCH 05/13] esp.c: change esp_fifo_pop() to take ESPState

2024-02-16 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index b898e43e2b..0e42ff50e7

[PATCH 00/13] esp: avoid explicit setting of DRQ within ESP state machine

2024-02-16 Thread Mark Cave-Ayland
nal is now updated correctly upon each FIFO read/write access. Signed-off-by: Mark Cave-Ayland Mark Cave-Ayland (13): esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase() esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase() esp.c: replace cmdfifo use of es

[PATCH 12/13] esp.c: ensure esp_pdma_write() always calls esp_fifo_push()

2024-02-16 Thread Mark Cave-Ayland
This ensures that esp_update_drq() is called via esp_fifo_push() whenever the host uses PDMA to transfer data to a SCSI device. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index

[PATCH 08/13] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO

2024-02-16 Thread Mark Cave-Ayland
Instead of pushing data into the FIFO directly with fifo8_push_all(), add a new esp_fifo_push_buf() function and use it accordingly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH 06/13] esp.c: use esp_fifo_push() instead of fifo8_push()

2024-02-16 Thread Mark Cave-Ayland
There are still a few places that use fifo8_push() instead of esp_fifo_push() in order to push a value into the FIFO. Update those places to use esp_fifo_push() instead. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

  1   2   3   4   5   6   7   8   9   10   >