[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 for-4.11] kconfig: don't select VPCI if building a shim-only binary



Add dummy replacements for some functions used outside of the vpci
code, and also a guard in vmsi.c to prevent vpci arch specific helpers
from being compiled if the option is not selected.

Reported-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/Kconfig    |  2 +-
 xen/arch/x86/hvm/vmsi.c |  2 ++
 xen/include/xen/vpci.h  | 26 ++++++++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index c405c4bf4f..f64fc56739 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -23,7 +23,7 @@ config X86
        select HAS_PCI
        select HAS_PDX
        select HAS_UBSAN
-       select HAS_VPCI
+       select HAS_VPCI if !PV_SHIM_EXCLUSIVE
        select NUMA
 
 config ARCH_DEFCONFIG
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index c31d27c389..900d4f67d4 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -624,6 +624,7 @@ void msix_write_completion(struct vcpu *v)
         gdprintk(XENLOG_WARNING, "MSI-X write completion failure\n");
 }
 
+#ifdef CONFIG_HAS_VPCI
 static unsigned int msi_gflags(uint16_t data, uint64_t addr, bool masked)
 {
     /*
@@ -867,3 +868,4 @@ int vpci_msix_arch_print(const struct vpci_msix *msix)
 
     return 0;
 }
+#endif /* CONFIG_HAS_VPCI */
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 29616624ad..1d7147367e 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -210,6 +210,32 @@ static inline unsigned int vmsix_entry_nr(const struct 
vpci_msix *msix,
 
 #else /* !CONFIG_HAS_VPCI */
 struct vpci_vcpu {};
+
+static inline int vpci_add_handlers(struct pci_dev *pdev)
+{
+    return 0;
+}
+
+static inline void vpci_dump_msi(void) { }
+
+static inline uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg,
+                                 unsigned int size)
+{
+    ASSERT_UNREACHABLE();
+    return ~(uint32_t)0;
+}
+
+static inline void vpci_write(pci_sbdf_t sbdf, unsigned int reg,
+                              unsigned int size, uint32_t data)
+{
+    ASSERT_UNREACHABLE();
+}
+
+static inline bool __must_check vpci_process_pending(struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+    return false;
+}
 #endif
 
 #endif
-- 
2.16.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.