Re: [PATCH v2 0/3] PIIX3-IDE XEN cleanup

2022-05-28 Thread Bernhard Beschow
Am 13. Mai 2022 18:09:54 UTC schrieb Bernhard Beschow : >v2: >* Have pci_xen_ide_unplug() return void (Paul Durrant) >* CC Xen maintainers (Michael S. Tsirkin) > >v1: >This patch series first removes the redundant "piix3-ide-xen" device class and >then moves a XEN-specific helper function from PIIX

[PATCH 3/4] piix_ide_reset: Use pci_set_* functions instead of direct access

2022-05-28 Thread Lev Kujawski
Eliminates the remaining TODOs in hw/ide/piix.c by: - Using pci_set_{size} functions to write the PIIX PCI configuration space instead of manipulating it directly as an array; and - Documenting default register values by reference to the controlling specification. Signed-off-by: Lev Kujawski

[PATCH 4/4] hw/ide/piix: Ignore writes of hardwired PCI command register bits

2022-05-28 Thread Lev Kujawski
One method to enable PCI bus mastering for IDE controllers, often used by x86 firmware, is to write 0x7 to the PCI command register. Neither the PIIX3 specification nor actual hardware (a Tyan S1686D system) permit modification of the Memory Space Enable (MSE) bit, 1, and thus the command register

[PATCH 2/4] hw/ide/core: Clear LBA and drive bits for EXECUTE DEVICE DIAGNOSTIC

2022-05-28 Thread Lev Kujawski
Prior to this patch, cmd_exec_dev_diagnostic relied upon ide_set_signature to clear the device register. While the preservation of the drive bit by ide_set_signature is necessary for the DEVICE RESET, IDENTIFY DEVICE, and READ SECTOR commands, ATA/ATAPI-6 specifies that "DEV shall be cleared to ze

[PATCH 1/4] hw/ide/atapi.c: Correct typos (CD-CDROM -> CD-ROM)

