Skip to contentSkip to conversation

hw/vfio/pci-quirks: Fix broken legacy IGD passthrough

PATCH In review Thomas Huth 4 participants 12 messages Jun 10, 2020 – Aug 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/vfio/pci-quirks: Fix broken legacy IGD passthrough

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +1 -0
index f2155ddb1d..3158390db1 100644
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"
 #include "exec/memop.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
Signature · 1 line
2.18.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")
Quoted 10 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644

hw/vfio/pci-quirks.c line 14

Quoted 4 lines
hw/vfio/pci-quirks.c +1 -0
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

Quoted 4 lines
hw/vfio/pci-quirks.c +0 -0
 #include "exec/memop.h"
 #include "qemu/units.h"
 #include "qemu/error-report.h"
#2 lore raw
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 12 lines
Quoted 12 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644
@@ -11,6 +11,7 @@
  */
 
Quoted 5 lines

hw/vfio/pci-quirks.c line 14

Quoted 2 lines
hw/vfio/pci-quirks.c +1 -0
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code... thus this likely needs some work and discussion of the patch first, so I think we should go with this change to pci-quirks.c here first to get the regression fixed ASAP.

Thomas

#3 lore raw
Quoted 37 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 12 lines
Quoted 12 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644
@@ -11,6 +11,7 @@
  */
 
Quoted 5 lines

hw/vfio/pci-quirks.c line 14

Quoted 2 lines
hw/vfio/pci-quirks.c +1 -0
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

Quoted 4 lines

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

We only need it for the files under hw/, right?

Quoted 3 lines

thus this likely needs some work and discussion of the patch first, so I think we should go with this change to pci-quirks.c here first to get the regression fixed ASAP.

Sure, I'm not objecting that.

Quoted 3 lines

Thomas

#4 lore raw
Quoted 38 lines · Philippe Mathieu-Daudé
Quoted 37 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 17 lines
Quoted 10 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644

hw/vfio/pci-quirks.c line 14

Quoted 4 lines
hw/vfio/pci-quirks.c +1 -0
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

Quoted 6 lines
Quoted 4 lines

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

We only need it for the files under hw/, right?

qtest.c in the main directory includes it, too.

Quoted 5 lines
Quoted 3 lines

thus this likely needs some work and discussion of the patch first, so I think we should go with this change to pci-quirks.c here first to get the regression fixed ASAP.

Sure, I'm not objecting that.

Sure, I just wanted to make sure that whoever (Alex?) picks up this patch does not wait for that other solution instead.

Thomas

#5 lore raw
Quoted 39 lines · Thomas Huth
Quoted 38 lines · Philippe Mathieu-Daudé
Quoted 37 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 17 lines
Quoted 10 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644

hw/vfio/pci-quirks.c line 14

Quoted 4 lines
hw/vfio/pci-quirks.c +1 -0
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

We only need it for the files under hw/, right?

qtest.c in the main directory includes it, too.

hw/ and qtests could include "hw/hw.h" instead of affecting all the codebase via "qemu/osdep.h".

*but* we have qdevs in target/ too... so either we think about cleaning them, or we accept it is a lost cause (micro-architecture bits are tied with hardware) and are doomed.

Quoted 12 lines
Quoted 6 lines
Quoted 4 lines

thus this likely needs some work and discussion of the patch first, so I think we should go with this change to pci-quirks.c here first to get the regression fixed ASAP.

Sure, I'm not objecting that.

Sure, I just wanted to make sure that whoever (Alex?) picks up this patch does not wait for that other solution instead.

Thomas

#6 lore raw
Quoted 45 lines · Philippe Mathieu-Daudé
Quoted 44 lines · Thomas Huth
Quoted 43 lines · Philippe Mathieu-Daudé
Quoted 41 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 12 lines
Quoted 12 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644
@@ -11,6 +11,7 @@
  */
 
Quoted 5 lines

hw/vfio/pci-quirks.c line 14

Quoted 2 lines
hw/vfio/pci-quirks.c +1 -0
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

We only need it for the files under hw/, right?

qtest.c in the main directory includes it, too.

hw/ and qtests could include "hw/hw.h" instead of affecting all the codebase via "qemu/osdep.h".

I don't think that's a good idea - in that case, you have to make sure to include hw/hw.h everywhere again, so you don't gain that much compared to including config-devices.h directly everywhere. osdep.h is our header that has to be included everywhere, so if we want to make sure that these defines are available everywhere, we have to include it from osdep.h.
Apart from that, hw/hw.h just contains one more prototype - which likely should be renamed to cpu_hw_error() and moved to a cpu header instead, so that we can finally delete hw/hw.h completely.

Thomas

#7 lore raw
Quoted 53 lines · Thomas Huth
Quoted 45 lines · Philippe Mathieu-Daudé
Quoted 44 lines · Thomas Huth
Quoted 43 lines · Philippe Mathieu-Daudé
Quoted 41 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 12 lines
Quoted 12 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644
@@ -11,6 +11,7 @@
  */
 
Quoted 5 lines

hw/vfio/pci-quirks.c line 14

Quoted 2 lines
hw/vfio/pci-quirks.c +1 -0
 #include "qemu/osdep.h"
+#include "config-devices.h"

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

We only need it for the files under hw/, right?

qtest.c in the main directory includes it, too.

hw/ and qtests could include "hw/hw.h" instead of affecting all the codebase via "qemu/osdep.h".

Quoted 9 lines

