arch/x86/xen/smp.c
Source file repositories/reference/linux-study-clean/arch/x86/xen/smp.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/xen/smp.c- Extension
.c- Size
- 6579 bytes
- Lines
- 269
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/smp.hlinux/cpu.hlinux/slab.hlinux/cpumask.hlinux/percpu.hxen/events.hxen/hvc-console.hxen-ops.h
Detected Declarations
function xen_reschedule_interruptfunction xen_smp_intr_freefunction xen_smp_intr_initfunction xen_smp_cpus_donefunction xen_smp_send_reschedulefunction __xen_send_IPI_maskfunction xen_smp_send_call_function_ipifunction xen_smp_send_call_function_single_ipifunction xen_map_vectorfunction xen_send_IPI_maskfunction xen_send_IPI_allfunction xen_send_IPI_selffunction xen_send_IPI_mask_allbutselffunction for_each_cpu_andfunction xen_send_IPI_allbutselffunction xen_call_function_interruptfunction xen_call_function_single_interrupt
Annotated Snippet
if (xen_vcpu_stolen(cpu)) {
HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
break;
}
}
}
void xen_smp_send_call_function_single_ipi(int cpu)
{
__xen_send_IPI_mask(cpumask_of(cpu),
XEN_CALL_FUNCTION_SINGLE_VECTOR);
}
static inline int xen_map_vector(int vector)
{
int xen_vector;
switch (vector) {
case RESCHEDULE_VECTOR:
xen_vector = XEN_RESCHEDULE_VECTOR;
break;
case CALL_FUNCTION_VECTOR:
xen_vector = XEN_CALL_FUNCTION_VECTOR;
break;
case CALL_FUNCTION_SINGLE_VECTOR:
xen_vector = XEN_CALL_FUNCTION_SINGLE_VECTOR;
break;
case IRQ_WORK_VECTOR:
xen_vector = XEN_IRQ_WORK_VECTOR;
break;
#ifdef CONFIG_X86_64
case NMI_VECTOR:
case APIC_DM_NMI: /* Some use that instead of NMI_VECTOR */
xen_vector = XEN_NMI_VECTOR;
break;
#endif
default:
xen_vector = -1;
printk(KERN_ERR "xen: vector 0x%x is not implemented\n",
vector);
}
return xen_vector;
}
void xen_send_IPI_mask(const struct cpumask *mask,
int vector)
{
int xen_vector = xen_map_vector(vector);
if (xen_vector >= 0)
__xen_send_IPI_mask(mask, xen_vector);
}
void xen_send_IPI_all(int vector)
{
int xen_vector = xen_map_vector(vector);
if (xen_vector >= 0)
__xen_send_IPI_mask(cpu_online_mask, xen_vector);
}
void xen_send_IPI_self(int vector)
{
int xen_vector = xen_map_vector(vector);
if (xen_vector >= 0)
xen_send_IPI_one(smp_processor_id(), xen_vector);
}
void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
int vector)
{
unsigned cpu;
unsigned int this_cpu = smp_processor_id();
int xen_vector = xen_map_vector(vector);
if (!(num_online_cpus() > 1) || (xen_vector < 0))
return;
for_each_cpu_and(cpu, mask, cpu_online_mask) {
if (this_cpu == cpu)
continue;
xen_send_IPI_one(cpu, xen_vector);
}
}
void xen_send_IPI_allbutself(int vector)
{
Annotation
- Immediate include surface: `linux/smp.h`, `linux/cpu.h`, `linux/slab.h`, `linux/cpumask.h`, `linux/percpu.h`, `xen/events.h`, `xen/hvc-console.h`, `xen-ops.h`.
- Detected declarations: `function xen_reschedule_interrupt`, `function xen_smp_intr_free`, `function xen_smp_intr_init`, `function xen_smp_cpus_done`, `function xen_smp_send_reschedule`, `function __xen_send_IPI_mask`, `function xen_smp_send_call_function_ipi`, `function xen_smp_send_call_function_single_ipi`, `function xen_map_vector`, `function xen_send_IPI_mask`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.