2022-05-28 Thread Lev Kujawski
Signed-off-by: Lev Kujawski --- hw/ide/atapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index b626199e3d..88b2890faf 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -318,7 +318,7 @@ static void ide_atapi_cmd_reply(IDEState *s, int

Re: [PATCH] Updating gdbstub to allow safe multithreading in usermode emulation

2022-05-28 Thread BENJAMIN COHEN
Sorry, my email service mangled the link I ment to send. It should be:https://github.com/odinssecrets/qemu_gdbstub_multithread_testingOn May 28, 2022 3:53 PM, Ben Cohen wrote:I was testing some multi-threaded code in qemu's usermode and ran into issues with the gdbstub because the user mode qemu

[PATCH] Updating gdbstub to allow safe multithreading in usermode emulation

2022-05-28 Thread Ben Cohen
I was testing some multi-threaded code in qemu's usermode and ran into issues with the gdbstub because the user mode qemu emulation spawns new threads when the process tries to make a new thread but the gdbstub does not handle the threads well. The current gdbstub has a single global struct which c

[PATCH v3 6/7] hw/isa/piix4: QOM'ify PIIX4 PM creation

2022-05-28 Thread Bernhard Beschow
Just like the real hardware, create the PIIX4 ACPI controller as part of the PIIX4 southbridge. This also mirrors how the IDE and USB functions are already created. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c| 25 ++--- hw/mips/malta.c |

[PATCH v3 3/7] hw/isa/piix{3, 4}: Move pci_map_irq_fn's near pci_set_irq_fn's

2022-05-28 Thread Bernhard Beschow
The pci_map_irq_fn's were implemented below type_init() which made them inaccessible to QOM functions. So move them up. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 22 +++--- hw/isa/piix4.c | 50

[PATCH v3 5/7] hw/isa/piix{3, 4}: Factor out ISABus retrieval from create() functions

2022-05-28 Thread Bernhard Beschow
Modernizes the code and even saves a few lines. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 3 ++- hw/isa/piix3.c| 3 +-- hw/isa/piix4.c| 6 +- hw/mips/malta.c

[PATCH v3 1/7] include/hw/southbridge/piix: Aggregate all PIIX soughbridge type names

2022-05-28 Thread Bernhard Beschow
TYPE_PIIX3_PCI_DEVICE resides there as already, so add the remaining ones, too. Signed-off-by: Bernhard Beschow Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c| 3 --- include/hw/isa/isa.h | 2 -- include/hw/southbridge/piix.h | 4 +

[PATCH v3 7/7] hw/isa/piix{3, 4}: Inline and remove create() functions

2022-05-28 Thread Bernhard Beschow
During the previous changesets the create() functions became trivial wrappers around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/pc_piix.c | 6 +- hw/isa/piix3.c| 13 - h

[PATCH v3 4/7] hw/isa/piix{3, 4}: QOM'ify PCI device creation and wiring

2022-05-28 Thread Bernhard Beschow
PCI interrupt wiring and device creation (piix4 only) were performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. In order to avoid duplicate checking for xen_enabled() the piix3 realize methods are now split. Signed-off-by: Bernhard Beschow

[PATCH v3 2/7] hw/isa/piix4: Use object_initialize_child() for embedded struct

2022-05-28 Thread Bernhard Beschow
Found-by: Peter Maydell Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 9a6d981037..1d04fb6a55 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -224,7 +224,7 @@ static void piix4_init(

[PATCH v3 0/7] QOM'ify PIIX southbridge creation

2022-05-28 Thread Bernhard Beschow
v3: * Rebase onto 'hw/acpi/piix4: remove legacy piix4_pm_init() function' (Mark) [1] * Use embedded structs for touched PCI devices (Mark) * Fix piix4's rtc embedded struct to be initialized by object_initialize_child() (Peter) [2] Testing done: 1) `make check-avocado` for --target-list=x86_64-

Re: [PULL 0/3] Hppa serial fix patches

2022-05-28 Thread Richard Henderson
On 5/28/22 03:28, Helge Deller wrote: The following changes since commit 58b53669e87fed0d70903e05cd42079fbbdbc195: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-05-25 13:46:29 -0700) are available in the Git repository at: https://github.com/hdeller/qemu

Re: [PATCH 0/2] backend/tpm: Resolve issue with TPM 2 DA lockout

2022-05-28 Thread Stefan Berger
On 5/27/22 15:31, Stefan Berger wrote: On 5/27/22 15:24, Marc-André Lureau wrote: Hi On Fri, May 27, 2022 at 7:36 PM Stefan Berger wrote: This series of patches resolves an issue with a TPM 2's dictionary attack lockout logic being triggered upon well-timed VM resets. Normally, the O

Re: [PATCH v5 00/17] target/m68k: Conditional traps + trap cleanup

2022-05-28 Thread Laurent Vivier
Le 27/05/2022 à 18:47, Richard Henderson a écrit : Changes for v4: - Use ILLTRP for TRAP1-TRAP14. - Use is_error for print_syscall_err. r~ v1: https://lore.kernel.org/qemu-devel/20211130103752.72099-1-richard.hender...@linaro.org/ v2: https://lore.kernel.org/qemu-devel/20211202204900

Re: [PATCH v5 15/17] linux-user/strace: Use is_error in print_syscall_err

2022-05-28 Thread Laurent Vivier
Le 27/05/2022 à 18:48, Richard Henderson a écrit : Errors are not all negative numbers: use is_error. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-

Re: [PATCH v5 04/17] linux-user/m68k: Handle EXCP_TRAP1 through EXCP_TRAP15

2022-05-28 Thread Laurent Vivier
Le 27/05/2022 à 18:47, Richard Henderson a écrit : These are raised by guest instructions, and should not fall through into the default abort case. Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/m68k/cpu_loop

Re: [PATCH 2/2] hppa: Fix serial port pass-through

2022-05-28 Thread Helge Deller
On 5/28/22 16:25, Peter Maydell wrote: > On Sat, 28 May 2022 at 15:24, Peter Maydell wrote: >> Not related to this change, but you should consider removing these >> "if (serial_hd(n))" conditionals. > > ...oops, I just saw the 3/3 patch in your pullreq which does > exactly that, so ignore my email

Re: [PATCH 2/2] hppa: Fix serial port pass-through

2022-05-28 Thread Peter Maydell
On Sat, 28 May 2022 at 15:24, Peter Maydell wrote: > Not related to this change, but you should consider removing these > "if (serial_hd(n))" conditionals. ...oops, I just saw the 3/3 patch in your pullreq which does exactly that, so ignore my email :-) -- PMM

Re: [PATCH 2/2] hppa: Fix serial port pass-through

2022-05-28 Thread Peter Maydell
On Thu, 26 May 2022 at 12:52, Helge Deller wrote: > > This fixes the serial ports in the emulation to behave as on original > hardware. > > On the real hardware, the LASI UART is serial port #0 and the DINO UART > is serial port #1. This is fixed in SEABIOS_HPPA_VERSION >= 6, which is > why the la

