arch/x86/xen/xen-asm.S

Source file repositories/reference/linux-study-clean/arch/x86/xen/xen-asm.S

File Facts

System
Linux kernel
Corpus path
arch/x86/xen/xen-asm.S
Extension
.S
Size
8234 bytes
Lines
345
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: arch/x86
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <asm/errno.h>
#include <asm/asm-offsets.h>
#include <asm/percpu.h>
#include <asm/processor-flags.h>
#include <asm/segment.h>
#include <asm/thread_info.h>
#include <asm/asm.h>
#include <asm/frame.h>
#include <asm/unwind_hints.h>

#include <xen/interface/xen.h>

#include <linux/init.h>
#include <linux/linkage.h>
#include <linux/objtool.h>
#include <../entry/calling.h>

.pushsection .noinstr.text, "ax"
/*
 * PV hypercall interface to the hypervisor.
 *
 * Called via inline asm(), so better preserve %rcx and %r11.
 *
 * Input:
 *	%eax: hypercall number
 *	%rdi, %rsi, %rdx, %r10, %r8: args 1..5 for the hypercall
 * Output: %rax
 */
SYM_FUNC_START(xen_hypercall_pv)
	ANNOTATE_NOENDBR
	push %rcx
	push %r11
	UNWIND_HINT_SAVE
	syscall
	UNWIND_HINT_RESTORE
	pop %r11
	pop %rcx
	RET
SYM_FUNC_END(xen_hypercall_pv)

/*
 * Disabling events is simply a matter of making the event mask
 * non-zero.
 */
SYM_FUNC_START(xen_irq_disable_direct)
	ENDBR
	movb $1, PER_CPU_VAR(xen_vcpu_info + XEN_vcpu_info_mask)
	RET
SYM_FUNC_END(xen_irq_disable_direct)

/*
 * Force an event check by making a hypercall, but preserve regs
 * before making the call.
 */
SYM_FUNC_START(check_events)
	FRAME_BEGIN
	push %rax
	push %rcx
	push %rdx
	push %rsi
	push %rdi
	push %r8
	push %r9
	push %r10
	push %r11
	call xen_force_evtchn_callback
	pop %r11
	pop %r10
	pop %r9
	pop %r8

Annotation

Implementation Notes