[PATCH 20/47] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-12-14 Thread Michael Roth
From: Ani Sinha 

Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
written but the final version of the patch was not yet pushed upstream, this
address range was free and did not conflict with any other IO address ranges.
However, with the following change, this address range was no
longer conflict free as in this change, the IO address range
(value of ACPI_PCIHP_SIZE) was incremented by four bytes:

b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

This can be seen from the output of QMP command 'info mtree' :

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

It shows that there is a region of conflict between IO regions of acpi
pci hotplug and acpi cpu hotplug.

Unfortunately, the change caf108bc58790 did not update the IO address range
appropriately before it was pushed upstream to accommodate the increased
length of the IO address space introduced in change b32bd763a1ca92.

Due to this bug, windows guests complain 'This device cannot find
enough free resources it can use' in the device manager panel for extended
IO buses. This issue also breaks the correct functioning of pci hotplug as the
following shows that the IO space for pci hotplug has been truncated:

(qemu) info mtree -f
FlatView #0
 AS "I/O", root: io
 Root memory region: io
  0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
  0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug

Therefore, in this fix, we adjust the IO address range for the acpi pci
hotplug so that it does not conflict with cpu hotplug and there is no
truncation of IO spaces. The starting IO address of PCI hotplug region
has been decremented by four bytes in order to accommodate four byte
increment in the IO address space introduced by change
b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

After fixing, the following are the corrected IO ranges:

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

This change has been tested using a Windows Server 2019 guest VM. Windows
no longer complains after this change.

Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561

Signed-off-by: Ani Sinha 
Reviewed-by: Igor Mammedov 
Reviewed-by: Julia Suvorova 
Message-Id: <20210916132838.3469580-3-...@anisinha.ca>
Reviewed-by: Michael S. Tsirkin 
Signed-off-by: Michael S. Tsirkin 
(cherry picked from commit 0e780da76a6fe283a20283856718bca3986c104f)
Signed-off-by: Michael Roth 
---
 include/hw/acpi/ich9.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index a329ce43ab..f04f1791bd 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -29,7 +29,7 @@
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/tco.h"
 