[PATCH] linux-user: fix memory leak when threads exit

2022-05-28 Thread kkhaike
From: kkHAIKE when call do_fork->cpu_copy->cpu_create, the return new cpu was not parent so refby '/unattached', so need add more object_unparent call to unref. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/866 Signed-off-by: kkHAIKE --- linux-user/syscall.c | 1 + 1 file changed, 1

Re: [PULL 0/9] Block patches

2022-05-28 Thread Philippe Mathieu-Daudé via
On Thu, May 12, 2022 at 12:29 AM Philippe Mathieu-Daudé wrote: > > Hi Stefan, Nicolas, > > > Nicolas Saenz Julienne (3): > > Introduce event-loop-base abstract class > > util/main-loop: Introduce the main loop into QOM > > util/event-loop-base: Introduce options to set the thread pool size >

[PATCH v3] linux-user: Adjust child_tidptr on set_tid_address() syscall

2022-05-28 Thread Helge Deller
Keep track of the new child tidptr given by a set_tid_address() syscall. Do not call the host set_tid_address() syscall because we are emulating the behaviour of writing to child_tidptr in the exit() path. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson -- v3: - Respin of the patch b

[PULL 0/3] Hppa serial fix patches

2022-05-28 Thread Helge Deller
The following changes since commit 58b53669e87fed0d70903e05cd42079fbbdbc195: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-05-25 13:46:29 -0700) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git tags/hppa-serial-fix-pull-reques

[PULL 3/3] hppa: Fix serial port assignments and pass-through

2022-05-28 Thread Helge Deller
This fixes the serial ports in the emulation to behave as on original hardware. On the real hardware, the LASI UART is serial port #0 and the DINO UART is serial port #1. This is fixed in SeaBIOS-hppa firmware v6, which is why at least this firmware version is required. The serial port addresses

[PULL 2/3] hppa: Sync contents of hppa_hardware.h header file with SeaBIOS-hppa

2022-05-28 Thread Helge Deller
The hppa_hardware.h header file holds many constants for addresses and offsets which are needed while building the firmware (SeaBIOS-hppa) and while setting up the virtual machine in QEMU. That's why this header file needs to be in sync between both source code repositories. This patch adds a comm

Re: [PATCH v2 0/3] hppa: Fix serial port pass-through

2022-05-28 Thread Mark Cave-Ayland
On 28/05/2022 10:41, Helge Deller wrote: This series fixes the SeaBIOS-hppa firmware and the serial ports setup code in qemu so that it reflects the real hardware and allows serial port pass-through from the host to guests. Tested with Linux guests. v2: Changes suggested by: Mark Cave-Ayland

Re: [PATCH v2 5/6] hw/isa/piix4: QOM'ify PIIX4 PM creation

2022-05-28 Thread Mark Cave-Ayland
On 25/05/2022 19:09, Mark Cave-Ayland wrote: On 22/05/2022 22:24, Bernhard Beschow wrote: Just like the real hardware, create the PIIX4 ACPI controller as part of the PIIX4 southbridge. This also mirrors how the IDE and USB functions are already created. Signed-off-by: Bernhard Beschow ---  

[PATCH v2 0/3] hppa: Fix serial port pass-through

2022-05-28 Thread Helge Deller
This series fixes the SeaBIOS-hppa firmware and the serial ports setup code in qemu so that it reflects the real hardware and allows serial port pass-through from the host to guests. Tested with Linux guests. v2: Changes suggested by: Mark Cave-Ayland - Split out hppa_hardware.h restoration to a

[PATCH 12/12] hw/acpi/piix4: remove unused piix4_pm_initfn() function

2022-05-28 Thread Mark Cave-Ayland
This function is now unused and so can be completely removed. Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 19 --- include/hw/southbridge/piix.h | 4 2 files changed, 23 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index fd20e1eccc..0a

[PATCH v2 3/3] hppa: Fix serial port assignments and pass-through

2022-05-28 Thread Helge Deller
This fixes the serial ports in the emulation to behave as on original hardware. On the real hardware, the LASI UART is serial port #0 and the DINO UART is serial port #1. This is fixed in SeaBIOS-hppa firmware v6, which is why at least this firmware version is required. The serial port addresses

[PATCH 07/12] hw/acpi/piix4: introduce piix4_pm_init() instance init function

