]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
kconfig: don't select VPCI if building a shim-only binary
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 27 Mar 2018 15:30:26 +0000 (16:30 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 28 Mar 2018 12:54:46 +0000 (13:54 +0100)
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@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/Kconfig
xen/arch/x86/hvm/vmsi.c
xen/include/xen/vpci.h

index c405c4bf4f2c9d3c2d8c1bb56fce385251a8d6e5..f64fc567395fbd66376a64947a36dea0152b2123 100644 (file)
@@ -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
index c31d27c389833bb3880fcb027166045a8d53101b..900d4f67d4ec45fdc727377e157e4bb1cdde8bd1 100644 (file)
@@ -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 */
index 29616624add6b7de759dc4b7bc6b139a388ed0e5..72d2225a97d3a09f9946af61e3e99f23536bfebe 100644 (file)
@@ -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 vpci_process_pending(struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+    return false;
+}
 #endif
 
 #endif