/root/src/xen/xen/include/asm/asm_defns.h
Line | Count | Source (jump to first uncovered line) |
1 | | |
2 | | #ifndef __X86_ASM_DEFNS_H__ |
3 | | #define __X86_ASM_DEFNS_H__ |
4 | | |
5 | | #ifndef COMPILE_OFFSETS |
6 | | /* NB. Auto-generated from arch/.../asm-offsets.c */ |
7 | | #include <asm/asm-offsets.h> |
8 | | #endif |
9 | | #include <asm/bug.h> |
10 | | #include <asm/processor.h> |
11 | | #include <asm/percpu.h> |
12 | | #include <xen/stringify.h> |
13 | | #include <asm/cpufeature.h> |
14 | | #include <asm/alternative.h> |
15 | | |
16 | | #ifndef __ASSEMBLY__ |
17 | | void ret_from_intr(void); |
18 | | #endif |
19 | | |
20 | | #ifdef CONFIG_FRAME_POINTER |
21 | | /* Indicate special exception stack frame by inverting the frame pointer. */ |
22 | | #define SETUP_EXCEPTION_FRAME_POINTER(offs) \ |
23 | | leaq offs(%rsp),%rbp; \ |
24 | | notq %rbp |
25 | | #else |
26 | | #define SETUP_EXCEPTION_FRAME_POINTER(offs) |
27 | | #endif |
28 | | |
29 | | #ifndef NDEBUG |
30 | | #define ASSERT_INTERRUPT_STATUS(x, msg) \ |
31 | | pushf; \ |
32 | | testb $X86_EFLAGS_IF>>8,1(%rsp); \ |
33 | | j##x 1f; \ |
34 | | ASSERT_FAILED(msg); \ |
35 | | 1: addq $8,%rsp; |
36 | | #else |
37 | | #define ASSERT_INTERRUPT_STATUS(x, msg) |
38 | | #endif |
39 | | |
40 | | #define ASSERT_INTERRUPTS_ENABLED \ |
41 | | ASSERT_INTERRUPT_STATUS(nz, "INTERRUPTS ENABLED") |
42 | | #define ASSERT_INTERRUPTS_DISABLED \ |
43 | | ASSERT_INTERRUPT_STATUS(z, "INTERRUPTS DISABLED") |
44 | | |
45 | | /* |
46 | | * This flag is set in an exception frame when registers R12-R15 did not get |
47 | | * saved. |
48 | | */ |
49 | 0 | #define _TRAP_regs_partial 16 |
50 | 0 | #define TRAP_regs_partial (1 << _TRAP_regs_partial) |
51 | | /* |
52 | | * This flag gets set in an exception frame when registers R12-R15 possibly |
53 | | * get modified from their originally saved values and hence need to be |
54 | | * restored even if the normal call flow would restore register values. |
55 | | * |
56 | | * The flag being set implies _TRAP_regs_partial to be unset. Restoring |
57 | | * R12-R15 thus is |
58 | | * - required when this flag is set, |
59 | | * - safe when _TRAP_regs_partial is unset. |
60 | | */ |
61 | 5.39k | #define _TRAP_regs_dirty 17 |
62 | 5.39k | #define TRAP_regs_dirty (1 << _TRAP_regs_dirty) |
63 | | |
64 | 5.39k | #define mark_regs_dirty(r) ({ \ |
65 | 5.39k | struct cpu_user_regs *r__ = (r); \ |
66 | 5.39k | ASSERT(!((r__)->entry_vector & TRAP_regs_partial)); \ |
67 | 5.39k | r__->entry_vector |= TRAP_regs_dirty; \ |
68 | 5.39k | }) |
69 | | |
70 | | #ifdef __ASSEMBLY__ |
71 | | # define _ASM_EX(p) p-. |
72 | | #else |
73 | | # define _ASM_EX(p) #p "-." |
74 | | #endif |
75 | | |
76 | | /* Exception table entry */ |
77 | | #ifdef __ASSEMBLY__ |
78 | | # define _ASM__EXTABLE(sfx, from, to) \ |
79 | | .section .ex_table##sfx, "a" ; \ |
80 | | .balign 4 ; \ |
81 | | .long _ASM_EX(from), _ASM_EX(to) ; \ |
82 | | .previous |
83 | | #else |
84 | | # define _ASM__EXTABLE(sfx, from, to) \ |
85 | | " .section .ex_table" #sfx ",\"a\"\n" \ |
86 | | " .balign 4\n" \ |
87 | | " .long " _ASM_EX(from) ", " _ASM_EX(to) "\n" \ |
88 | | " .previous\n" |
89 | | #endif |
90 | | |
91 | | #define _ASM_EXTABLE(from, to) _ASM__EXTABLE(, from, to) |
92 | | #define _ASM_PRE_EXTABLE(from, to) _ASM__EXTABLE(.pre, from, to) |
93 | | |
94 | | #ifdef __ASSEMBLY__ |
95 | | |
96 | | #ifdef HAVE_GAS_QUOTED_SYM |
97 | | #define SUBSECTION_LBL(tag) \ |
98 | | .ifndef .L.tag; \ |
99 | | .equ .L.tag, 1; \ |
100 | | .equ __stringify(__OBJECT_LABEL__.tag), .; \ |
101 | | .endif |
102 | | #else |
103 | | #define SUBSECTION_LBL(tag) \ |
104 | | .ifndef __OBJECT_LABEL__.tag; \ |
105 | | __OBJECT_LABEL__.tag:; \ |
106 | | .endif |
107 | | #endif |
108 | | |
109 | | #define UNLIKELY_START(cond, tag) \ |
110 | | .Ldispatch.tag: \ |
111 | | j##cond .Lunlikely.tag; \ |
112 | | .subsection 1; \ |
113 | | SUBSECTION_LBL(unlikely); \ |
114 | | .Lunlikely.tag: |
115 | | |
116 | | #define UNLIKELY_DISPATCH_LABEL(tag) \ |
117 | | .Ldispatch.tag |
118 | | |
119 | | #define UNLIKELY_DONE(cond, tag) \ |
120 | | j##cond .Llikely.tag |
121 | | |
122 | | #define __UNLIKELY_END(tag) \ |
123 | | .subsection 0; \ |
124 | | .Llikely.tag: |
125 | | |
126 | | #define UNLIKELY_END(tag) \ |
127 | | UNLIKELY_DONE(mp, tag); \ |
128 | | __UNLIKELY_END(tag) |
129 | | |
130 | | #define STACK_CPUINFO_FIELD(field) (1 - CPUINFO_sizeof + CPUINFO_##field) |
131 | | #define GET_STACK_END(reg) \ |
132 | | movl $STACK_SIZE-1, %e##reg; \ |
133 | | orq %rsp, %r##reg |
134 | | |
135 | | #define GET_CPUINFO_FIELD(field, reg) \ |
136 | | GET_STACK_END(reg); \ |
137 | | addq $STACK_CPUINFO_FIELD(field), %r##reg |
138 | | |
139 | | #define __GET_CURRENT(reg) \ |
140 | | movq STACK_CPUINFO_FIELD(current_vcpu)(%r##reg), %r##reg |
141 | | #define GET_CURRENT(reg) \ |
142 | | GET_STACK_END(reg); \ |
143 | | __GET_CURRENT(reg) |
144 | | |
145 | | #ifndef NDEBUG |
146 | | #define ASSERT_NOT_IN_ATOMIC \ |
147 | | sti; /* sometimes called with interrupts disabled: safe to enable */ \ |
148 | | call ASSERT_NOT_IN_ATOMIC |
149 | | #else |
150 | | #define ASSERT_NOT_IN_ATOMIC |
151 | | #endif |
152 | | |
153 | | #define CPUINFO_FEATURE_OFFSET(feature) \ |
154 | | (CPUINFO_features + (cpufeat_word(feature) * 4)) |
155 | | |
156 | | #else |
157 | | |
158 | | #ifdef HAVE_GAS_QUOTED_SYM |
159 | | #define SUBSECTION_LBL(tag) \ |
160 | | ".ifndef .L." #tag "\n\t" \ |
161 | | ".equ .L." #tag ", 1\n\t" \ |
162 | | ".equ \"" __stringify(__OBJECT_LABEL__) "." #tag "\", .\n\t" \ |
163 | | ".endif" |
164 | | #else |
165 | | #define SUBSECTION_LBL(tag) \ |
166 | | ".ifndef " __stringify(__OBJECT_LABEL__) "." #tag "\n\t" \ |
167 | | __stringify(__OBJECT_LABEL__) "." #tag ":\n\t" \ |
168 | | ".endif" |
169 | | #endif |
170 | | |
171 | | #ifdef __clang__ /* clang's builtin assember can't do .subsection */ |
172 | | |
173 | | #define UNLIKELY_START_SECTION ".pushsection .text.unlikely,\"ax\"" |
174 | | #define UNLIKELY_END_SECTION ".popsection" |
175 | | |
176 | | #else |
177 | | |
178 | | #define UNLIKELY_START_SECTION ".subsection 1" |
179 | | #define UNLIKELY_END_SECTION ".subsection 0" |
180 | | |
181 | | #endif |
182 | | |
183 | | #define UNLIKELY_START(cond, tag) \ |
184 | | "j" #cond " .Lunlikely." #tag ".%=;\n\t" \ |
185 | | UNLIKELY_START_SECTION "\n\t" \ |
186 | | SUBSECTION_LBL(unlikely) "\n" \ |
187 | | ".Lunlikely." #tag ".%=:" |
188 | | |
189 | | #define UNLIKELY_END(tag) \ |
190 | | "jmp .Llikely." #tag ".%=;\n\t" \ |
191 | | UNLIKELY_END_SECTION "\n" \ |
192 | | ".Llikely." #tag ".%=:" |
193 | | |
194 | | #endif |
195 | | |
196 | | /* "Raw" instruction opcodes */ |
197 | | #define __ASM_CLAC .byte 0x0f,0x01,0xca |
198 | | #define __ASM_STAC .byte 0x0f,0x01,0xcb |
199 | | |
200 | | #ifdef __ASSEMBLY__ |
201 | | #define ASM_AC(op) \ |
202 | | 661: ASM_NOP3; \ |
203 | | .pushsection .altinstr_replacement, "ax"; \ |
204 | | 662: __ASM_##op; \ |
205 | | .popsection; \ |
206 | | .pushsection .altinstructions, "a"; \ |
207 | | altinstruction_entry 661b, 661b, X86_FEATURE_ALWAYS, 3, 0; \ |
208 | | altinstruction_entry 661b, 662b, X86_FEATURE_XEN_SMAP, 3, 3; \ |
209 | | .popsection |
210 | | |
211 | | #define ASM_STAC ASM_AC(STAC) |
212 | | #define ASM_CLAC ASM_AC(CLAC) |
213 | | |
214 | | #define CR4_PV32_RESTORE \ |
215 | | 667: ASM_NOP5; \ |
216 | | .pushsection .altinstr_replacement, "ax"; \ |
217 | | 668: call cr4_pv32_restore; \ |
218 | | .section .altinstructions, "a"; \ |
219 | | altinstruction_entry 667b, 667b, X86_FEATURE_ALWAYS, 5, 0; \ |
220 | | altinstruction_entry 667b, 668b, X86_FEATURE_XEN_SMEP, 5, 5; \ |
221 | | altinstruction_entry 667b, 668b, X86_FEATURE_XEN_SMAP, 5, 5; \ |
222 | | .popsection |
223 | | |
224 | | #else |
225 | | static always_inline void clac(void) |
226 | 1 | { |
227 | 1 | /* Note: a barrier is implicit in alternative() */ |
228 | 1 | alternative(ASM_NOP3, __stringify(__ASM_CLAC), X86_FEATURE_XEN_SMAP); |
229 | 1 | } Unexecuted instantiation: cpu.c:clac Unexecuted instantiation: mmconfig_64.c:clac Unexecuted instantiation: mmconf-fam10h.c:clac Unexecuted instantiation: acpi_mmcfg.c:clac Unexecuted instantiation: ro-page-fault.c:clac Unexecuted instantiation: misc-hypercalls.c:clac Unexecuted instantiation: iret.c:clac Unexecuted instantiation: emul-priv-op.c:clac Unexecuted instantiation: emul-inv-op.c:clac Unexecuted instantiation: emul-gate-op.c:clac Unexecuted instantiation: descriptor-tables.c:clac Unexecuted instantiation: callback.c:clac Unexecuted instantiation: backtrace.c:clac Unexecuted instantiation: op_model_athlon.c:clac Unexecuted instantiation: op_model_ppro.c:clac Unexecuted instantiation: op_model_p4.c:clac Unexecuted instantiation: nmi_int.c:clac Unexecuted instantiation: nested_ept.c:clac Unexecuted instantiation: nested_hap.c:clac Unexecuted instantiation: hap.c:clac Unexecuted instantiation: multi.c:clac Unexecuted instantiation: mem_sharing.c:clac Unexecuted instantiation: mem_paging.c:clac Unexecuted instantiation: guest_walk.c:clac Unexecuted instantiation: altp2m.c:clac Unexecuted instantiation: p2m-pod.c:clac Unexecuted instantiation: p2m-ept.c:clac Unexecuted instantiation: p2m-pt.c:clac Unexecuted instantiation: p2m.c:clac Unexecuted instantiation: paging.c:clac Unexecuted instantiation: vvmx.c:clac Unexecuted instantiation: vmx.c:clac Unexecuted instantiation: vmcs.c:clac Unexecuted instantiation: realmode.c:clac Unexecuted instantiation: vmcb.c:clac Unexecuted instantiation: svmdebug.c:clac Unexecuted instantiation: svm.c:clac Unexecuted instantiation: nestedsvm.c:clac Unexecuted instantiation: intr.c:clac Unexecuted instantiation: vpt.c:clac Unexecuted instantiation: vpic.c:clac Unexecuted instantiation: vmsi.c:clac Unexecuted instantiation: vlapic.c:clac Unexecuted instantiation: viridian.c:clac Unexecuted instantiation: vioapic.c:clac Unexecuted instantiation: stdvga.c:clac Unexecuted instantiation: save.c:clac Unexecuted instantiation: rtc.c:clac Unexecuted instantiation: pmtimer.c:clac Unexecuted instantiation: nestedhvm.c:clac Unexecuted instantiation: mtrr.c:clac Unexecuted instantiation: ioreq.c:clac Unexecuted instantiation: intercept.c:clac Unexecuted instantiation: i8254.c:clac Unexecuted instantiation: hvm.c:clac Unexecuted instantiation: emulate.c:clac Unexecuted instantiation: dm.c:clac Unexecuted instantiation: asid.c:clac Unexecuted instantiation: probe.c:clac Unexecuted instantiation: delivery.c:clac Unexecuted instantiation: default.c:clac Unexecuted instantiation: x2apic.c:clac Unexecuted instantiation: bigsmp.c:clac Unexecuted instantiation: main.c:clac Unexecuted instantiation: generic.c:clac Unexecuted instantiation: vmce.c:clac Unexecuted instantiation: util.c:clac Unexecuted instantiation: non-fatal.c:clac Unexecuted instantiation: mce_intel.c:clac Unexecuted instantiation: mce-apei.c:clac Unexecuted instantiation: mce.c:clac Unexecuted instantiation: mctelem.c:clac Unexecuted instantiation: barrier.c:clac Unexecuted instantiation: mcaction.c:clac Unexecuted instantiation: mce_amd.c:clac Unexecuted instantiation: amd_nonfatal.c:clac Unexecuted instantiation: vpmu_intel.c:clac Unexecuted instantiation: vpmu_amd.c:clac Unexecuted instantiation: vpmu.c:clac Unexecuted instantiation: mwait-idle.c:clac Unexecuted instantiation: intel.c:clac Unexecuted instantiation: common.c:clac Unexecuted instantiation: centaur.c:clac Unexecuted instantiation: amd.c:clac Unexecuted instantiation: powernow.c:clac Unexecuted instantiation: cpuidle_menu.c:clac Unexecuted instantiation: cpu_idle.c:clac Unexecuted instantiation: suspend.c:clac Unexecuted instantiation: power.c:clac Unexecuted instantiation: lib.c:clac Unexecuted instantiation: xstate.c:clac Unexecuted instantiation: hpet.c:clac Unexecuted instantiation: tboot.c:clac Unexecuted instantiation: x86_emulate.c:clac Line | Count | Source | 226 | 1 | { | 227 | 1 | /* Note: a barrier is implicit in alternative() */ | 228 | 1 | alternative(ASM_NOP3, __stringify(__ASM_CLAC), X86_FEATURE_XEN_SMAP); | 229 | 1 | } |
Unexecuted instantiation: traps.c:clac Unexecuted instantiation: srat.c:clac Unexecuted instantiation: smpboot.c:clac Unexecuted instantiation: smp.c:clac Unexecuted instantiation: setup.c:clac Unexecuted instantiation: psr.c:clac Unexecuted instantiation: platform_hypercall.c:clac Unexecuted instantiation: physdev.c:clac Unexecuted instantiation: percpu.c:clac Unexecuted instantiation: numa.c:clac Unexecuted instantiation: nmi.c:clac Unexecuted instantiation: mpparse.c:clac Unexecuted instantiation: mm.c:clac Unexecuted instantiation: microcode.c:clac Unexecuted instantiation: microcode_intel.c:clac Unexecuted instantiation: microcode_amd.c:clac Unexecuted instantiation: machine_kexec.c:clac Unexecuted instantiation: ioport_emulate.c:clac Unexecuted instantiation: msr.c:clac Unexecuted instantiation: io_apic.c:clac Unexecuted instantiation: i8259.c:clac Unexecuted instantiation: i387.c:clac Unexecuted instantiation: hypercall.c:clac Unexecuted instantiation: flushtlb.c:clac Unexecuted instantiation: extable.c:clac Unexecuted instantiation: e820.c:clac Unexecuted instantiation: domain_page.c:clac Unexecuted instantiation: delay.c:clac Unexecuted instantiation: debug.c:clac Unexecuted instantiation: crash.c:clac Unexecuted instantiation: compat.c:clac Unexecuted instantiation: cpuid.c:clac Unexecuted instantiation: apic.c:clac Unexecuted instantiation: xsm_core.c:clac Unexecuted instantiation: vesa.c:clac Unexecuted instantiation: vga.c:clac Unexecuted instantiation: apei-io.c:clac Unexecuted instantiation: apei-base.c:clac Unexecuted instantiation: hest.c:clac Unexecuted instantiation: erst.c:clac Unexecuted instantiation: reboot.c:clac Unexecuted instantiation: hwregs.c:clac Unexecuted instantiation: pmstat.c:clac Unexecuted instantiation: osl.c:clac Unexecuted instantiation: iommu_guest.c:clac Unexecuted instantiation: iommu_cmd.c:clac Unexecuted instantiation: iommu_intr.c:clac Unexecuted instantiation: pci_amd_iommu.c:clac Unexecuted instantiation: iommu_map.c:clac Unexecuted instantiation: iommu_init.c:clac Unexecuted instantiation: ats.c:clac Unexecuted instantiation: vtd.c:clac Unexecuted instantiation: quirks.c:clac Unexecuted instantiation: intremap.c:clac Unexecuted instantiation: qinval.c:clac Unexecuted instantiation: utils.c:clac Unexecuted instantiation: dmar.c:clac Unexecuted instantiation: io.c:clac Unexecuted instantiation: iommu.c:clac Unexecuted instantiation: msix.c:clac Unexecuted instantiation: msi.c:clac Unexecuted instantiation: header.c:clac Unexecuted instantiation: vpci.c:clac Unexecuted instantiation: pci.c:clac Unexecuted instantiation: utility.c:clac Unexecuted instantiation: cpufreq_misc_governors.c:clac Unexecuted instantiation: cpufreq_ondemand.c:clac Unexecuted instantiation: cpufreq.c:clac Unexecuted instantiation: serial.c:clac Unexecuted instantiation: ehci-dbgp.c:clac Unexecuted instantiation: ns16550.c:clac Unexecuted instantiation: console.c:clac Unexecuted instantiation: libelf-loader.c:clac Unexecuted instantiation: llvm.c:clac Unexecuted instantiation: tmem_control.c:clac Unexecuted instantiation: tmem_xen.c:clac Unexecuted instantiation: tmem.c:clac Unexecuted instantiation: xmalloc_tlsf.c:clac Unexecuted instantiation: xenoprof.c:clac Unexecuted instantiation: wait.c:clac Unexecuted instantiation: vsprintf.c:clac Unexecuted instantiation: vmap.c:clac Unexecuted instantiation: vm_event.c:clac Unexecuted instantiation: trace.c:clac Unexecuted instantiation: timer.c:clac Unexecuted instantiation: time.c:clac Unexecuted instantiation: tasklet.c:clac Unexecuted instantiation: sysctl.c:clac Unexecuted instantiation: symbols.c:clac Unexecuted instantiation: stop_machine.c:clac Unexecuted instantiation: spinlock.c:clac Unexecuted instantiation: softirq.c:clac Unexecuted instantiation: shutdown.c:clac Unexecuted instantiation: schedule.c:clac Unexecuted instantiation: sched_null.c:clac Unexecuted instantiation: sched_rt.c:clac Unexecuted instantiation: sched_credit2.c:clac Unexecuted instantiation: sched_credit.c:clac Unexecuted instantiation: sched_arinc653.c:clac Unexecuted instantiation: rwlock.c:clac Unexecuted instantiation: rcupdate.c:clac Unexecuted instantiation: rangeset.c:clac Unexecuted instantiation: random.c:clac Unexecuted instantiation: preempt.c:clac Unexecuted instantiation: pdx.c:clac Unexecuted instantiation: page_alloc.c:clac Unexecuted instantiation: multicall.c:clac Unexecuted instantiation: monitor.c:clac Unexecuted instantiation: memory.c:clac Unexecuted instantiation: mem_access.c:clac Unexecuted instantiation: kimage.c:clac Unexecuted instantiation: kexec.c:clac Unexecuted instantiation: keyhandler.c:clac Unexecuted instantiation: kernel.c:clac Unexecuted instantiation: irq.c:clac Unexecuted instantiation: guestcopy.c:clac Unexecuted instantiation: grant_table.c:clac Unexecuted instantiation: event_fifo.c:clac Unexecuted instantiation: event_channel.c:clac Unexecuted instantiation: event_2l.c:clac Unexecuted instantiation: domain.c:clac Unexecuted instantiation: domctl.c:clac Unexecuted instantiation: cpupool.c:clac Unexecuted instantiation: mmconfig-shared.c:clac |
230 | | |
231 | | static always_inline void stac(void) |
232 | 1 | { |
233 | 1 | /* Note: a barrier is implicit in alternative() */ |
234 | 1 | alternative(ASM_NOP3, __stringify(__ASM_STAC), X86_FEATURE_XEN_SMAP); |
235 | 1 | } Unexecuted instantiation: mmconfig-shared.c:stac Unexecuted instantiation: mmconfig_64.c:stac Unexecuted instantiation: mmconf-fam10h.c:stac Unexecuted instantiation: acpi_mmcfg.c:stac Unexecuted instantiation: ro-page-fault.c:stac Unexecuted instantiation: misc-hypercalls.c:stac Unexecuted instantiation: iret.c:stac Unexecuted instantiation: emul-priv-op.c:stac Unexecuted instantiation: emul-inv-op.c:stac Unexecuted instantiation: emul-gate-op.c:stac Unexecuted instantiation: descriptor-tables.c:stac Unexecuted instantiation: callback.c:stac Unexecuted instantiation: backtrace.c:stac Unexecuted instantiation: op_model_athlon.c:stac Unexecuted instantiation: op_model_ppro.c:stac Unexecuted instantiation: op_model_p4.c:stac Unexecuted instantiation: nmi_int.c:stac Unexecuted instantiation: nested_ept.c:stac Unexecuted instantiation: nested_hap.c:stac Unexecuted instantiation: hap.c:stac Unexecuted instantiation: multi.c:stac Unexecuted instantiation: mem_sharing.c:stac Unexecuted instantiation: mem_paging.c:stac Unexecuted instantiation: guest_walk.c:stac Unexecuted instantiation: altp2m.c:stac Unexecuted instantiation: p2m-pod.c:stac Unexecuted instantiation: p2m-ept.c:stac Unexecuted instantiation: p2m-pt.c:stac Unexecuted instantiation: p2m.c:stac Unexecuted instantiation: paging.c:stac Unexecuted instantiation: vvmx.c:stac Unexecuted instantiation: vmx.c:stac Unexecuted instantiation: vmcs.c:stac Unexecuted instantiation: realmode.c:stac Unexecuted instantiation: vmcb.c:stac Unexecuted instantiation: svmdebug.c:stac Unexecuted instantiation: svm.c:stac Unexecuted instantiation: nestedsvm.c:stac Unexecuted instantiation: intr.c:stac Unexecuted instantiation: vpt.c:stac Unexecuted instantiation: vpic.c:stac Unexecuted instantiation: vmsi.c:stac Unexecuted instantiation: vlapic.c:stac Unexecuted instantiation: viridian.c:stac Unexecuted instantiation: vioapic.c:stac Unexecuted instantiation: stdvga.c:stac Unexecuted instantiation: save.c:stac Unexecuted instantiation: rtc.c:stac Unexecuted instantiation: pmtimer.c:stac Unexecuted instantiation: nestedhvm.c:stac Unexecuted instantiation: mtrr.c:stac Unexecuted instantiation: ioreq.c:stac Unexecuted instantiation: intercept.c:stac Unexecuted instantiation: i8254.c:stac Unexecuted instantiation: hvm.c:stac Unexecuted instantiation: emulate.c:stac Unexecuted instantiation: dm.c:stac Unexecuted instantiation: asid.c:stac Unexecuted instantiation: probe.c:stac Unexecuted instantiation: delivery.c:stac Unexecuted instantiation: default.c:stac Unexecuted instantiation: x2apic.c:stac Unexecuted instantiation: bigsmp.c:stac Unexecuted instantiation: main.c:stac Unexecuted instantiation: generic.c:stac Unexecuted instantiation: vmce.c:stac Unexecuted instantiation: util.c:stac Unexecuted instantiation: non-fatal.c:stac Unexecuted instantiation: mce_intel.c:stac Unexecuted instantiation: mce-apei.c:stac Unexecuted instantiation: mce.c:stac Unexecuted instantiation: mctelem.c:stac Unexecuted instantiation: barrier.c:stac Unexecuted instantiation: mcaction.c:stac Unexecuted instantiation: mce_amd.c:stac Unexecuted instantiation: amd_nonfatal.c:stac Unexecuted instantiation: vpmu_intel.c:stac Unexecuted instantiation: vpmu_amd.c:stac Unexecuted instantiation: vpmu.c:stac Unexecuted instantiation: mwait-idle.c:stac Unexecuted instantiation: intel.c:stac Unexecuted instantiation: common.c:stac Unexecuted instantiation: centaur.c:stac Unexecuted instantiation: amd.c:stac Unexecuted instantiation: powernow.c:stac Unexecuted instantiation: cpuidle_menu.c:stac Unexecuted instantiation: cpu_idle.c:stac Unexecuted instantiation: suspend.c:stac Unexecuted instantiation: power.c:stac Unexecuted instantiation: lib.c:stac Unexecuted instantiation: xstate.c:stac Unexecuted instantiation: hpet.c:stac Unexecuted instantiation: tboot.c:stac Unexecuted instantiation: x86_emulate.c:stac Line | Count | Source | 232 | 1 | { | 233 | 1 | /* Note: a barrier is implicit in alternative() */ | 234 | 1 | alternative(ASM_NOP3, __stringify(__ASM_STAC), X86_FEATURE_XEN_SMAP); | 235 | 1 | } |
Unexecuted instantiation: traps.c:stac Unexecuted instantiation: srat.c:stac Unexecuted instantiation: smpboot.c:stac Unexecuted instantiation: smp.c:stac Unexecuted instantiation: setup.c:stac Unexecuted instantiation: psr.c:stac Unexecuted instantiation: platform_hypercall.c:stac Unexecuted instantiation: physdev.c:stac Unexecuted instantiation: percpu.c:stac Unexecuted instantiation: numa.c:stac Unexecuted instantiation: nmi.c:stac Unexecuted instantiation: mpparse.c:stac Unexecuted instantiation: mm.c:stac Unexecuted instantiation: microcode.c:stac Unexecuted instantiation: microcode_intel.c:stac Unexecuted instantiation: microcode_amd.c:stac Unexecuted instantiation: machine_kexec.c:stac Unexecuted instantiation: ioport_emulate.c:stac Unexecuted instantiation: msr.c:stac Unexecuted instantiation: io_apic.c:stac Unexecuted instantiation: i8259.c:stac Unexecuted instantiation: i387.c:stac Unexecuted instantiation: hypercall.c:stac Unexecuted instantiation: flushtlb.c:stac Unexecuted instantiation: extable.c:stac Unexecuted instantiation: e820.c:stac Unexecuted instantiation: domain_page.c:stac Unexecuted instantiation: delay.c:stac Unexecuted instantiation: debug.c:stac Unexecuted instantiation: crash.c:stac Unexecuted instantiation: compat.c:stac Unexecuted instantiation: cpuid.c:stac Unexecuted instantiation: apic.c:stac Unexecuted instantiation: xsm_core.c:stac Unexecuted instantiation: vesa.c:stac Unexecuted instantiation: vga.c:stac Unexecuted instantiation: apei-io.c:stac Unexecuted instantiation: apei-base.c:stac Unexecuted instantiation: hest.c:stac Unexecuted instantiation: erst.c:stac Unexecuted instantiation: reboot.c:stac Unexecuted instantiation: hwregs.c:stac Unexecuted instantiation: pmstat.c:stac Unexecuted instantiation: osl.c:stac Unexecuted instantiation: iommu_guest.c:stac Unexecuted instantiation: iommu_cmd.c:stac Unexecuted instantiation: iommu_intr.c:stac Unexecuted instantiation: pci_amd_iommu.c:stac Unexecuted instantiation: iommu_map.c:stac Unexecuted instantiation: iommu_init.c:stac Unexecuted instantiation: ats.c:stac Unexecuted instantiation: vtd.c:stac Unexecuted instantiation: quirks.c:stac Unexecuted instantiation: intremap.c:stac Unexecuted instantiation: qinval.c:stac Unexecuted instantiation: utils.c:stac Unexecuted instantiation: dmar.c:stac Unexecuted instantiation: io.c:stac Unexecuted instantiation: iommu.c:stac Unexecuted instantiation: msix.c:stac Unexecuted instantiation: msi.c:stac Unexecuted instantiation: header.c:stac Unexecuted instantiation: vpci.c:stac Unexecuted instantiation: pci.c:stac Unexecuted instantiation: utility.c:stac Unexecuted instantiation: cpufreq_misc_governors.c:stac Unexecuted instantiation: cpufreq_ondemand.c:stac Unexecuted instantiation: cpufreq.c:stac Unexecuted instantiation: serial.c:stac Unexecuted instantiation: ehci-dbgp.c:stac Unexecuted instantiation: ns16550.c:stac Unexecuted instantiation: console.c:stac Unexecuted instantiation: libelf-loader.c:stac Unexecuted instantiation: llvm.c:stac Unexecuted instantiation: tmem_control.c:stac Unexecuted instantiation: tmem_xen.c:stac Unexecuted instantiation: tmem.c:stac Unexecuted instantiation: xmalloc_tlsf.c:stac Unexecuted instantiation: xenoprof.c:stac Unexecuted instantiation: wait.c:stac Unexecuted instantiation: vsprintf.c:stac Unexecuted instantiation: vmap.c:stac Unexecuted instantiation: vm_event.c:stac Unexecuted instantiation: trace.c:stac Unexecuted instantiation: timer.c:stac Unexecuted instantiation: time.c:stac Unexecuted instantiation: tasklet.c:stac Unexecuted instantiation: sysctl.c:stac Unexecuted instantiation: symbols.c:stac Unexecuted instantiation: stop_machine.c:stac Unexecuted instantiation: spinlock.c:stac Unexecuted instantiation: softirq.c:stac Unexecuted instantiation: shutdown.c:stac Unexecuted instantiation: schedule.c:stac Unexecuted instantiation: sched_null.c:stac Unexecuted instantiation: sched_rt.c:stac Unexecuted instantiation: sched_credit2.c:stac Unexecuted instantiation: sched_credit.c:stac Unexecuted instantiation: sched_arinc653.c:stac Unexecuted instantiation: rwlock.c:stac Unexecuted instantiation: rcupdate.c:stac Unexecuted instantiation: rangeset.c:stac Unexecuted instantiation: random.c:stac Unexecuted instantiation: preempt.c:stac Unexecuted instantiation: pdx.c:stac Unexecuted instantiation: page_alloc.c:stac Unexecuted instantiation: multicall.c:stac Unexecuted instantiation: monitor.c:stac Unexecuted instantiation: memory.c:stac Unexecuted instantiation: mem_access.c:stac Unexecuted instantiation: kimage.c:stac Unexecuted instantiation: kexec.c:stac Unexecuted instantiation: keyhandler.c:stac Unexecuted instantiation: kernel.c:stac Unexecuted instantiation: irq.c:stac Unexecuted instantiation: guestcopy.c:stac Unexecuted instantiation: grant_table.c:stac Unexecuted instantiation: event_fifo.c:stac Unexecuted instantiation: event_channel.c:stac Unexecuted instantiation: event_2l.c:stac Unexecuted instantiation: domain.c:stac Unexecuted instantiation: domctl.c:stac Unexecuted instantiation: cpupool.c:stac Unexecuted instantiation: cpu.c:stac |
236 | | #endif |
237 | | |
238 | | #ifdef __ASSEMBLY__ |
239 | | .macro SAVE_ALL op |
240 | | .ifeqs "\op", "CLAC" |
241 | | ASM_CLAC |
242 | | .else |
243 | | .ifeqs "\op", "STAC" |
244 | | ASM_STAC |
245 | | .else |
246 | | .ifnb \op |
247 | | .err |
248 | | .endif |
249 | | .endif |
250 | | .endif |
251 | | addq $-(UREGS_error_code-UREGS_r15), %rsp |
252 | | cld |
253 | | movq %rdi,UREGS_rdi(%rsp) |
254 | | movq %rsi,UREGS_rsi(%rsp) |
255 | | movq %rdx,UREGS_rdx(%rsp) |
256 | | movq %rcx,UREGS_rcx(%rsp) |
257 | | movq %rax,UREGS_rax(%rsp) |
258 | | movq %r8,UREGS_r8(%rsp) |
259 | | movq %r9,UREGS_r9(%rsp) |
260 | | movq %r10,UREGS_r10(%rsp) |
261 | | movq %r11,UREGS_r11(%rsp) |
262 | | movq %rbx,UREGS_rbx(%rsp) |
263 | | movq %rbp,UREGS_rbp(%rsp) |
264 | | SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp) |
265 | | movq %r12,UREGS_r12(%rsp) |
266 | | movq %r13,UREGS_r13(%rsp) |
267 | | movq %r14,UREGS_r14(%rsp) |
268 | | movq %r15,UREGS_r15(%rsp) |
269 | | .endm |
270 | | |
271 | | /* |
272 | | * Save all registers not preserved by C code or used in entry/exit code. Mark |
273 | | * the frame as partial. |
274 | | * |
275 | | * @type: exception type |
276 | | * @compat: R8-R15 don't need saving, and the frame nevertheless is complete |
277 | | */ |
278 | | .macro SAVE_VOLATILE type compat=0 |
279 | | .if \compat |
280 | | movl $\type,UREGS_entry_vector-UREGS_error_code(%rsp) |
281 | | .else |
282 | | movl $\type|TRAP_regs_partial,\ |
283 | | UREGS_entry_vector-UREGS_error_code(%rsp) |
284 | | .endif |
285 | | addq $-(UREGS_error_code-UREGS_r15),%rsp |
286 | | cld |
287 | | movq %rdi,UREGS_rdi(%rsp) |
288 | | movq %rsi,UREGS_rsi(%rsp) |
289 | | movq %rdx,UREGS_rdx(%rsp) |
290 | | movq %rcx,UREGS_rcx(%rsp) |
291 | | movq %rax,UREGS_rax(%rsp) |
292 | | .if !\compat |
293 | | movq %r8,UREGS_r8(%rsp) |
294 | | movq %r9,UREGS_r9(%rsp) |
295 | | movq %r10,UREGS_r10(%rsp) |
296 | | movq %r11,UREGS_r11(%rsp) |
297 | | .endif |
298 | | movq %rbx,UREGS_rbx(%rsp) |
299 | | movq %rbp,UREGS_rbp(%rsp) |
300 | | SETUP_EXCEPTION_FRAME_POINTER(UREGS_rbp) |
301 | | .endm |
302 | | |
303 | | /* |
304 | | * Complete a frame potentially only partially saved. |
305 | | */ |
306 | | .macro SAVE_PRESERVED |
307 | | btrl $_TRAP_regs_partial,UREGS_entry_vector(%rsp) |
308 | | jnc 987f |
309 | | movq %r12,UREGS_r12(%rsp) |
310 | | movq %r13,UREGS_r13(%rsp) |
311 | | movq %r14,UREGS_r14(%rsp) |
312 | | movq %r15,UREGS_r15(%rsp) |
313 | | 987: |
314 | | .endm |
315 | | |
316 | | #define LOAD_ONE_REG(reg, compat) \ |
317 | | .if !(compat); \ |
318 | | movq UREGS_r##reg(%rsp),%r##reg; \ |
319 | | .else; \ |
320 | | movl UREGS_r##reg(%rsp),%e##reg; \ |
321 | | .endif |
322 | | |
323 | | /* |
324 | | * Restore all previously saved registers. |
325 | | * |
326 | | * @adj: extra stack pointer adjustment to be folded into the adjustment done |
327 | | * anyway at the end of the macro |
328 | | * @compat: R8-R15 don't need reloading, but they are clobbered for added |
329 | | * safety against information leaks. |
330 | | */ |
331 | | .macro RESTORE_ALL adj=0 compat=0 |
332 | | .if !\compat |
333 | | testl $TRAP_regs_dirty,UREGS_entry_vector(%rsp) |
334 | | movq UREGS_r11(%rsp),%r11 |
335 | | movq UREGS_r10(%rsp),%r10 |
336 | | movq UREGS_r9(%rsp),%r9 |
337 | | movq UREGS_r8(%rsp),%r8 |
338 | | .else |
339 | | xor %r11, %r11 |
340 | | xor %r10, %r10 |
341 | | xor %r9, %r9 |
342 | | xor %r8, %r8 |
343 | | .endif |
344 | | LOAD_ONE_REG(ax, \compat) |
345 | | LOAD_ONE_REG(cx, \compat) |
346 | | LOAD_ONE_REG(dx, \compat) |
347 | | LOAD_ONE_REG(si, \compat) |
348 | | LOAD_ONE_REG(di, \compat) |
349 | | .if !\compat |
350 | | jz 987f |
351 | | movq UREGS_r15(%rsp),%r15 |
352 | | movq UREGS_r14(%rsp),%r14 |
353 | | movq UREGS_r13(%rsp),%r13 |
354 | | movq UREGS_r12(%rsp),%r12 |
355 | | #ifndef NDEBUG |
356 | | .subsection 1 |
357 | | 987: testl $TRAP_regs_partial,UREGS_entry_vector(%rsp) |
358 | | jnz 987f |
359 | | cmpq UREGS_r15(%rsp),%r15 |
360 | | jne 789f |
361 | | cmpq UREGS_r14(%rsp),%r14 |
362 | | jne 789f |
363 | | cmpq UREGS_r13(%rsp),%r13 |
364 | | jne 789f |
365 | | cmpq UREGS_r12(%rsp),%r12 |
366 | | je 987f |
367 | | 789: BUG /* Corruption of partial register state. */ |
368 | | .subsection 0 |
369 | | #endif |
370 | | .else |
371 | | xor %r15, %r15 |
372 | | xor %r14, %r14 |
373 | | xor %r13, %r13 |
374 | | xor %r12, %r12 |
375 | | .endif |
376 | | 987: |
377 | | LOAD_ONE_REG(bp, \compat) |
378 | | LOAD_ONE_REG(bx, \compat) |
379 | | subq $-(UREGS_error_code-UREGS_r15+\adj), %rsp |
380 | | .endm |
381 | | |
382 | | #endif |
383 | | |
384 | | #ifdef CONFIG_PERF_COUNTERS |
385 | | #define PERFC_INCR(_name,_idx,_cur) \ |
386 | | pushq _cur; \ |
387 | | movslq VCPU_processor(_cur),_cur; \ |
388 | | pushq %rdx; \ |
389 | | leaq __per_cpu_offset(%rip),%rdx; \ |
390 | | movq (%rdx,_cur,8),_cur; \ |
391 | | leaq per_cpu__perfcounters(%rip),%rdx; \ |
392 | | addq %rdx,_cur; \ |
393 | | popq %rdx; \ |
394 | | incl ASM_PERFC_##_name*4(_cur,_idx,4); \ |
395 | | popq _cur |
396 | | #else |
397 | | #define PERFC_INCR(_name,_idx,_cur) |
398 | | #endif |
399 | | |
400 | | /* Work around AMD erratum #88 */ |
401 | | #define safe_swapgs \ |
402 | | "mfence; swapgs;" |
403 | | |
404 | | #ifdef __sun__ |
405 | | #define REX64_PREFIX "rex64\\" |
406 | | #elif defined(__clang__) |
407 | | #define REX64_PREFIX ".byte 0x48; " |
408 | | #else |
409 | | #define REX64_PREFIX "rex64/" |
410 | | #endif |
411 | | |
412 | | #endif /* __X86_ASM_DEFNS_H__ */ |