hvm.c (8518997526ad09863b6d1a38416e9d36aadb1377) | hvm.c (cfa0b7b82fbdda56d7160569def5c6133eb045aa) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2008, 2013 Citrix Systems, Inc. 5 * Copyright (c) 2012 Spectra Logic Corporation 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 80 unchanged lines hidden (view full) --- 89int xen_vector_callback_enabled; 90 91/*------------------------------- Per-CPU Data -------------------------------*/ 92DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); 93DPCPU_DEFINE(struct vcpu_info *, vcpu_info); 94 95/*------------------ Hypervisor Access Shared Memory Regions -----------------*/ 96shared_info_t *HYPERVISOR_shared_info; | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2008, 2013 Citrix Systems, Inc. 5 * Copyright (c) 2012 Spectra Logic Corporation 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 80 unchanged lines hidden (view full) --- 89int xen_vector_callback_enabled; 90 91/*------------------------------- Per-CPU Data -------------------------------*/ 92DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); 93DPCPU_DEFINE(struct vcpu_info *, vcpu_info); 94 95/*------------------ Hypervisor Access Shared Memory Regions -----------------*/ 96shared_info_t *HYPERVISOR_shared_info; |
97start_info_t *HYPERVISOR_start_info; | |
98 | 97 |
99 | |
100/*------------------------------ Sysctl tunables -----------------------------*/ 101int xen_disable_pv_disks = 0; 102int xen_disable_pv_nics = 0; 103TUNABLE_INT("hw.xen.disable_pv_disks", &xen_disable_pv_disks); 104TUNABLE_INT("hw.xen.disable_pv_nics", &xen_disable_pv_nics); 105 106/*---------------------- XEN Hypervisor Probe and Setup ----------------------*/ 107 --- 312 unchanged lines hidden (view full) --- 420 421 rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); 422 if (rc != 0) 423 DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); 424 else 425 DPCPU_SET(vcpu_info, vcpu_info); 426} 427SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); | 98/*------------------------------ Sysctl tunables -----------------------------*/ 99int xen_disable_pv_disks = 0; 100int xen_disable_pv_nics = 0; 101TUNABLE_INT("hw.xen.disable_pv_disks", &xen_disable_pv_disks); 102TUNABLE_INT("hw.xen.disable_pv_nics", &xen_disable_pv_nics); 103 104/*---------------------- XEN Hypervisor Probe and Setup ----------------------*/ 105 --- 312 unchanged lines hidden (view full) --- 418 419 rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); 420 if (rc != 0) 421 DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); 422 else 423 DPCPU_SET(vcpu_info, vcpu_info); 424} 425SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); |
426 427/* HVM/PVH start_info accessors */ 428static vm_paddr_t 429hvm_get_xenstore_mfn(void) 430{ 431 432 return (hvm_get_parameter(HVM_PARAM_STORE_PFN)); 433} 434 435static evtchn_port_t 436hvm_get_xenstore_evtchn(void) 437{ 438 439 return (hvm_get_parameter(HVM_PARAM_STORE_EVTCHN)); 440} 441 442static vm_paddr_t 443hvm_get_console_mfn(void) 444{ 445 446 return (hvm_get_parameter(HVM_PARAM_CONSOLE_PFN)); 447} 448 449static evtchn_port_t 450hvm_get_console_evtchn(void) 451{ 452 453 return (hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN)); 454} 455 456static uint32_t 457hvm_get_start_flags(void) 458{ 459 460 return (0); 461} 462 463struct hypervisor_info hypervisor_info = { 464 .get_xenstore_mfn = hvm_get_xenstore_mfn, 465 .get_xenstore_evtchn = hvm_get_xenstore_evtchn, 466 .get_console_mfn = hvm_get_console_mfn, 467 .get_console_evtchn = hvm_get_console_evtchn, 468 .get_start_flags = hvm_get_start_flags, 469}; |
|