Like s390 and the jailhouse hypervisor, LoongArch's PCI architecture
allows passing isolated PCI functions to a guest OS instance. So it is
possible that there is a multi-function device without function 0 for
the host or guest.

Allow probing such functions by adding a IS_ENABLED(CONFIG_LOONGARCH)
case in the hypervisor_isolated_pci_functions() helper.

This is similar to commit 189c6c33ff421def040b9 ("PCI: Extend isolated
function probing to s390").

Cc: <sta...@vger.kernel.org>
Signed-off-by: Huacai Chen <chenhua...@loongson.cn>
---
 include/linux/hypervisor.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h
index 9efbc54e35e5..be5417303ecf 100644
--- a/include/linux/hypervisor.h
+++ b/include/linux/hypervisor.h
@@ -37,6 +37,9 @@ static inline bool hypervisor_isolated_pci_functions(void)
        if (IS_ENABLED(CONFIG_S390))
                return true;
 
+       if (IS_ENABLED(CONFIG_LOONGARCH))
+               return true;
+
        return jailhouse_paravirt();
 }
 
-- 
2.47.1


Reply via email to