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

[Xen-changelog] [xen master] kconfig: don't select VPCI if building a shim-only binary



commit 7fbb096bf345a4a441d595ee2efa032517e05c08
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Mar 27 16:30:26 2018 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed Mar 28 13:54:46 2018 +0100

    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>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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..72d2225a97 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 vpci_process_pending(struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+    return false;
+}
 #endif
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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