6 .byte (_end - _start) / 512
7 # clear vapic area: firmware load using rep insb may cause
8 # stale tpr/isr/irr data to corrupt the vapic area.
13 mov $vapic_size/2, %cx
28 .long 777b + \delta - vapic_base
46 .long vapic_base ; fixup
47 .long fixup_start ; fixup
48 .long fixup_end ; fixup
56 .long up_set_tpr ; fixup
57 .long up_set_tpr_eax ; fixup
58 .long up_get_tpr_eax ; fixup
59 .long up_get_tpr_ecx ; fixup
60 .long up_get_tpr_edx ; fixup
61 .long up_get_tpr_ebx ; fixup
62 .long 0 /* esp. won't work. */
63 .long up_get_tpr_ebp ; fixup
64 .long up_get_tpr_esi ; fixup
65 .long up_get_tpr_edi ; fixup
66 .long up_get_tpr_stack ; fixup
67 .long mp_set_tpr ; fixup
68 .long mp_set_tpr_eax ; fixup
69 .long mp_get_tpr_eax ; fixup
70 .long mp_get_tpr_ecx ; fixup
71 .long mp_get_tpr_edx ; fixup
72 .long mp_get_tpr_ebx ; fixup
73 .long 0 /* esp. won't work. */
74 .long mp_get_tpr_ebp ; fixup
75 .long mp_get_tpr_esi ; fixup
76 .long mp_get_tpr_edi ; fixup
77 .long mp_get_tpr_stack ; fixup
80 .byte 0x0f, 0x01, 0xc1
83 kvm_hypercall_vapic_poll_irq = 1
95 fs/movzbl pcr_cpu, %eax
97 mov vcpu_shift, %ecx ; fixup
99 testb $1, vapic+4(%eax) ; fixup delta=-5
101 movzbl vapic(%eax), %eax ; fixup
109 mov real_tpr, %eax ; fixup
169 fs/movzbl pcr_cpu, %edx
171 mov vcpu_shift, %ecx ; fixup
174 testb $1, vapic+4(%edx) ; fixup delta=-5
177 mov vapic(%edx), %eax ; fixup
182 /* %ebx = new vapic (%bl = tpr, %bh = isr, %b3 = irr) */
184 lock cmpxchg %ebx, vapic(%edx) ; fixup
185 jnz mp_set_tpr_failed
194 mov %bl, %ch /* ch = ppr */
196 /* now: %bl = irr, %bh = ppr */
198 ja mp_set_tpr_poll_irq
209 mov $kvm_hypercall_vapic_poll_irq, %eax
215 mov real_tpr, %eax ; fixup
221 movzbl vapic, %eax ; fixup
226 movzbl vapic, %ebx ; fixup
231 movzbl vapic, %ecx ; fixup
236 movzbl vapic, %edx ; fixup
241 movzbl vapic, %esi ; fixup
246 movzbl vapic, %edi ; fixup
251 movzbl vapic, %ebp ; fixup
256 movzbl vapic, %eax ; fixup
273 mov vapic, %eax ; fixup
278 /* %ebx = new vapic (%bl = tpr, %bh = isr, %b3 = irr) */
280 lock cmpxchg %ebx, vapic ; fixup
281 jnz up_set_tpr_failed
290 mov %bl, %ch /* ch = ppr */
292 /* now: %bl = irr, %bh = ppr */
294 ja up_set_tpr_poll_irq
304 mov $kvm_hypercall_vapic_poll_irq, %eax
314 * per-vcpu records of size 2^vcpu shift.
316 * byte 1: highest in-service interrupt (isr) (r/o); bits 3:0 are zero
318 * byte 3: highest pending interrupt (irr) (r/o)
327 .byte 0 # reserve space for signature