I don't think that's a good idea - in that case, you have to make sure to include hw/hw.h everywhere again, so you don't gain that much compared to including config-devices.h directly everywhere. osdep.h is our header that has to be included everywhere, so if we want to make sure that these defines are available everywhere, we have to include it from osdep.h.
Apart from that, hw/hw.h just contains one more prototype - which likely should be renamed to cpu_hw_error() and moved to a cpu header instead, so that we can finally delete hw/hw.h completely.

Yes, this discussion implied the "hw/hw.h" cleanup talked elsewhere is done.

#9 lore raw
In reply to Thomas Huth

Le 10/06/2020 à 09:50, Thomas Huth a écrit :

Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Thomas Huth
Quoted 8 lines

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

Quoted 7 lines
Quoted 3 lines

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

you can add in your ~/.gitconfig

[alias]

        showfix = log -1 --format=fixes
[pretty]
        fixes = Fixes: %h (\"%s\")%nCc: %ae

and then:

$ git showfix 29d62771c81d8fd244a67c14a1d968c268d3fb19
Fixes: 29d62771c81d ("hw/vfio: Move the IGD quirk code to a separate file")

Thanks,
Laurent

#10 lore raw
Quoted 23 lines · Laurent Vivier

Le 10/06/2020 à 09:50, Thomas Huth a écrit :

Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Thomas Huth
Quoted 8 lines

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

Quoted 7 lines
Quoted 3 lines

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

you can add in your ~/.gitconfig

[alias]

Quoted 8 lines
        showfix = log -1 --format=fixes
[pretty]
        fixes = Fixes: %h (\"%s\")%nCc: %ae

and then:

$ git showfix 29d62771c81d8fd244a67c14a1d968c268d3fb19
Fixes: 29d62771c81d ("hw/vfio: Move the IGD quirk code to a separate file")

That's nice, thanks! I've put it now in my gitconfig :-)

Thomas

#8 lore raw
In reply to Thomas Huth
Quoted 48 lines · On Wed, 10 Jun 2020 09:59:35 +0200 Thomas Huth <[email protected]> wrote:
Quoted 38 lines · Philippe Mathieu-Daudé
Quoted 37 lines · Thomas Huth
Quoted 6 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Quoted 7 lines
Quoted 3 lines
Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 17 lines
Quoted 10 lines
---
 hw/vfio/pci-quirks.c | 1 +
 1 file changed, 1 insertion(+)
hw/vfio/pci-quirks.c +0 -0
index f2155ddb1d..3158390db1 100644

hw/vfio/pci-quirks.c line 14

Quoted 4 lines
hw/vfio/pci-quirks.c +1 -0
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"  

I've been wondering how we can avoid that mistake in the future, but can find anything beside human review.

Quoted 6 lines
Quoted 4 lines

I think in the long term, we should include config-devices.h in osdep.h, just like config-host.h and config-target.h is already included there. Everything else is just too confusing. But then we should also add a mechanism to poison the switches from config-devices.h in common code...

We only need it for the files under hw/, right?

qtest.c in the main directory includes it, too.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

thus this likely needs some work and discussion of the patch first, so I think we should go with this change to pci-quirks.c here first to get the regression fixed ASAP.

Sure, I'm not objecting that.

Sure, I just wanted to make sure that whoever (Alex?) picks up this patch does not wait for that other solution instead.

Yep, I'll grab it, I've got one less-trivial patch to send a pull request for anyway. Thanks,

Alex

#11 lore raw
In reply to Laurent Vivier
Quoted 20 lines · Laurent Vivier
Quoted 11 lines · Thomas Huth
Quoted 10 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Thomas Huth

The #ifdef CONFIG_VFIO_IGD in pci-quirks.c is not working since the required header config-devices.h is not included, so that the legacy IGD passthrough is currently broken. Let's include the right header to fix this issue.

Fixes 29d62771c81d8fd244a67c14a1d968c268d3fb19

("hw/vfio: Move the IGD quirk code to a separate file")

Quoted 7 lines
Quoted 3 lines

What about shorter tag?

Fixes 29d62771c81 ("vfio: Move the IGD quirk code to a separate file")

I always forget whether to use the short or the long version for "Fixes:" ... this can hopefully be fixed (if necessary) when the patch gets picked up.

Quoted 6 lines

you can add in your ~/.gitconfig

[alias]

        showfix = log -1 --format=fixes
[pretty]
        fixes = Fixes: %h (\"%s\")%nCc: %ae

From git-show (1):

· %ae: author email
· %aE: author email (respecting .mailmap, see
git-shortlog(1) or git-blame(1))

Since we have .mailmap, the %aE form is highly recommended:

With %ae:

$ git showfix 3e3d5815cbc1fdbf33adbe55f63ede3acead886f
Fixes: 3e3d5815cb ("NAND Flash memory emulation and ECC calculation
helpers for use by NAND controllers.")
Cc: balrog@c046a42c-6fe2-441c-8c8c-71466251a162

With %aE:

$ git showfix 3e3d5815cbc1fdbf33adbe55f63ede3acead886f
Fixes: 3e3d5815cb ("NAND Flash memory emulation and ECC calculation
helpers for use by NAND controllers.")
Cc: [email protected]
Quoted 9 lines

and then:

$ git showfix 29d62771c81d8fd244a67c14a1d968c268d3fb19
Fixes: 29d62771c81d ("hw/vfio: Move the IGD quirk code to a separate file")

Thanks,
Laurent