goto out;
}
- init_int80_direct_trap(v);
-
/* IOPL privileges are virtualised. */
v->arch.pv_vcpu.iopl = v->arch.user_regs.eflags & X86_EFLAGS_IOPL;
v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
if ( guest_handle_is_null(traps) )
{
memset(dst, 0, NR_VECTORS * sizeof(*dst));
- init_int80_direct_trap(curr);
return 0;
}
memcpy(&dst[cur.vector], &cur, sizeof(cur));
- if ( cur.vector == 0x80 )
- init_int80_direct_trap(curr);
-
guest_handle_add_offset(traps, 1);
if ( hypercall_preempt_check() )
if ( guest_handle_is_null(traps) )
{
memset(dst, 0, NR_VECTORS * sizeof(*dst));
- init_int80_direct_trap(curr);
return 0;
}
XLAT_trap_info(dst + cur.vector, &cur);
- if ( cur.vector == 0x80 )
- init_int80_direct_trap(curr);
-
guest_handle_add_offset(traps, 1);
if ( hypercall_preempt_check() )
return !null_trap_bounce(curr, tb);
}
-void init_int80_direct_trap(struct vcpu *v)
-{
- struct trap_info *ti = &v->arch.pv_vcpu.trap_ctxt[0x80];
- struct trap_bounce *tb = &v->arch.pv_vcpu.int80_bounce;
-
- tb->cs = ti->cs;
- tb->eip = ti->address;
-
- if ( null_trap_bounce(v, tb) )
- tb->flags = 0;
- else
- tb->flags = TBF_EXCEPTION | (TI_GET_IF(ti) ? TBF_INTERRUPT : 0);
-}
-
struct softirq_trap {
struct domain *domain; /* domain to inject trap */
struct vcpu *vcpu; /* vcpu to inject trap */
OFFSET(VCPU_domain, struct vcpu, domain);
OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info);
OFFSET(VCPU_trap_bounce, struct vcpu, arch.pv_vcpu.trap_bounce);
- OFFSET(VCPU_int80_bounce, struct vcpu, arch.pv_vcpu.int80_bounce);
OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
OFFSET(VCPU_event_addr, struct vcpu, arch.pv_vcpu.event_callback_eip);
OFFSET(VCPU_event_sel, struct vcpu, arch.pv_vcpu.event_callback_cs);
movq STACK_CPUINFO_FIELD(current_vcpu)(%rbx), %rbx
- /* Check that the callback is non-null. */
- leaq VCPU_int80_bounce(%rbx),%rdx
- cmpb $0,TRAPBOUNCE_flags(%rdx)
+ mov VCPU_trap_ctxt(%rbx), %rsi
+ mov VCPU_domain(%rbx), %rax
+
+ /*
+ * if ( null_trap_bounce(v, &v->arch.pv_vcpu.trap_ctxt[0x80]) )
+ * goto int80_slow_path;
+ */
+ mov 0x80 * TRAPINFO_sizeof + TRAPINFO_eip(%rsi), %rdi
+ movzwl 0x80 * TRAPINFO_sizeof + TRAPINFO_cs (%rsi), %ecx
+
+ mov %ecx, %edx
+ and $~3, %edx
+
+ cmpb $0, DOMAIN_is_32bit_pv(%rax)
+ cmove %rdi, %rdx
+
+ test %rdx, %rdx
jz int80_slow_path
- movq VCPU_domain(%rbx),%rax
+ /* Construct trap_bounce from trap_ctxt[0x80]. */
+ lea VCPU_trap_bounce(%rbx), %rdx
+ movw %cx, TRAPBOUNCE_cs(%rdx)
+ movq %rdi, TRAPBOUNCE_eip(%rdx)
+
+ /* TB_flags = TBF_EXCEPTION | (TI_GET_IF(ti) ? TBF_INTERRUPT : 0); */
+ testb $4, 0x80 * TRAPINFO_sizeof + TRAPINFO_flags(%rsi)
+ setnz %cl
+ lea TBF_EXCEPTION(, %rcx, TBF_INTERRUPT), %ecx
+ mov %cl, TRAPBOUNCE_flags(%rdx)
+
cmpb $0, DOMAIN_is_32bit_pv(%rax)
jne compat_int80_direct_trap
/* Bounce information for propagating an exception to guest OS. */
struct trap_bounce trap_bounce;
- struct trap_bounce int80_bounce;
/* I/O-port access bitmap. */
XEN_GUEST_HANDLE(uint8) iobmp; /* Guest kernel vaddr of the bitmap. */
DECLARE_PER_CPU(struct tss_struct, init_tss);
DECLARE_PER_CPU(root_pgentry_t *, root_pgt);
-extern void init_int80_direct_trap(struct vcpu *v);
-
extern void write_ptbase(struct vcpu *v);
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */