Files
Centos-kernel-stream-9/include/linux/hypervisor.h
T
Myron Stowe 97af252723 PCI: Extend isolated function probing to s390
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2124638
Upstream Status: 189c6c33ff421def040b904fb14ef76c5bf5af4c

commit 189c6c33ff421def040b904fb14ef76c5bf5af4c
Author: Niklas Schnelle <schnelle@linux.ibm.com>
Date:   Tue Jun 28 16:30:59 2022 +0200

    PCI: Extend isolated function probing to s390

    Like the jailhouse hypervisor, s390's PCI architecture allows passing
    isolated PCI functions to a guest OS instance. As of now this is was not
    utilized even with multi-function support as the s390 PCI code makes sure
    that only virtual PCI busses including a function with devfn 0 are
    presented to the PCI subsystem. A subsequent change will remove this
    restriction.

    Allow probing such functions by replacing the existing check for
    jailhouse_paravirt() with a new hypervisor_isolated_pci_functions() helper.

    Link: https://lore.kernel.org/r/20220628143100.3228092-5-schnelle@linux.ibm.com
    Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
    Cc: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Myron Stowe <mstowe@redhat.com>
2022-10-02 07:34:17 -06:00

44 lines
748 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_HYPEVISOR_H
#define __LINUX_HYPEVISOR_H
/*
* Generic Hypervisor support
* Juergen Gross <jgross@suse.com>
*/
#ifdef CONFIG_X86
#include <asm/jailhouse_para.h>
#include <asm/x86_init.h>
static inline void hypervisor_pin_vcpu(int cpu)
{
x86_platform.hyper.pin_vcpu(cpu);
}
#else /* !CONFIG_X86 */
#include <linux/of.h>
static inline void hypervisor_pin_vcpu(int cpu)
{
}
static inline bool jailhouse_paravirt(void)
{
return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
}
#endif /* !CONFIG_X86 */
static inline bool hypervisor_isolated_pci_functions(void)
{
if (IS_ENABLED(CONFIG_S390))
return true;
return jailhouse_paravirt();
}
#endif /* __LINUX_HYPEVISOR_H */