On 3/11/25 16:13, Stewart Hildebrand wrote:
> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
> index 807401b2eaa2..e355329913ef 100644
> --- a/xen/include/xen/vpci.h
> +++ b/xen/include/xen/vpci.h
> @@ -311,6 +311,18 @@ static inline int __must_check vpci_reset_device(struct
> pci_dev *pdev)
> return vpci_assign_device(pdev);
> }
>
> +#ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
> +bool vpci_translate_virtual_device(struct domain *d, pci_sbdf_t *sbdf);
> +#else
> +static inline bool vpci_translate_virtual_device(struct domain *d,
> + pci_sbdf_t *sbdf)
> +{
> + ASSERT_UNREACHABLE();
Unfortunately this leads to a warning in the vpci test suite:
In file included from emul.h:88,
from vpci.c:18:
vpci.h: In function ‘vpci_translate_virtual_device’:
vpci.h:317:5: warning: implicit declaration of function ‘ASSERT_UNREACHABLE’
[-Wimplicit-function-declaration]
317 | ASSERT_UNREACHABLE();
| ^~~~~~~~~~~~~~~~~~
... which can be fixed by doing:
--- a/tools/tests/vpci/emul.h
+++ b/tools/tests/vpci/emul.h
@@ -85,6 +85,10 @@ typedef union {
} pci_sbdf_t;
#define CONFIG_HAS_VPCI
+
+#define BUG() assert(0)
+#define ASSERT_UNREACHABLE() assert(0)
+
#include "vpci.h"
#define __hwdom_init
@@ -112,9 +116,6 @@ typedef union {
#define PCI_CFG_SPACE_EXP_SIZE 4096
-#define BUG() assert(0)
-#define ASSERT_UNREACHABLE() assert(0)
-
#endif
/*
I'll send v18...