Skip to contentSkip to conversation

include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH

PATCH Applied Murilo Opsfelder Araujo 4 participants 9 messages Jul 18, 2017 – Jul 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 include/linux/vfio.h: Guard powerpc-specific functions with CONFIG_VFIO_SPAPR_EEH

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

 include/linux/vfio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/vfio.h +2 -2
index 586809a..a47b985 100644
@@ -152,7 +152,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
 					      size_t *data_size);
 
 struct pci_dev;
-#ifdef CONFIG_EEH
+#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH)
 extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
 extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
 extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
@@ -173,7 +173,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
 {
 	return -ENOTTY;
 }
-#endif /* CONFIG_EEH */
+#endif /* CONFIG_VFIO_SPAPR_EEH */
 
 /*
  * IRQfd - generic

--
2.9.4

#1 lore raw
Quoted 19 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

Quoted 7 lines
    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

Hi, Alex.

Are you applying this?

Thanks!

Signature · 1 line
Murilo
#2 lore raw

[cc +Alexey, David]

Any comments from the usual suspects for vfio/spapr? Thanks,

Alex

Quoted 34 lines · On Tue, 25 Jul 2017 10:56:38 -0300 Murilo Opsfelder Araújo…
Quoted 19 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

Quoted 7 lines
    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

Hi, Alex.

Are you applying this?

Thanks!

#3 lore raw
Quoted 3 lines · Alex Williamson

[cc +Alexey, David]

Any comments from the usual suspects for vfio/spapr? Thanks,

Having EEH + VFIO_PCI and not having VFIO_SPAPR_EEH does not make practical sense and won't be seen in the wild so EEH + VFIO should enforce VFIO_SPAPR_EEH but this is for another patch.

Quoted 41 lines

Alex

Quoted 34 lines · On Tue, 25 Jul 2017 10:56:38 -0300 Murilo Opsfelder Araújo…
Quoted 19 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

Quoted 7 lines
    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

Hi, Alex.

Are you applying this?

Thanks!

Signature · 1 line
Alexey
#4 lore raw
In reply to Alex Williamson
Quoted 3 lines · Alex Williamson

[cc +Alexey, David]

Any comments from the usual suspects for vfio/spapr? Thanks,

[trying again as mailists rejected the previous response]

Having EEH + VFIO_PCI and not having VFIO_SPAPR_EEH does not make practical sense and won't be seen in the wild so EEH + VFIO should enforce VFIO_SPAPR_EEH but this is for another patch.

Quoted 41 lines

Alex

Quoted 34 lines · On Tue, 25 Jul 2017 10:56:38 -0300 Murilo Opsfelder Araújo…
Quoted 19 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

Quoted 7 lines
    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

Hi, Alex.

Are you applying this?

Thanks!

Signature · 1 line
Alexey
#5 lore raw
In reply to Alex Williamson
Quoted 3 lines · Alex Williamson

[cc +Alexey, David]

Any comments from the usual suspects for vfio/spapr? Thanks,

[trying once again as mailists rejected the previous response due to broken outgoing mail encoding config in my thunderbird]

Having EEH + VFIO_PCI and not having VFIO_SPAPR_EEH does not make practical sense and won't be seen in the wild so EEH + VFIO should enforce VFIO_SPAPR_EEH but this is for another patch.

Quoted 41 lines

Alex

Quoted 34 lines · On Tue, 25 Jul 2017 10:56:38 -0300 Murilo Opsfelder Araújo…
Quoted 19 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

This issue was found during a randconfig build. Logs are here:

Quoted 7 lines
    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Changes from v1:
- Rebased on top of next-20170718.

Hi, Alex.

Are you applying this?

Thanks!

Signature · 1 line
Alexey
Reviewed-by on v2 1/1
#6 lore raw
In reply to Murilo Opsfelder Araujo
Quoted 17 lines · Murilo Opsfelder Araujo

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

Quoted 5 lines

This issue was found during a randconfig build. Logs are here:

    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/
Quoted 30 lines

---

Changes from v1:
- Rebased on top of next-20170718.

 include/linux/vfio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/vfio.h +2 -2
index 586809a..a47b985 100644
@@ -152,7 +152,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
 					      size_t *data_size);
 
 struct pci_dev;
-#ifdef CONFIG_EEH
+#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH)
 extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
 extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
 extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
@@ -173,7 +173,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
 {
 	return -ENOTTY;
 }
-#endif /* CONFIG_EEH */
+#endif /* CONFIG_VFIO_SPAPR_EEH */
 
 /*
  * IRQfd - generic
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#7 lore raw
In reply to Murilo Opsfelder Araujo
Quoted 17 lines · On Tue, 18 Jul 2017 14:22:20 -0300 Murilo Opsfelder Araujo…

When CONFIG_EEH=y and CONFIG_VFIO_SPAPR_EEH=n, build fails with the following:

drivers/vfio/pci/vfio_pci.o: In function `.vfio_pci_release':
vfio_pci.c:(.text+0xa98): undefined reference to .vfio_spapr_pci_eeh_release' drivers/vfio/pci/vfio_pci.o: In function .vfio_pci_open':
vfio_pci.c:(.text+0x1420): undefined reference to `.vfio_spapr_pci_eeh_open'

In this case, vfio_pci.c should use the empty definitions of vfio_spapr_pci_eeh_open and vfio_spapr_pci_eeh_release functions.

This patch fixes it by guarding these function definitions with CONFIG_VFIO_SPAPR_EEH, the symbol that controls whether vfio_spapr_eeh.c is built, which is where the non-empty versions of these functions are. We need to make use of IS_ENABLED() macro because CONFIG_VFIO_SPAPR_EEH is a tristate option.

Quoted 6 lines

This issue was found during a randconfig build. Logs are here:

    http://kisskb.ellerman.id.au/kisskb/buildresult/12982362/

---

Applied to my for-linus branch with David and Alexey's R-b for v4.13. Thanks,

Alex

Quoted 31 lines

Changes from v1:
- Rebased on top of next-20170718.

 include/linux/vfio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/vfio.h +2 -3
index 586809a..a47b985 100644
@@ -152,7 +152,7 @@ extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
 					      size_t *data_size);
 
 struct pci_dev;
-#ifdef CONFIG_EEH
+#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH)
 extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
 extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
 extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
@@ -173,7 +173,7 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
 {
 	return -ENOTTY;
 }
-#endif /* CONFIG_EEH */
+#endif /* CONFIG_VFIO_SPAPR_EEH */
 
 /*
  * IRQfd - generic
--

2.9.4

#8 lore raw

On 07/26/2017 04:37 PM, Alex Williamson wrote:
[...]

Quoted 4 lines

Applied to my for-linus branch with David and Alexey's R-b for v4.13. Thanks,

Alex

Thank you all!

Signature · 1 line
Murilo