2022-05-28 Thread Mark Cave-Ayland
Use the new piix4_pm_init() instance init function to initialise 2 separate qdev gpios for the SCI and SMI IRQs. Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index d897d2dee6..454fa34df1 100644

[PATCH v2 2/3] hppa: Sync contents of hppa_hardware.h header file with SeaBIOS-hppa

2022-05-28 Thread Helge Deller
The hppa_hardware.h header file holds many constants for addresses and offsets which are needed while building the firmware (SeaBIOS-hppa) and while setting up the virtual machine in QEMU. That's why this header file needs to be in sync between both source code repositories. This patch adds a comm

[PATCH 11/12] hw/isa/piix4.c: create PIIX4_PM device directly instead of using piix4_pm_initfn()

2022-05-28 Thread Mark Cave-Ayland
Now that all external logic has been removed from piix4_pm_initfn() the PIIX4_PM device can be instantiated directly. Signed-off-by: Mark Cave-Ayland --- hw/isa/piix4.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 775e15eb2

[PATCH 09/12] hw/acpi/piix4: use qdev gpio to wire up smi_irq

2022-05-28 Thread Mark Cave-Ayland
The smi_irq can now be wired up directly using a qdev gpio instead of having to set the IRQ externally in piix4_pm_initfn(). Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 3 +-- hw/i386/pc_piix.c | 3 ++- hw/isa/piix4.c| 2 +- include/hw/southbri

[PATCH 03/12] hw/acpi/piix4: convert smm_enabled bool to qdev property

2022-05-28 Thread Mark Cave-Ayland
This allows the smm_enabled value to be set using a standard qdev property instead of being referenced directly in piix4_pm_init(). Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index f

[PATCH 10/12] hw/i386/pc_piix: create PIIX4_PM device directly instead of using piix4_pm_initfn()

2022-05-28 Thread Mark Cave-Ayland
Now that all external logic has been removed from piix4_pm_initfn() the PIIX4_PM device can be instantiated directly. Signed-off-by: Mark Cave-Ayland --- hw/i386/pc_piix.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index

[PATCH 05/12] hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState

2022-05-28 Thread Mark Cave-Ayland
This exposes the PIIX4_PM device to the caller to allow any qdev gpios to be mapped outside of piix4_pm_init(). Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 11 --- hw/i386/pc_piix.c | 10 +- hw/isa/piix4.c| 8 +--- include/

[PATCH 02/12] hw/acpi/piix4: change smm_enabled from int to bool

2022-05-28 Thread Mark Cave-Ayland
This is in preparation for conversion to a qdev property. Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index bf20fa139b..fcfaafc175 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -

[PATCH 08/12] hw/acpi/piix4: use qdev gpio to wire up sci_irq

2022-05-28 Thread Mark Cave-Ayland
The sci_irq can now be wired up directly using a qdev gpio instead of having to set the IRQ externally in piix4_pm_initfn(). Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 4 +--- hw/i386/pc_piix.c | 4 ++-- hw/isa/piix4.c| 6 +++--- include/hw/so

[PATCH 04/12] hw/acpi/piix4: move PIIX4PMState into separate piix4.h header

2022-05-28 Thread Mark Cave-Ayland
This allows the QOM types in hw/acpi/piix4.c to be used elsewhere by simply including hw/acpi/piix4.h. Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 43 +--- hw/i386/acpi-build.c | 1 + include/hw/acpi/piix4.h | 75 ++

[PATCH 01/12] hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to piix4_pm_realize()

2022-05-28 Thread Mark Cave-Ayland
This logic can be included as part of piix4_pm_realize() and does not need to be handled externally. Signed-off-by: Mark Cave-Ayland --- hw/acpi/piix4.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index fe5625d07a..bf20fa139b 10064

[PATCH 00/12] hw/acpi/piix4: remove legacy piix4_pm_init() function

2022-05-28 Thread Mark Cave-Ayland
Whilst reviewing Bernhard's PIIX Southbridge QOMifcation patches at https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg04329.html, I noticed that we should first eliminate the legacy device init function piix4_pm_init(). This series moves the outstanding logic from piix4_pm_init() into the

[PATCH 06/12] hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn()

2022-05-28 Thread Mark Cave-Ayland
When QOMifying a device it is typical to use _init() as the suffix for an instance_init function, however this name is already in use by the legacy piix4_pm_init() wrapper function. Eventually the wrapper function will be removed, but for now rename it to piix4_pm_initfn() to avoid a naming collisi