arch/x86/xen/enlighten_hvm.c
Source file repositories/reference/linux-study-clean/arch/x86/xen/enlighten_hvm.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/xen/enlighten_hvm.c- Extension
.c- Size
- 8192 bytes
- Lines
- 337
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/cpu.hlinux/kexec.hlinux/memblock.hlinux/virtio_anchor.hxen/features.hxen/events.hxen/hvm.hxen/interface/hvm/hvm_op.hxen/interface/memory.hasm/apic.hasm/cpu.hasm/smp.hasm/io_apic.hasm/reboot.hasm/setup.hasm/idtentry.hasm/hypervisor.hasm/cpuid/api.hasm/e820/api.hasm/early_ioremap.hasm/xen/cpuid.hasm/xen/hypervisor.hasm/xen/page.hxen-ops.h
Detected Declarations
function xen_hvm_init_shared_infofunction reserve_shared_infofunction xen_hvm_init_mem_mappingfunction init_hvm_pv_infofunction xen_hvm_shutdownfunction xen_hvm_crash_shutdownfunction xen_cpu_up_prepare_hvmfunction xen_cpu_dead_hvmfunction xen_hvm_guest_initfunction xen_parse_nopvfunction xen_parse_no_vector_callbackfunction xen_x2apic_availablefunction msi_ext_dest_idfunction xen_hvm_guest_late_initfunction xen_platform_hvmexport xen_percpu_upcall
Annotated Snippet
if (rc) {
WARN(1, "HVMOP_set_evtchn_upcall_vector"
" for CPU %d failed: %d\n", cpu, rc);
return rc;
}
}
if (xen_feature(XENFEAT_hvm_safe_pvclock))
xen_setup_timer(cpu);
rc = xen_smp_intr_init(cpu);
if (rc) {
WARN(1, "xen_smp_intr_init() for CPU %d failed: %d\n",
cpu, rc);
}
return rc;
}
static int xen_cpu_dead_hvm(unsigned int cpu)
{
xen_smp_intr_free(cpu);
if (xen_have_vector_callback && xen_feature(XENFEAT_hvm_safe_pvclock))
xen_teardown_timer(cpu);
return 0;
}
static void __init xen_hvm_guest_init(void)
{
if (xen_pv_domain())
return;
if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT))
virtio_set_mem_acc_cb(xen_virtio_restricted_mem_acc);
init_hvm_pv_info();
reserve_shared_info();
xen_hvm_init_shared_info();
/*
* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
* page, we use it in the event channel upcall and in some pvclock
* related functions.
*/
xen_vcpu_info_reset(0);
xen_panic_handler_init();
xen_hvm_smp_init();
WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_hvm, xen_cpu_dead_hvm));
xen_unplug_emulated_devices();
x86_init.irqs.intr_init = xen_init_IRQ;
xen_hvm_init_time_ops();
xen_hvm_init_mmu_ops();
#ifdef CONFIG_KEXEC_CORE
machine_ops.shutdown = xen_hvm_shutdown;
#endif
#ifdef CONFIG_CRASH_DUMP
machine_ops.crash_shutdown = xen_hvm_crash_shutdown;
#endif
}
static __init int xen_parse_nopv(char *arg)
{
pr_notice("\"xen_nopv\" is deprecated, please use \"nopv\" instead\n");
if (xen_cpuid_base())
nopv = true;
return 0;
}
early_param("xen_nopv", xen_parse_nopv);
static __init int xen_parse_no_vector_callback(char *arg)
{
xen_have_vector_callback = false;
return 0;
}
early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
static __init bool xen_x2apic_available(void)
{
return x2apic_supported();
}
static bool __init msi_ext_dest_id(void)
{
return cpuid_eax(xen_cpuid_base() + 4) & XEN_HVM_CPUID_EXT_DEST_ID;
}
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/cpu.h`, `linux/kexec.h`, `linux/memblock.h`, `linux/virtio_anchor.h`, `xen/features.h`, `xen/events.h`, `xen/hvm.h`.
- Detected declarations: `function xen_hvm_init_shared_info`, `function reserve_shared_info`, `function xen_hvm_init_mem_mapping`, `function init_hvm_pv_info`, `function xen_hvm_shutdown`, `function xen_hvm_crash_shutdown`, `function xen_cpu_up_prepare_hvm`, `function xen_cpu_dead_hvm`, `function xen_hvm_guest_init`, `function xen_parse_nopv`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.