-#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
+#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
 
 typedef struct ICH9LPCPMRegs {
 /*
-- 
2.25.1




[PULL 51/57] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-10-05 Thread Michael S. Tsirkin
From: Ani Sinha 

Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
written but the final version of the patch was not yet pushed upstream, this
address range was free and did not conflict with any other IO address ranges.
However, with the following change, this address range was no
longer conflict free as in this change, the IO address range
(value of ACPI_PCIHP_SIZE) was incremented by four bytes:

b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

This can be seen from the output of QMP command 'info mtree' :

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

It shows that there is a region of conflict between IO regions of acpi
pci hotplug and acpi cpu hotplug.

Unfortunately, the change caf108bc58790 did not update the IO address range
appropriately before it was pushed upstream to accommodate the increased
length of the IO address space introduced in change b32bd763a1ca92.

Due to this bug, windows guests complain 'This device cannot find
enough free resources it can use' in the device manager panel for extended
IO buses. This issue also breaks the correct functioning of pci hotplug as the
following shows that the IO space for pci hotplug has been truncated:

(qemu) info mtree -f
FlatView #0
 AS "I/O", root: io
 Root memory region: io
  0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
  0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug

Therefore, in this fix, we adjust the IO address range for the acpi pci
hotplug so that it does not conflict with cpu hotplug and there is no
truncation of IO spaces. The starting IO address of PCI hotplug region
has been decremented by four bytes in order to accommodate four byte
increment in the IO address space introduced by change
b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

After fixing, the following are the corrected IO ranges:

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

This change has been tested using a Windows Server 2019 guest VM. Windows
no longer complains after this change.

Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561

Signed-off-by: Ani Sinha 
Reviewed-by: Igor Mammedov 
Reviewed-by: Julia Suvorova 
Message-Id: <20210916132838.3469580-3-...@anisinha.ca>
Reviewed-by: Michael S. Tsirkin 
Signed-off-by: Michael S. Tsirkin 
---
 include/hw/acpi/ich9.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index a329ce43ab..f04f1791bd 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -29,7 +29,7 @@
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/tco.h"
 
-#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
+#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
 
 typedef struct ICH9LPCPMRegs {
 /*
-- 
MST




Re: hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-17 Thread Ani Sinha
On Fri, Sep 17, 2021 at 10:11 AM Ani Sinha  wrote:
>
>
>
> On Thu, 16 Sep 2021, Michael S. Tsirkin wrote:
>
> > On Thu, Sep 16, 2021 at 06:58:35PM +0530, Ani Sinha wrote:
> > > Here's sending v2.
> > >
> > > changelog :
> > > v1: original patch.
> > > v2: typo fixed. reviewed-by tags added.
> >
> >
> > Thanks, tagged!
> > Ani pls make sure the voer letter in the series has
> > subject
> >
> > [PATCH 0/3] hw/i386/acpi: fix conflicting IO address range for acpi pci
> >  hotplug in q35
> >
> >
> > using --cover-letter with git format-patch will do this automatically.
> >
> > It will also include diffstat and other useful info.
>
> Ah I see. I was wondering about this few days back because I saw a
> patchset with diffstat etc. I use git send-email --cover -v2 -3 -cc
> --cc-cmd etc. I did not realize that git format-patch also has similar
> options and adds more info to the cover letter. I wonder why the behavior
> is different between them.  Also --cc-cmd is missing in format-patch!

Also note that checkpatch.pl can be run without spitting out the
patches in separate files:

./scripts/checkpatch.pl HEAD~3..HEAD
1/3 Checking commit 0a4f1a3d8733 (bios-tables-test: allow changes in
DSDT ACPI tables for q35)
total: 0 errors, 0 warnings, 12 lines checked

Patch 1/3 has no obvious style problems and is ready for submission.
2/3 Checking commit 5adcc9e39e6a (hw/i386/acpi: fix conflicting IO
address range for acpi pci hotplug in q35)
total: 0 errors, 0 warnings, 8 lines checked

Patch 2/3 has no obvious style problems and is ready for submission.
3/3 Checking commit 5e0a8181d2d9 (bios-tables-test: Update ACPI DSDT
table golden blobs for q35)
total: 0 errors, 0 warnings, 1 lines checked

Patch 3/3 has no obvious style problems and is ready for submission.

So I guess the workflow should always be :
1) use git format-patch -o 
2) run checkpatch on patches in dir
3) git send-email dir/*.patch

>
> Was this an essential complexity or accidental one :-)
>
>
>
> >
> >
> > > This issue has been reported here:
> > > https://gitlab.com/qemu-project/qemu/-/issues/561
> > >
> > > We have disucssed this issue at length here:
> > > https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html
> > >
> > > This issue affects Qemu version 6.1.
> > >
> > > Patch 1 : allows q35 DSDT table changes.
> > > Patch 2 : actual fix.
> > > Patch 3: updates DSDT table blobs.
> > >
> > >
> >
> >



Re: hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-16 Thread Ani Sinha



On Thu, 16 Sep 2021, Michael S. Tsirkin wrote:

> On Thu, Sep 16, 2021 at 06:58:35PM +0530, Ani Sinha wrote:
> > Here's sending v2.
> >
> > changelog :
> > v1: original patch.
> > v2: typo fixed. reviewed-by tags added.
>
>
> Thanks, tagged!
> Ani pls make sure the voer letter in the series has
> subject
>
> [PATCH 0/3] hw/i386/acpi: fix conflicting IO address range for acpi pci
>  hotplug in q35
>
>
> using --cover-letter with git format-patch will do this automatically.
>
> It will also include diffstat and other useful info.

Ah I see. I was wondering about this few days back because I saw a
patchset with diffstat etc. I use git send-email --cover -v2 -3 -cc
--cc-cmd etc. I did not realize that git format-patch also has similar
options and adds more info to the cover letter. I wonder why the behavior
is different between them.  Also --cc-cmd is missing in format-patch!

Was this an essential complexity or accidental one :-)



>
>
> > This issue has been reported here:
> > https://gitlab.com/qemu-project/qemu/-/issues/561
> >
> > We have disucssed this issue at length here:
> > https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html
> >
> > This issue affects Qemu version 6.1.
> >
> > Patch 1 : allows q35 DSDT table changes.
> > Patch 2 : actual fix.
> > Patch 3: updates DSDT table blobs.
> >
> >
>
>



Re: hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-16 Thread Michael S. Tsirkin
On Thu, Sep 16, 2021 at 06:58:35PM +0530, Ani Sinha wrote:
> Here's sending v2.
> 
> changelog :
> v1: original patch.
> v2: typo fixed. reviewed-by tags added.


Thanks, tagged!
Ani pls make sure the voer letter in the series has
subject

[PATCH 0/3] hw/i386/acpi: fix conflicting IO address range for acpi pci
 hotplug in q35


using --cover-letter with git format-patch will do this automatically.

It will also include diffstat and other useful info.


> This issue has been reported here:
> https://gitlab.com/qemu-project/qemu/-/issues/561
> 
> We have disucssed this issue at length here:
> https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html
> 
> This issue affects Qemu version 6.1.
> 
> Patch 1 : allows q35 DSDT table changes.
> Patch 2 : actual fix.
> Patch 3: updates DSDT table blobs.
> 
> 




[PATCH v2 2/3] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-16 Thread Ani Sinha
Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
written but the final version of the patch was not yet pushed upstream, this
address range was free and did not conflict with any other IO address ranges.
However, with the following change, this address range was no
longer conflict free as in this change, the IO address range
(value of ACPI_PCIHP_SIZE) was incremented by four bytes:

b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

This can be seen from the output of QMP command 'info mtree' :

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

It shows that there is a region of conflict between IO regions of acpi
pci hotplug and acpi cpu hotplug.

Unfortunately, the change caf108bc58790 did not update the IO address range
appropriately before it was pushed upstream to accommodate the increased
length of the IO address space introduced in change b32bd763a1ca92.

Due to this bug, windows guests complain 'This device cannot find
enough free resources it can use' in the device manager panel for extended
IO buses. This issue also breaks the correct functioning of pci hotplug as the
following shows that the IO space for pci hotplug has been truncated:

(qemu) info mtree -f
FlatView #0
 AS "I/O", root: io
 Root memory region: io
  0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
  0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug

Therefore, in this fix, we adjust the IO address range for the acpi pci
hotplug so that it does not conflict with cpu hotplug and there is no
truncation of IO spaces. The starting IO address of PCI hotplug region
has been decremented by four bytes in order to accommodate four byte
increment in the IO address space introduced by change
b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

After fixing, the following are the corrected IO ranges:

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

This change has been tested using a Windows Server 2019 guest VM. Windows
no longer complains after this change.

Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561

Signed-off-by: Ani Sinha 
Reviewed-by: Igor Mammedov 
Reviewed-by: Julia Suvorova 
---
 include/hw/acpi/ich9.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index a329ce43ab..f04f1791bd 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -29,7 +29,7 @@
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/tco.h"
 
-#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
+#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
 
 typedef struct ICH9LPCPMRegs {
 /*
-- 
2.25.1




hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-16 Thread Ani Sinha
Here's sending v2.

changelog :
v1: original patch.
v2: typo fixed. reviewed-by tags added.

This issue has been reported here:
https://gitlab.com/qemu-project/qemu/-/issues/561

We have disucssed this issue at length here:
https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html

This issue affects Qemu version 6.1.

Patch 1 : allows q35 DSDT table changes.
Patch 2 : actual fix.
Patch 3: updates DSDT table blobs.






Re: [PATCH 2/3] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-16 Thread Julia Suvorova
On Tue, Sep 14, 2021 at 6:54 AM Ani Sinha  wrote:
>
> Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
> Q35")
> selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
> starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
> written but the final version of the patch was not yet pushed upstream, this
> address range was free and did not conflict with any other IO address ranges.
> However, with the following change, this address range was no
> longer conflict free as in this change, the IO address range
> (value of ACPI_PCIHP_SIZE) was incremented by four bytes:
>
> b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")
>
> This can be seen from the output of QMP command 'info mtree' :
>
> 0600-0603 (prio 0, i/o): acpi-evt
> 0604-0605 (prio 0, i/o): acpi-cnt
> 0608-060b (prio 0, i/o): acpi-tmr
> 0620-062f (prio 0, i/o): acpi-gpe0
> 0630-0637 (prio 0, i/o): acpi-smi
> 0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
> 0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug
>
> It shows that there is a region of conflict between IO regions of acpi
> pci hotplug and acpi cpu hotplug.
>
> Unfortunately, the change caf108bc58790 did not update the IO address range
> appropriately before it was pushed upstream to accomodate

s/accomodate/accommodate

> the increased
> length of the IO address space introduced in change b32bd763a1ca92.
>
> Due to this bug, windows guests complain 'This device cannot find
> enough free resources it can use' in the device manager panel for extended
> IO buses. This issue also breaks the correct functioning of pci hotplug as the
> following shows that the IO space for pci hotplug has been truncated:
>
> (qemu) info mtree -f
> FlatView #0
>  AS "I/O", root: io
>  Root memory region: io
>   0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
>   0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug
>
> Therefore, in this fix, we adjust the IO address range for the acpi pci
> hotplug so that it does not conflict with cpu hotplug and there is no
> truncation of IO spaces. The starting IO address of PCI hotplug region
> has been decremented by four bytes in order to accomodate

same

> four byte
> increment in the IO address space introduced by change
> b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")
>
> After fixing, the following are the corrected IO ranges:
>
> 0600-0603 (prio 0, i/o): acpi-evt
> 0604-0605 (prio 0, i/o): acpi-cnt
> 0608-060b (prio 0, i/o): acpi-tmr
> 0620-062f (prio 0, i/o): acpi-gpe0
> 0630-0637 (prio 0, i/o): acpi-smi
> 0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
> 0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug
>
> This change has been tested using a Windows Server 2019 guest VM. Windows
> no longer complains after this change.
>
> Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
> Q35")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561
>
> Signed-off-by: Ani Sinha 

On the code itself:
Reviewed-by: Julia Suvorova 


> ---
>  include/hw/acpi/ich9.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index a329ce43ab..f04f1791bd 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -29,7 +29,7 @@
>  #include "hw/acpi/acpi_dev_interface.h"
>  #include "hw/acpi/tco.h"
>
> -#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
> +#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
>
>  typedef struct ICH9LPCPMRegs {
>  /*
> --
> 2.25.1
>




Re: hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-14 Thread Igor Mammedov
On Tue, 14 Sep 2021 10:24:07 +0530
Ani Sinha  wrote:

> Hi Igor/Michael :
> 
> This patchset fixes the acpi pci hotplug IO address range conflict issue with 
> cpu hotplug.
> This issue has been reported here:
> https://gitlab.com/qemu-project/qemu/-/issues/561
> 
> We have disucssed this issue at length here:
> https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html
> 
> This issue affects Qemu version 6.1.

CCing stable




Re: [PATCH 2/3] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-14 Thread Igor Mammedov
On Tue, 14 Sep 2021 10:24:09 +0530
Ani Sinha  wrote:

> Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
> Q35")
> selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
> starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
> written but the final version of the patch was not yet pushed upstream, this
> address range was free and did not conflict with any other IO address ranges.
> However, with the following change, this address range was no
> longer conflict free as in this change, the IO address range
> (value of ACPI_PCIHP_SIZE) was incremented by four bytes:
> 
> b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")
> 
> This can be seen from the output of QMP command 'info mtree' :
> 
> 0600-0603 (prio 0, i/o): acpi-evt
> 0604-0605 (prio 0, i/o): acpi-cnt
> 0608-060b (prio 0, i/o): acpi-tmr
> 0620-062f (prio 0, i/o): acpi-gpe0
> 0630-0637 (prio 0, i/o): acpi-smi
> 0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
> 0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug
> 
> It shows that there is a region of conflict between IO regions of acpi
> pci hotplug and acpi cpu hotplug.
> 
> Unfortunately, the change caf108bc58790 did not update the IO address range
> appropriately before it was pushed upstream to accomodate the increased
> length of the IO address space introduced in change b32bd763a1ca92.
> 
> Due to this bug, windows guests complain 'This device cannot find
> enough free resources it can use' in the device manager panel for extended
> IO buses. This issue also breaks the correct functioning of pci hotplug as the
> following shows that the IO space for pci hotplug has been truncated:
> 
> (qemu) info mtree -f
> FlatView #0
>  AS "I/O", root: io
>  Root memory region: io
>   0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
>   0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug
> 
> Therefore, in this fix, we adjust the IO address range for the acpi pci
> hotplug so that it does not conflict with cpu hotplug and there is no
> truncation of IO spaces. The starting IO address of PCI hotplug region
> has been decremented by four bytes in order to accomodate four byte
> increment in the IO address space introduced by change
> b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")
> 
> After fixing, the following are the corrected IO ranges:
> 
> 0600-0603 (prio 0, i/o): acpi-evt
> 0604-0605 (prio 0, i/o): acpi-cnt
> 0608-060b (prio 0, i/o): acpi-tmr
> 0620-062f (prio 0, i/o): acpi-gpe0
> 0630-0637 (prio 0, i/o): acpi-smi
> 0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
> 0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug
> 
> This change has been tested using a Windows Server 2019 guest VM. Windows
> no longer complains after this change.
> 
> Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
> Q35")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561
> 
> Signed-off-by: Ani Sinha 

Reviewed-by: Igor Mammedov 

> ---
>  include/hw/acpi/ich9.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
> index a329ce43ab..f04f1791bd 100644
> --- a/include/hw/acpi/ich9.h
> +++ b/include/hw/acpi/ich9.h
> @@ -29,7 +29,7 @@
>  #include "hw/acpi/acpi_dev_interface.h"
>  #include "hw/acpi/tco.h"
>  
> -#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
> +#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
>  
>  typedef struct ICH9LPCPMRegs {
>  /*




[PATCH 2/3] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-13 Thread Ani Sinha
Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It
starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was
written but the final version of the patch was not yet pushed upstream, this
address range was free and did not conflict with any other IO address ranges.
However, with the following change, this address range was no
longer conflict free as in this change, the IO address range
(value of ACPI_PCIHP_SIZE) was incremented by four bytes:

b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

This can be seen from the output of QMP command 'info mtree' :

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc4-0cdb (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

It shows that there is a region of conflict between IO regions of acpi
pci hotplug and acpi cpu hotplug.

Unfortunately, the change caf108bc58790 did not update the IO address range
appropriately before it was pushed upstream to accomodate the increased
length of the IO address space introduced in change b32bd763a1ca92.

Due to this bug, windows guests complain 'This device cannot find
enough free resources it can use' in the device manager panel for extended
IO buses. This issue also breaks the correct functioning of pci hotplug as the
following shows that the IO space for pci hotplug has been truncated:

(qemu) info mtree -f
FlatView #0
 AS "I/O", root: io
 Root memory region: io
  0cc4-0cd7 (prio 0, i/o): acpi-pci-hotplug
  0cd8-0cf7 (prio 0, i/o): acpi-cpu-hotplug

Therefore, in this fix, we adjust the IO address range for the acpi pci
hotplug so that it does not conflict with cpu hotplug and there is no
truncation of IO spaces. The starting IO address of PCI hotplug region
has been decremented by four bytes in order to accomodate four byte
increment in the IO address space introduced by change
b32bd763a1ca92 ("pci: introduce acpi-index property for PCI device")

After fixing, the following are the corrected IO ranges:

0600-0603 (prio 0, i/o): acpi-evt
0604-0605 (prio 0, i/o): acpi-cnt
0608-060b (prio 0, i/o): acpi-tmr
0620-062f (prio 0, i/o): acpi-gpe0
0630-0637 (prio 0, i/o): acpi-smi
0cc0-0cd7 (prio 0, i/o): acpi-pci-hotplug
0cd8-0ce3 (prio 0, i/o): acpi-cpu-hotplug

This change has been tested using a Windows Server 2019 guest VM. Windows
no longer complains after this change.

Fixes: caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to 
Q35")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/561

Signed-off-by: Ani Sinha 
---
 include/hw/acpi/ich9.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index a329ce43ab..f04f1791bd 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -29,7 +29,7 @@
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/tco.h"
 
-#define ACPI_PCIHP_ADDR_ICH9 0x0cc4
+#define ACPI_PCIHP_ADDR_ICH9 0x0cc0
 
 typedef struct ICH9LPCPMRegs {
 /*
-- 
2.25.1




hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-09-13 Thread Ani Sinha
Hi Igor/Michael :

This patchset fixes the acpi pci hotplug IO address range conflict issue with 
cpu hotplug.
This issue has been reported here:
https://gitlab.com/qemu-project/qemu/-/issues/561

We have disucssed this issue at length here:
https://lists.gnu.org/archive/html/qemu-devel/2021-09/msg02146.html

This issue affects Qemu version 6.1.

Patch 1 : allows q35 DSDT table changes.
Patch 2 : actual fix.
Patch 3: updates DSDT table blobs.

Thanks
ani