Re: [RFC PATCH-for-9.1 09/29] hw/i386/pc: Pass PCMachineState argument to acpi_setup()

2024-04-06 Thread Bernhard Beschow
-off-by: Philippe Mathieu-Daudé This patch looks like good material on its own. Reviewed-by: Bernhard Beschow >--- > hw/i386/acpi-build.h | 3 ++- > hw/i386/acpi-build.c | 5 ++--- > hw/i386/pc.c | 2 +- > 3 files changed, 5 insertions(+), 5 deletions(-) > >diff --git

Re: [RFC PATCH-for-9.1 13/29] hw/i386/pc: Remove non-PCI code from pc_system_firmware_init()

2024-04-06 Thread Bernhard Beschow
sert? This allows for further removal of code in this patch and avoids superficial barriers for reusing this code. Or do I miss something? Anyway, this patch looks like good material on its own and could be tagged independently. With dropping the assert considered: Reviewed-by: Bernhard Beschow > > /* Map legacy -drive if=pflash to machine properties */ > for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) {

Re: [PATCH] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent

2024-01-14 Thread Bernhard Beschow
Am 7. Januar 2024 23:16:23 UTC schrieb Bernhard Beschow : >This is a follow-up on commit 89965db43cce "hw/isa/piix3: Avoid Xen-specific >variant of piix3_write_config()" which introduced >piix_intx_routing_notifier_xen(). This function is implemented in board code >

Re: [PATCH] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent

2024-01-09 Thread Bernhard Beschow
Am 9. Januar 2024 08:51:37 UTC schrieb David Woodhouse : >On Mon, 2024-01-08 at 00:16 +0100, Bernhard Beschow wrote: >> This is a follow-up on commit 89965db43cce "hw/isa/piix3: Avoid Xen-specific >> variant of piix3_write_config()" which introduced >>

[PATCH] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent

2024-01-07 Thread Bernhard Beschow
This might be useful for possible Q35 Xen efforts but remains a future exercise for now. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 042c13cdbc..abfcfe4d2b 100644 ---

Re: [PATCH v2 1/5] system/cpus: rename qemu_mutex_lock_iothread() to bql_lock()

2024-01-02 Thread Bernhard Beschow
Am 12. Dezember 2023 15:39:00 UTC schrieb Stefan Hajnoczi : >The Big QEMU Lock (BQL) has many names and they are confusing. The >actual QemuMutex variable is called qemu_global_mutex but it's commonly >referred to as the BQL in discussions and some code comments. The >locking APIs, however, are

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-09-24 Thread Bernhard Beschow
Am 20. September 2023 14:44:23 UTC schrieb Chuck Zmudzinski : >On 9/19/2023 4:02 PM, Bernhard Beschow wrote: >> >> >> Am 3. April 2023 12:27:14 UTC schrieb Jason Andryuk : >>>On Mon, Apr 3, 2023 at 5:33 AM Anthony PERARD >>>wrote: >>>> >

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-09-19 Thread Bernhard Beschow
Am 3. April 2023 12:27:14 UTC schrieb Jason Andryuk : >On Mon, Apr 3, 2023 at 5:33 AM Anthony PERARD >wrote: >> >> On Sat, Apr 01, 2023 at 10:36:45PM +, Bernhard Beschow wrote: >> > >> > >> > Am 30. März 2023 13:00:25 UTC schrieb Anthony PERAR

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-07-02 Thread Bernhard Beschow
Am 1. Juli 2023 11:58:57 UTC schrieb Mark Cave-Ayland : >On 01/07/2023 10:53, Bernhard Beschow wrote: > >> Am 30. Juni 2023 08:48:02 UTC schrieb Paolo Bonzini : >>> Il mer 28 giu 2023, 13:28 Bernhard Beschow ha scritto: >>> >>>> >>>>

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-07-01 Thread Bernhard Beschow
Am 30. Juni 2023 08:48:02 UTC schrieb Paolo Bonzini : >Il mer 28 giu 2023, 13:28 Bernhard Beschow ha scritto: > >> >> >> Am 27. Juni 2023 12:07:40 UTC schrieb Olaf Hering : >> >Tue, 27 Jun 2023 10:12:50 + Bernhard Beschow : >> > >> >

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-06-30 Thread Bernhard Beschow
Am 30. Juni 2023 11:32:42 UTC schrieb Olaf Hering : >Fri, 30 Jun 2023 08:05:29 +0000 Bernhard Beschow : > >> Yes. Have a look for piix3/piix4 here: >> https://www.intel.com/design/archives/chipsets/440/index.htm > >This is hidden behind a login or whatever. None o

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-06-30 Thread Bernhard Beschow
Am 30. Juni 2023 07:29:21 UTC schrieb Olaf Hering : >Wed, 28 Jun 2023 09:27:16 +0000 Bernhard Beschow : > >> Would you mind sending a patch fixing the BMIBA register to be reset as 32 >> bit? > >Will do so next week. Great! Perhaps it could then be picked up by main

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-06-28 Thread Bernhard Beschow
Am 27. Juni 2023 12:07:40 UTC schrieb Olaf Hering : >Tue, 27 Jun 2023 10:12:50 +0000 Bernhard Beschow : > >> The BAR is a 32 bit register whose default value is 0x0001. I think >> what's supposed to happen here is a pci_set_long() rather than a >> pci_set_by

Re: [PATCH v2] piix: fix regression during unplug in Xen HVM domUs

2023-06-27 Thread Bernhard Beschow
Am 27. Juni 2023 07:11:33 UTC schrieb Paolo Bonzini : >On 6/26/23 23:19, Olaf Hering wrote: >> I need advice on how to debug this. >> >> One thing that stands out is uhci_irq(). >> It reads a u16 from the USBSTS register. >> >> On the qemu side, this read is served from bmdma_read. Since the

Re: [PATCH v1 20/23] xen platform: unplug ahci object

2023-06-21 Thread Bernhard Beschow
Am 20. Juni 2023 17:24:54 UTC schrieb Joel Upham : >This will unplug the ahci device when the Xen driver calls for an unplug. >This has been tested to work in linux and Windows guests. >When q35 is detected, we will remove the ahci controller >with the hard disks. In the libxl config, cdrom

Re: [PATCH v1 1/1] Q35 Support

2023-06-21 Thread Bernhard Beschow
Hi Joel, Nice! I've been working on making the PIIX south bridge Xen agnostic, partly to show how Xen enablement in Q35 could look like. Not that I'd have any use case for it but great to see that you've actually done that! I know you didn't intend to send this patch but I'll give you some

Re: [PATCH v4 0/7] Resolve TYPE_PIIX3_XEN_DEVICE

2023-06-05 Thread Bernhard Beschow
Am 22. Mai 2023 15:42:03 UTC schrieb Bernhard Beschow : > > >Am 15. Mai 2023 20:52:40 UTC schrieb Stefano Stabellini >: >>On Sat, 13 May 2023, Bernhard Beschow wrote: >>> Am 21. April 2023 07:38:10 UTC schrieb "Michael S. Tsirkin" >>> : >>&

Re: [PATCH v4 0/7] Resolve TYPE_PIIX3_XEN_DEVICE

2023-05-22 Thread Bernhard Beschow
Am 15. Mai 2023 20:52:40 UTC schrieb Stefano Stabellini : >On Sat, 13 May 2023, Bernhard Beschow wrote: >> Am 21. April 2023 07:38:10 UTC schrieb "Michael S. Tsirkin" >> : >> >On Mon, Apr 03, 2023 at 09:41:17AM +0200, Bernhard Beschow wrote: >> >&g

Re: [PATCH v4 0/7] Resolve TYPE_PIIX3_XEN_DEVICE

2023-05-13 Thread Bernhard Beschow
Am 21. April 2023 07:38:10 UTC schrieb "Michael S. Tsirkin" : >On Mon, Apr 03, 2023 at 09:41:17AM +0200, Bernhard Beschow wrote: >> There is currently a dedicated PIIX3 device model for use under Xen. By >> reusing >> existing PCI API during initialization this

Re: [PATCH v4 0/7] Resolve TYPE_PIIX3_XEN_DEVICE

2023-04-21 Thread Bernhard Beschow
Am 21. April 2023 07:38:10 UTC schrieb "Michael S. Tsirkin" : >On Mon, Apr 03, 2023 at 09:41:17AM +0200, Bernhard Beschow wrote: >> There is currently a dedicated PIIX3 device model for use under Xen. By >> reusing >> existing PCI API during initialization this

Re: [PATCH v4 2/7] hw/pci/pci.c: Don't leak PCIBus::irq_count[] in pci_bus_irqs()

2023-04-19 Thread Bernhard Beschow
Am 3. April 2023 07:41:19 UTC schrieb Bernhard Beschow : >When calling pci_bus_irqs() multiple times on the same object without calling >pci_bus_irqs_cleanup() in between PCIBus::irq_count[] is currently leaked. >Let's fix this because Xen will do just that in a few commits, an

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-04-03 Thread Bernhard Beschow
Am 3. April 2023 12:27:14 UTC schrieb Jason Andryuk : >On Mon, Apr 3, 2023 at 5:33 AM Anthony PERARD >wrote: >> >> On Sat, Apr 01, 2023 at 10:36:45PM +, Bernhard Beschow wrote: >> > >> > >> > Am 30. März 2023 13:00:25 UTC schrieb Anthony PERAR

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-04-03 Thread Bernhard Beschow
Am 1. April 2023 22:36:45 UTC schrieb Bernhard Beschow : > > >Am 30. März 2023 13:00:25 UTC schrieb Anthony PERARD >: >>On Sun, Mar 12, 2023 at 01:02:17PM +0100, Bernhard Beschow wrote: >>> This is a preparational patch for the next one to make the following >&

[PATCH v4 7/7] hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-04-03 Thread Bernhard Beschow
During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of TYPE_PIIX3_DEVICE. Remove this redundancy. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Anthony PERARD Tested-by: Chuck Zmudzinski Message-Id: <20230312120221.99183-7-shen...@gmail.

[PATCH v4 6/7] hw/isa/piix3: Resolve redundant k->config_write assignments

2023-04-03 Thread Bernhard Beschow
The previous patch unified handling of piix3_write_config() accross the PIIX3 device models which allows for assigning k->config_write once in the base class. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Anthony PERARD Tested-by: Chuck Zmudzinski Message

[PATCH v4 4/7] hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3

2023-04-03 Thread Bernhard Beschow
xen_intx_set_irq() doesn't depend on PIIX3State. In order to resolve TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3 in the board. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed

[PATCH v4 5/7] hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config()

2023-04-03 Thread Bernhard Beschow
, pci_bus_fire_intx_routing_notifier() could be adjusted in such a way that subscribing to it doesn't require knowledge of the device firing it. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Anthony PERARD Tested-by: Chuck Zmudzinski Message-Id: <20230312120221.99183-5-shen...@gmail.

[PATCH v4 3/7] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-04-03 Thread Bernhard Beschow
-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Anthony PERARD Tested-by: Chuck Zmudzinski Message-Id: <20230312120221.99183-3-shen...@gmail.com> --- hw/isa/piix3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 1b3e

[PATCH v4 0/7] Resolve TYPE_PIIX3_XEN_DEVICE

2023-04-03 Thread Bernhard Beschow
6_64 -M pc -m 2G -cpu host -accel kvm \ -cdrom manjaro-kde-21.2.6-220416-linux515.iso` v4: - Add patch fixing latent memory leak in pci_bus_irqs() (Anthony) v3: - Rebase onto master v2: - xen_piix3_set_irq() is already generic. Just rename it. (Chuck) Tested-by: Chuck Zmudzinski

[PATCH v4 2/7] hw/pci/pci.c: Don't leak PCIBus::irq_count[] in pci_bus_irqs()

2023-04-03 Thread Bernhard Beschow
. Note that pci_bus_irqs_cleanup() now has to NULL irq_count such that pci_bus_irqs() doesn't do a double free. Signed-off-by: Bernhard Beschow --- hw/pci/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index def5000e7b..be1c5d16ec 100644 --- a/hw/pci

[PATCH v4 1/7] include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()

2023-04-03 Thread Bernhard Beschow
rather than PIIX has this many interrupt routes. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Reviewed-by: Anthony PERARD Tested-by: Chuck Zmudzinski Message-Id: <20230312120221.99183-2-shen...@gmail.com> --- include/hw/xen/xen.h | 2 +- hw/i386/xen/xen-hvm.c | 2

Re: [PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-04-01 Thread Bernhard Beschow
Am 30. März 2023 13:00:25 UTC schrieb Anthony PERARD : >On Sun, Mar 12, 2023 at 01:02:17PM +0100, Bernhard Beschow wrote: >> This is a preparational patch for the next one to make the following >> more obvious: >> >> First, pci_bus_irqs() is now called twice in case

Re: [PATCH] xen: Fix host pci for stubdom

2023-03-20 Thread Bernhard Beschow
Am 20. März 2023 00:05:54 UTC schrieb Jason Andryuk : >PCI passthrough for an HVM with a stubdom is PV PCI passthrough from >dom0 to the stubdom, and then QEMU passthrough of the PCI device inside >the stubdom. xen-pciback has boolean module param passthrough which >controls "how to export PCI

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
Am 12. März 2023 21:02:03 UTC schrieb Chuck Zmudzinski : >On 3/12/23 5:22 AM, Bernhard Beschow wrote: >> >> >> Am 11. März 2023 22:20:29 UTC schrieb Chuck Zmudzinski : >>>On 2/9/2023 4:53 PM, Bernhard Beschow wrote: >>>> Am 1. Februar

[PATCH v3 6/6] hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of TYPE_PIIX3_DEVICE. Remove this redundancy. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- include/hw/southbridge/piix.h | 1 - hw/i386/pc_piix.c | 5 ++--- hw/isa/piix3.c

[PATCH v3 5/6] hw/isa/piix3: Resolve redundant k->config_write assignments

2023-03-12 Thread Bernhard Beschow
The previous patch unified handling of piix3_write_config() accross the PIIX3 device models which allows for assigning k->config_write once in the base class. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw/isa/piix3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deleti

[PATCH v3 3/6] hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3

2023-03-12 Thread Bernhard Beschow
xen_intx_set_irq() doesn't depend on PIIX3State. In order to resolve TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3 in the board. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw

[PATCH v3 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
en_piix3_set_irq() is already generic. Just rename it. (Chuck) Tested-by: Chuck Zmudzinski Bernhard Beschow (6): include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq() hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize() hw/isa/piix3: Wire up Xen PCI IRQ handling outside o

[PATCH v3 1/6] include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()

2023-03-12 Thread Bernhard Beschow
rather than PIIX has this many interrupt routes. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- include/hw/xen/xen.h | 2 +- hw/i386/xen/xen-hvm.c | 2 +- hw/isa/piix3.c| 4 ++-- stubs/xen-hw-stub.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff

[PATCH v3 4/6] hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config()

2023-03-12 Thread Bernhard Beschow
, pci_bus_fire_intx_routing_notifier() could be adjusted in such a way that subscribing to it doesn't require knowledge of the device firing it. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 18 ++ hw/isa/piix3.c| 22 +- 2 files changed, 19

[PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-03-12 Thread Bernhard Beschow
-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw/isa/piix3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 1b3e23f0d7..a86cd23ef4 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -394,7 +394,7 @@ static void piix3_xen_realize

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
Am 11. März 2023 22:20:29 UTC schrieb Chuck Zmudzinski : >On 2/9/2023 4:53 PM, Bernhard Beschow wrote: >> Am 1. Februar 2023 08:11:10 UTC schrieb Bernhard Beschow : >> > >> > >> >Am 24. Januar 2023 17:07:30 UTC schrieb Bernhard Beschow >> >: >

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-02-09 Thread Bernhard Beschow
Am 1. Februar 2023 08:11:10 UTC schrieb Bernhard Beschow : > > >Am 24. Januar 2023 17:07:30 UTC schrieb Bernhard Beschow : >> >> >>Am 24. Januar 2023 16:11:47 UTC schrieb Anthony PERARD >>: >>>On Wed, Jan 18, 2023 at 05:13:03AM -0500, Michael S. Tsir

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-02-01 Thread Bernhard Beschow
Am 24. Januar 2023 17:07:30 UTC schrieb Bernhard Beschow : > > >Am 24. Januar 2023 16:11:47 UTC schrieb Anthony PERARD >: >>On Wed, Jan 18, 2023 at 05:13:03AM -0500, Michael S. Tsirkin wrote: >>> On Wed, Jan 04, 2023 at 03:44:31PM +0100, Bernhard Beschow wrote: >

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-24 Thread Bernhard Beschow
Am 24. Januar 2023 16:11:47 UTC schrieb Anthony PERARD : >On Wed, Jan 18, 2023 at 05:13:03AM -0500, Michael S. Tsirkin wrote: >> On Wed, Jan 04, 2023 at 03:44:31PM +0100, Bernhard Beschow wrote: >> > This series first renders TYPE_PIIX3_XEN_DEVICE redundant and fin

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-17 Thread Bernhard Beschow
Am 4. Januar 2023 14:44:31 UTC schrieb Bernhard Beschow : >This series first renders TYPE_PIIX3_XEN_DEVICE redundant and finally removes > >it. The motivation is to 1/ decouple PIIX from Xen and 2/ to make Xen in the PC > >machine agnostic to the precise southbridge being used.

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Bernhard Beschow
Am 12. Januar 2023 20:11:54 UTC schrieb Chuck Zmudzinski : >On 1/12/23 2:18 PM, Bernhard Beschow wrote: >> >> >> Am 11. Januar 2023 15:40:24 UTC schrieb Chuck Zmudzinski : >>>On 1/10/23 3:16 AM, Michael S. Tsirkin wrote: >>>> On Tue, Jan 10, 2023 a

Re: [PATCH v8] xen/pt: reserve PCI slot 2 for Intel igd-passthru

2023-01-12 Thread Bernhard Beschow
Am 11. Januar 2023 15:40:24 UTC schrieb Chuck Zmudzinski : >On 1/10/23 3:16 AM, Michael S. Tsirkin wrote: >> On Tue, Jan 10, 2023 at 02:08:34AM -0500, Chuck Zmudzinski wrote: >>> Intel specifies that the Intel IGD must occupy slot 2 on the PCI bus, >>> as noted in docs/igd-assign.txt in the

Re: [PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-07 Thread Bernhard Beschow
Am 7. Januar 2023 01:08:46 UTC schrieb Chuck Zmudzinski : >On 1/6/23 6:04 PM, Chuck Zmudzinski wrote: >> On 1/6/23 2:08 PM, Chuck Zmudzinski wrote: >>> On 1/6/23 7:25 AM, Philippe Mathieu-Daudé wrote: >>>> On 6/1/23 12:57, Bernhard Beschow wrote: >>>>

Re: [PATCH v2 3/6] hw/isa/piix: Wire up Xen PCI IRQ handling outside of PIIX3

2023-01-07 Thread Bernhard Beschow
Am 6. Januar 2023 17:35:18 UTC schrieb David Woodhouse : >On Wed, 2023-01-04 at 15:44 +0100, Bernhard Beschow wrote: >> +    if (xen_enabled()) { > >Could this perhaps be if (xen_mode != XEN_DISABLED) once we merge the >Xen-on-KVM series? It's the same condit

Re: [PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-06 Thread Bernhard Beschow
Am 4. Januar 2023 15:35:33 UTC schrieb "Philippe Mathieu-Daudé" : >+Markus/Thomas > >On 4/1/23 15:44, Bernhard Beschow wrote: >> During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of >> TYPE_PIIX3_DEVICE. Remove this redundancy. >>

Re: [PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
Am 4. Januar 2023 17:54:16 UTC schrieb Chuck Zmudzinski : >On 1/4/23 10:35 AM, Philippe Mathieu-Daudé wrote: >> +Markus/Thomas >> >> On 4/1/23 15:44, Bernhard Beschow wrote: >>> During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of >>> TY

Re: [PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
Am 4. Januar 2023 19:29:35 UTC schrieb Chuck Zmudzinski : >On 1/4/23 1:48 PM, Philippe Mathieu-Daudé wrote: >> On 4/1/23 18:54, Chuck Zmudzinski wrote: >>> On 1/4/23 10:35 AM, Philippe Mathieu-Daudé wrote: >>>> +Markus/Thomas >>>> >>>>

Re: [PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
Am 4. Januar 2023 16:42:43 UTC schrieb Chuck Zmudzinski : >On 1/4/23 9:44 AM, Bernhard Beschow wrote: >> During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of >> TYPE_PIIX3_DEVICE. Remove this redundancy. >> >> Signed-off-by: Bernhard Beschow &

Re: [PATCH 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
Am 4. Januar 2023 13:11:16 UTC schrieb Chuck Zmudzinski : >On 1/4/2023 7:13 AM, Bernhard Beschow wrote: >> Am 4. Januar 2023 08:18:59 UTC schrieb Chuck Zmudzinski : >> >On 1/3/2023 8:38 AM, Bernhard Beschow wrote: >> >> >> >> >> >>

[PATCH v2 5/6] hw/isa/piix: Resolve redundant k->config_write assignments

2023-01-04 Thread Bernhard Beschow
The previous patch unified handling of piix_write_config() accross all PIIX device models which allows for assigning k->config_write once in the base class. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/isa/piix.

[PATCH v2 1/6] include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()

2023-01-04 Thread Bernhard Beschow
rather than PIIX has this many interrupt routes. Signed-off-by: Bernhard Beschow --- hw/i386/xen/xen-hvm.c | 2 +- hw/isa/piix.c | 4 ++-- include/hw/xen/xen.h | 2 +- stubs/xen-hw-stub.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw

[PATCH v2 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of TYPE_PIIX3_DEVICE. Remove this redundancy. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 4 +--- hw/isa/piix.c | 20 include/hw/southbridge/piix.h | 1 - 3 files

[PATCH v2 4/6] hw/isa/piix: Avoid Xen-specific variant of piix_write_config()

2023-01-04 Thread Bernhard Beschow
, pci_bus_fire_intx_routing_notifier() could be adjusted in such a way that subscribing to it doesn't require knowledge of the device firing it. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 18 ++ hw/isa/piix.c | 22 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff

[PATCH v2 3/6] hw/isa/piix: Wire up Xen PCI IRQ handling outside of PIIX3

2023-01-04 Thread Bernhard Beschow
xen_intx_set_irq() doesn't depend on PIIX state. In order to resolve TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3 in the board. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 12

[PATCH v2 2/6] hw/isa/piix: Reuse piix3_realize() in piix3_xen_realize()

2023-01-04 Thread Bernhard Beschow
-by: Bernhard Beschow --- hw/isa/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index a7a4eec206..25707479eb 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -493,7 +493,7 @@ static void piix3_xen_realize(PCIDevice *dev, Error **errp

[PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
/30] Consolidate PIIX south bridges" Bernhard Beschow (6): include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq() hw/isa/piix: Reuse piix3_realize() in piix3_xen_realize() hw/isa/piix: Wire up Xen PCI IRQ handling outside of PIIX3 hw/isa/piix: Avoid Xen-specific variant o

Re: [PATCH 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-04 Thread Bernhard Beschow
Am 4. Januar 2023 08:18:59 UTC schrieb Chuck Zmudzinski : >On 1/3/2023 8:38 AM, Bernhard Beschow wrote: >> >> >> On Tue, Jan 3, 2023 at 2:17 PM Philippe Mathieu-Daudé >> wrote: >> >> Hi Chuck, >> >> On 3/1/23 04:15, Chuck Zmudzinski

Re: [PATCH 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-03 Thread Bernhard Beschow
Am 3. Januar 2023 17:25:35 UTC schrieb Chuck Zmudzinski : >On 1/3/2023 8:38 AM, Bernhard Beschow wrote: >> >> >> On Tue, Jan 3, 2023 at 2:17 PM Philippe Mathieu-Daudé >> wrote: >> >> Hi Chuck, >> >> On 3/1/23 04:15, Chuck Zmudzinski

Re: [PATCH 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-03 Thread Bernhard Beschow
On Tue, Jan 3, 2023 at 2:17 PM Philippe Mathieu-Daudé wrote: > Hi Chuck, > > On 3/1/23 04:15, Chuck Zmudzinski wrote: > > On 1/2/23 4:34 PM, Bernhard Beschow wrote: > >> This series first renders TYPE_PIIX3_XEN_DEVICE redundant and finally > removes > >> it. T

[PATCH 4/6] hw/isa/piix: Avoid Xen-specific variant of piix_write_config()

2023-01-02 Thread Bernhard Beschow
, pci_bus_fire_intx_routing_notifier() could be adjusted in such a way that subscribing to it doesn't require knowledge of the device firing it. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 18 ++ hw/isa/piix.c | 22 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff

[PATCH 3/6] hw/isa/piix: Wire up Xen PCI IRQ handling outside of PIIX3

2023-01-02 Thread Bernhard Beschow
xen_intx_set_irq() doesn't depend on PIIX state. In order to resolve TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3 in the board. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 12

[PATCH 5/6] hw/isa/piix: Resolve redundant k->config_write assignments

2023-01-02 Thread Bernhard Beschow
The previous patch unified handling of piix_write_config() accross all PIIX device models which allows for assigning k->config_write once in the base class. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/isa/piix.

[PATCH 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-01-02 Thread Bernhard Beschow
, avoiding the "Frankenstein" use of PIIX4_ACPI in PIIX3. Testing done: None, because I don't know how to conduct this properly :( Based-on: <20221221170003.2929-1-shen...@gmail.com> "[PATCH v4 00/30] Consolidate PIIX south bridges" Bernhard Beschow (6):

[PATCH 6/6] hw/isa/piix: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-01-02 Thread Bernhard Beschow
During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of TYPE_PIIX3_DEVICE. Remove this redundancy. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 4 +--- hw/isa/piix.c | 20 include/hw/southbridge/piix.h | 1 - 3 files

[PATCH 2/6] hw/isa/piix: Reuse piix3_realize() in piix3_xen_realize()

2023-01-02 Thread Bernhard Beschow
-by: Bernhard Beschow --- hw/isa/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index dc6014a4e4..a1281c2d77 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -493,7 +493,7 @@ static void piix3_xen_realize(PCIDevice *dev, Error **errp

[PATCH 1/6] include/hw/xen/xen: Make xen_piix3_set_irq() generic and rename it

2023-01-02 Thread Bernhard Beschow
xen_piix3_set_irq() hardcoded the number of PCI IRQ lines. Get it from the PCI bus instead. Signed-off-by: Bernhard Beschow --- hw/i386/xen/xen-hvm.c | 9 ++--- hw/isa/piix.c | 2 +- include/hw/xen/xen.h | 2 +- stubs/xen-hw-stub.c | 2 +- 4 files changed, 9 insertions(+), 6

Re: [PATCH 1/9] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 11:36:47 UTC schrieb Markus Armbruster : >Alistair Francis writes: > >> On Tue, Sep 20, 2022 at 9:18 AM Bernhard Beschow wrote: >>> >>> SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to >>> inherit from TYPE_

Re: [PATCH 9/9] exec/address-spaces: Inline legacy functions

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 09:02:41 UTC schrieb BALATON Zoltan : > > >On Tue, 20 Sep 2022, Philippe Mathieu-Daudé via wrote: > >> On 20/9/22 01:17, Bernhard Beschow wrote: >>> The functions just access a global pointer and perform some pointer >>> arithmetic on to

Re: [PATCH 8/9] softmmu/physmem: Let SysBusState absorb memory region and address space singletons

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 08:50:01 UTC schrieb BALATON Zoltan : > > >On Tue, 20 Sep 2022, Philippe Mathieu-Daudé via wrote: > >> On 20/9/22 01:17, Bernhard Beschow wrote: >>> These singletons are actually properties of the system bus but so far it >>> hasn't been

Re: [PATCH 2/9] exec/hwaddr.h: Add missing include

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 04:50:51 UTC schrieb "Philippe Mathieu-Daudé" : >On 20/9/22 01:17, Bernhard Beschow wrote: >> The next commit would not compile w/o the include directive. >> >> Signed-off-by: Bernhard Beschow >> --- >> include/exec/hwad

Re: [PATCH 0/9] Deprecate sysbus_get_default() and get_system_memory() et. al

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 15:36:26 UTC schrieb Mark Cave-Ayland : >On 20/09/2022 10:55, Peter Maydell wrote: > >> On Tue, 20 Sept 2022 at 00:18, Bernhard Beschow wrote: >>> >>> In address-spaces.h it can be read that get_system_memory() and >>> get_system_io()

Re: [PATCH 0/9] Deprecate sysbus_get_default() and get_system_memory() et. al

2022-09-20 Thread Bernhard Beschow
Am 20. September 2022 09:55:37 UTC schrieb Peter Maydell : >On Tue, 20 Sept 2022 at 00:18, Bernhard Beschow wrote: >> >> In address-spaces.h it can be read that get_system_memory() and >> get_system_io() are temporary interfaces which "should only be used >> t

[PATCH 9/9] exec/address-spaces: Inline legacy functions

2022-09-19 Thread Bernhard Beschow
The functions just access a global pointer and perform some pointer arithmetic on top. Allow the compiler to see through this by inlining. Signed-off-by: Bernhard Beschow --- include/exec/address-spaces.h | 30 ++ softmmu/physmem.c | 28

[PATCH 8/9] softmmu/physmem: Let SysBusState absorb memory region and address space singletons

2022-09-19 Thread Bernhard Beschow
rence causes a cache miss while arithmetic is basically free. Signed-off-by: Bernhard Beschow --- include/exec/address-spaces.h | 19 --- include/hw/sysbus.h | 6 + softmmu/physmem.c | 46 ++- 3 files changed, 45 inserti

[PATCH 7/9] hw/sysbus: Introduce dedicated struct SysBusState for TYPE_SYSTEM_BUS

2022-09-19 Thread Bernhard Beschow
With this out of the way, in the next step, SysBusState gains attributes for its memory and address recouces. Signed-off-by: Bernhard Beschow --- hw/core/sysbus.c | 4 ++-- include/hw/boards.h | 3 ++- include/hw/misc/macio/macio.h | 2 +- include/hw/sysbus.h

[PATCH 5/9] exec/address-spaces: Wrap address space singletons into functions

2022-09-19 Thread Bernhard Beschow
: * s/_space_memory/get_address_space_memory()/ * s/_space_io/get_address_space_io()/ The only exceptions were exec/address-spaces.h and softmmu/physmem.c which have been manually changed. Signed-off-by: Bernhard Beschow --- accel/hvf/hvf-accel-ops.c| 2 +- accel/kvm/kvm-all.c

[PATCH 6/9] target/loongarch/cpu: Remove unneeded include directive

2022-09-19 Thread Bernhard Beschow
The cpu is used in both user and system emulation context while sysbus.h is system-only. Remove it since it's not needed anyway. Furthermore, it would cause a compile error in the next commit. Signed-off-by: Bernhard Beschow --- target/loongarch/cpu.h | 1 - 1 file changed, 1 deletion(-) diff

[PATCH 4/9] hw/ppc/spapr: Fix code style problems reported by checkpatch

2022-09-19 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- include/hw/ppc/spapr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 530d739b1d..04a95669ab 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -848,7 +848,8

[PATCH 3/9] hw/core/sysbus: Resolve main_system_bus singleton

2022-09-19 Thread Bernhard Beschow
cache misses - a rule of thumb says that every pointer dereference causes a cache miss while arithmetic is basically free. Signed-off-by: Bernhard Beschow --- hw/core/bus.c | 5 - hw/core/machine.c | 3 +++ hw/core/sysbus.c| 22 +- include/hw/boards.h | 1

[PATCH 2/9] exec/hwaddr.h: Add missing include

2022-09-19 Thread Bernhard Beschow
The next commit would not compile w/o the include directive. Signed-off-by: Bernhard Beschow --- include/exec/hwaddr.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/hwaddr.h b/include/exec/hwaddr.h index 8f16d179a8..616255317c 100644 --- a/include/exec/hwaddr.h +++ b/include

[PATCH 1/9] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-19 Thread Bernhard Beschow
SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to inherit from TYPE_MACHINE. This is an inconsistency which can cause undefined behavior such as memory corruption. Change SiFiveEState to inherit from MachineState since it is registered as a machine. Signed-off-by: Bernhard

[PATCH 0/9] Deprecate sysbus_get_default() and get_system_memory() et. al

2022-09-19 Thread Bernhard Beschow
(passes without any issues) * make check-avocado (no new issues seem to be introduced compared to master) Bernhard Beschow (9): hw/riscv/sifive_e: Fix inheritance of SiFiveEState exec/hwaddr.h: Add missing include hw/core/sysbus: Resolve main_system_bus singleton hw/ppc/spapr: Fix code sty

[PATCH 0/2] Decouple Xen-HVM from PIIX

2022-06-26 Thread Bernhard Beschow
hw/i386/xen/xen-hvm.c contains logic which is PIIX-specific. This makes xen-hvm.c depend on PIIX which can be avoided if PIIX logic was isolated in PIIX itself. Bernhard Beschow (2): hw/i386/xen/xen-hvm: Allow for stubbing xen_set_pci_link_route() hw/i386/xen/xen-hvm: Inline

[PATCH 1/2] hw/i386/xen/xen-hvm: Allow for stubbing xen_set_pci_link_route()

2022-06-26 Thread Bernhard Beschow
this, xen_set_pci_link_route() needs to be stubbable which this patch addresses. Signed-off-by: Bernhard Beschow --- hw/i386/xen/xen-hvm.c | 7 ++- include/hw/xen/xen.h| 1 + include/hw/xen/xen_common.h | 6 -- stubs/xen-hw-stub.c | 5 + 4 files changed, 12 insertions(+), 7 deletions

[PATCH 2/2] hw/i386/xen/xen-hvm: Inline xen_piix_pci_write_config_client() and remove it

2022-06-26 Thread Bernhard Beschow
. Signed-off-by: Bernhard Beschow --- hw/i386/xen/xen-hvm.c | 18 -- hw/isa/piix3.c| 15 ++- include/hw/xen/xen.h | 1 - stubs/xen-hw-stub.c | 4 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen

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

2022-06-02 Thread Bernhard Beschow
On Saturday, May 28, 2022, Bernhard Beschow wrote: > 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 remov

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 XE

[PATCH v2 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-05-13 Thread Bernhard Beschow
and IDEBus rather than piix. Therefore, move this function to xen_platform, unexport it, and drop the "piix3" in the function name as well. Signed-off-by: Bernhard Beschow Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 48 +- hw/

[PATCH v2 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug()

2022-05-13 Thread Bernhard Beschow
The comment is based on commit message ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk unplug option'. Since it seems to describe design decisions and limitations that still apply it seems worth having. Signed-off-by: Bernhard Beschow --- hw/ide/piix.c | 11

[PATCH v2 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class

2022-05-13 Thread Bernhard Beschow
Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci generic class init function' already resolved redundant code which in turn rendered piix3-ide-xen redundant. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 +-- hw/ide/piix.c | 7 --- 2 files changed, 1

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

2022-05-13 Thread Bernhard Beschow
setup procedure seems quite sophisticated. Please let me know in case this is an obstacle. Bernhard Beschow (3): hw/ide/piix: Remove redundant "piix3-ide-xen" device class hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug() include/hw/ide: Unexport pci_piix3_x

Re: [PATCH 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-05-09 Thread Bernhard Beschow
Am 9. Mai 2022 08:02:13 UTC schrieb "Durrant, Paul" : >On 08/05/2022 11:34, Bernhard Beschow wrote: >> This function was declared in a generic and public header, implemented >> in a device-specific source file but only used in xen_platform. Given its >> 'aux' param

[PATCH 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-05-08 Thread Bernhard Beschow
and IDEBus rather than piix. Therefore, move this function to xen_platform, unexport it, and drop the "piix3" in the function name as well. Signed-off-by: Bernhard Beschow --- hw/i386/xen/xen_platform.c | 49 +- hw/ide/piix.c

Re: [PATCH 1/2] hw/xen/xen_pt: Confine igd-passthrough-isa-bridge to XEN

2022-04-05 Thread Bernhard Beschow
Am 26. März 2022 16:58:23 UTC schrieb Bernhard Beschow : >igd-passthrough-isa-bridge is only requested in xen_pt but was >implemented in pc_piix.c. This caused xen_pt to dependend on i386/pc >which is hereby resolved. > >Signed-off-by: Bernhard Beschow >--- > hw/i386/p

  1   2   >