[PATCH v2 4/8] pci-stub: add more MSI functions

Paolo Bonzini posted 8 patches 6 years, 1 month ago
Maintainers: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>, Aleksandar Markovic <amarkovic@wavecomp.com>, Marcelo Tosatti <mtosatti@redhat.com>, Igor Mammedov <imammedo@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, "Michael S. Tsirkin" <mst@redhat.com>, Sergio Lopez <slp@redhat.com>, Helge Deller <deller@gmx.de>, Paolo Bonzini <pbonzini@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Richard Henderson <rth@twiddle.net>, Eduardo Habkost <ehabkost@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
[PATCH v2 4/8] pci-stub: add more MSI functions
Posted by Paolo Bonzini 6 years, 1 month ago
On x86, KVM needs some function from the PCI subsystem in order to set
up interrupt routes.  Provide some stubs to support x86 machines that
lack PCI.

Reviewed-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pci/pci-stub.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index c04a5df..cc2a2e1 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -26,6 +26,7 @@
 #include "qapi/qmp/qerror.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/msi.h"
+#include "hw/pci/msix.h"
 
 bool msi_nonbroken;
 bool pci_available;
@@ -64,3 +65,29 @@ void msi_notify(PCIDevice *dev, unsigned int vector)
 {
     g_assert_not_reached();
 }
+
+/* Required by target/i386/kvm.c */
+bool msi_is_masked(const PCIDevice *dev, unsigned vector)
+{
+    g_assert_not_reached();
+}
+
+MSIMessage msi_get_message(PCIDevice *dev, unsigned int vector)
+{
+    g_assert_not_reached();
+}
+
+int msix_enabled(PCIDevice *dev)
+{
+    return false;
+}
+
+bool msix_is_masked(PCIDevice *dev, unsigned vector)
+{
+    g_assert_not_reached();
+}
+
+MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector)
+{
+    g_assert_not_reached();
+}
-- 
1.8.3.1



Re: [PATCH v2 4/8] pci-stub: add more MSI functions
Posted by Philippe Mathieu-Daudé 6 years, 1 month ago
On 12/12/19 6:29 PM, Paolo Bonzini wrote:
> On x86, KVM needs some function from the PCI subsystem in order to set
> up interrupt routes.  Provide some stubs to support x86 machines that
> lack PCI.
> 
> Reviewed-by: Sergio Lopez <slp@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   hw/pci/pci-stub.c | 27 +++++++++++++++++++++++++++
>   1 file changed, 27 insertions(+)
> 
> diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
> index c04a5df..cc2a2e1 100644
> --- a/hw/pci/pci-stub.c
> +++ b/hw/pci/pci-stub.c
> @@ -26,6 +26,7 @@
>   #include "qapi/qmp/qerror.h"
>   #include "hw/pci/pci.h"
>   #include "hw/pci/msi.h"
> +#include "hw/pci/msix.h"
>   
>   bool msi_nonbroken;
>   bool pci_available;
> @@ -64,3 +65,29 @@ void msi_notify(PCIDevice *dev, unsigned int vector)
>   {
>       g_assert_not_reached();
>   }
> +
> +/* Required by target/i386/kvm.c */
> +bool msi_is_masked(const PCIDevice *dev, unsigned vector)
> +{
> +    g_assert_not_reached();
> +}
> +
> +MSIMessage msi_get_message(PCIDevice *dev, unsigned int vector)
> +{
> +    g_assert_not_reached();
> +}
> +
> +int msix_enabled(PCIDevice *dev)
> +{
> +    return false;
> +}
> +
> +bool msix_is_masked(PCIDevice *dev, unsigned vector)
> +{
> +    g_assert_not_reached();
> +}
> +
> +MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector)
> +{
> +    g_assert_not_reached();
> +}
>