The branch main has been updated by royger:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5f7000832791716e63ca8481d6e5784915786ce0

commit 5f7000832791716e63ca8481d6e5784915786ce0
Author:     Julien Grall <jul...@xen.org>
AuthorDate: 2015-10-16 18:26:35 +0000
Commit:     Roger Pau Monné <roy...@freebsd.org>
CommitDate: 2021-07-28 15:27:04 +0000

    xen/netfront: introduce xen_pv_nics_disabled()
    
    ARM guest is considered as HVM but it only supports PV nics (no
    emulation available).
    
    Submitted by: Elliott Mitchell <ehem+free...@m5p.com>
    Reviewed by: royger
    Differential Revision: https://reviews.freebsd.org/D29405
---
 sys/dev/xen/netfront/netfront.c |  2 +-
 sys/x86/include/xen/xen-os.h    | 10 ++++++++++
 sys/xen/xen-os.h                |  1 -
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 4b8bd5589283..fd2d97a7c70c 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -378,7 +378,7 @@ static int
 netfront_probe(device_t dev)
 {
 
-       if (xen_hvm_domain() && xen_disable_pv_nics != 0)
+       if (xen_pv_nics_disabled())
                return (ENXIO);
 
        if (!strcmp(xenbus_get_type(dev), "vif")) {
diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h
index 7ca1075e61f3..a6766190bfc2 100644
--- a/sys/x86/include/xen/xen-os.h
+++ b/sys/x86/include/xen/xen-os.h
@@ -43,6 +43,16 @@
 /* If non-zero, the hypervisor has been configured to use a direct vector */
 extern int xen_vector_callback_enabled;
 
+/* tunable for disabling PV nics */
+extern int xen_disable_pv_nics;
+
+static inline bool
+xen_pv_nics_disabled(void)
+{
+
+       return (xen_hvm_domain() && xen_disable_pv_nics != 0);
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_X86_XEN_XEN_OS_H_ */
diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h
index 3b963bd20f7a..6817e96c10fc 100644
--- a/sys/xen/xen-os.h
+++ b/sys/xen/xen-os.h
@@ -75,7 +75,6 @@ xen_get_console_evtchn(void)
 extern shared_info_t *HYPERVISOR_shared_info;
 
 extern int xen_disable_pv_disks;
-extern int xen_disable_pv_nics;
 
 extern bool xen_suspend_cancelled;
 
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to