From 2117a66af54f63cc474b4358bbb6967267e452cb Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Thu, 6 May 2021 18:16:10 -0300 Subject: [PATCH] xen: remove hypervisor_info This was a source of indirection needed to support PVHv1. Now that that support has been removed, we can eliminate it. Reviewed by: royger --- sys/x86/xen/hvm.c | 44 -------------------------------------------- sys/xen/xen-os.h | 27 ++++++--------------------- 2 files changed, 6 insertions(+), 65 deletions(-) diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index 9b5b588234c4..569b113364b1 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -489,47 +489,3 @@ xen_hvm_cpu_init(void) DPCPU_SET(vcpu_info, vcpu_info); } SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); - -/* HVM/PVH start_info accessors */ -static vm_paddr_t -hvm_get_xenstore_mfn(void) -{ - - return (hvm_get_parameter(HVM_PARAM_STORE_PFN)); -} - -static evtchn_port_t -hvm_get_xenstore_evtchn(void) -{ - - return (hvm_get_parameter(HVM_PARAM_STORE_EVTCHN)); -} - -static vm_paddr_t -hvm_get_console_mfn(void) -{ - - return (hvm_get_parameter(HVM_PARAM_CONSOLE_PFN)); -} - -static evtchn_port_t -hvm_get_console_evtchn(void) -{ - - return (hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN)); -} - -static uint32_t -hvm_get_start_flags(void) -{ - - return (hvm_start_flags); -} - -struct hypervisor_info hypervisor_info = { - .get_xenstore_mfn = hvm_get_xenstore_mfn, - .get_xenstore_evtchn = hvm_get_xenstore_evtchn, - .get_console_mfn = hvm_get_console_mfn, - .get_console_evtchn = hvm_get_console_evtchn, - .get_start_flags = hvm_get_start_flags, -}; diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index 874c3b71b861..cd8a53aab54f 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -43,50 +43,35 @@ #include #ifndef __ASSEMBLY__ +#include #include -struct hypervisor_info { - vm_paddr_t (*get_xenstore_mfn)(void); - evtchn_port_t (*get_xenstore_evtchn)(void); - vm_paddr_t (*get_console_mfn)(void); - evtchn_port_t (*get_console_evtchn)(void); - uint32_t (*get_start_flags)(void); -}; -extern struct hypervisor_info hypervisor_info; - static inline vm_paddr_t xen_get_xenstore_mfn(void) { - return (hypervisor_info.get_xenstore_mfn()); + return (hvm_get_parameter(HVM_PARAM_STORE_PFN)); } static inline evtchn_port_t xen_get_xenstore_evtchn(void) { - return (hypervisor_info.get_xenstore_evtchn()); + return (hvm_get_parameter(HVM_PARAM_STORE_EVTCHN)); } static inline vm_paddr_t xen_get_console_mfn(void) { - return (hypervisor_info.get_console_mfn()); + return (hvm_get_parameter(HVM_PARAM_CONSOLE_PFN)); } static inline evtchn_port_t xen_get_console_evtchn(void) { - return (hypervisor_info.get_console_evtchn()); -} - -static inline uint32_t -xen_get_start_flags(void) -{ - - return (hypervisor_info.get_start_flags()); + return (hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN)); } #endif @@ -132,7 +117,7 @@ static inline bool xen_initial_domain(void) { - return (xen_domain() && (xen_get_start_flags() & SIF_INITDOMAIN) != 0); + return (xen_domain() && (hvm_start_flags & SIF_INITDOMAIN) != 0); } /*