diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-08-09 10:01:17 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-08-09 10:01:17 +0100 |
commit | 7d973320189e8e77627f1661918196ac656f8fef (patch) | |
tree | d39a4200bf4793044aec60000be426b9121b06bf | |
parent | 3e1ac88f3c768922bcb9ad1c39223e42f845101b (diff) | |
download | xen-7d973320189e8e77627f1661918196ac656f8fef.tar.gz xen-7d973320189e8e77627f1661918196ac656f8fef.tar.bz2 xen-7d973320189e8e77627f1661918196ac656f8fef.zip |
Clean up usage of 'current' in do_iret() hypercall.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | xen/arch/x86/x86_32/traps.c | 7 | ||||
-rw-r--r-- | xen/arch/x86/x86_64/compat/traps.c | 19 | ||||
-rw-r--r-- | xen/arch/x86/x86_64/traps.c | 4 |
3 files changed, 17 insertions, 13 deletions
diff --git a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c index 5b391d60c1..813283b285 100644 --- a/xen/arch/x86/x86_32/traps.c +++ b/xen/arch/x86/x86_32/traps.c @@ -172,6 +172,7 @@ asmlinkage void do_double_fault(void) unsigned long do_iret(void) { struct cpu_user_regs *regs = guest_cpu_user_regs(); + struct vcpu *v = current; u32 eflags; /* Check worst-case stack frame for overlap with Xen protected area. */ @@ -215,10 +216,10 @@ unsigned long do_iret(void) } /* No longer in NMI context. */ - current->nmi_masked = 0; + v->nmi_masked = 0; /* Restore upcall mask from supplied EFLAGS.IF. */ - current->vcpu_info->evtchn_upcall_mask = !(eflags & X86_EFLAGS_IF); + vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF); /* * The hypercall exit path will overwrite EAX with this return @@ -228,7 +229,7 @@ unsigned long do_iret(void) exit_and_crash: gdprintk(XENLOG_ERR, "Fatal error\n"); - domain_crash(current->domain); + domain_crash(v->domain); return 0; } diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c index df1e512a21..4c6298dd58 100644 --- a/xen/arch/x86/x86_64/compat/traps.c +++ b/xen/arch/x86/x86_64/compat/traps.c @@ -37,6 +37,7 @@ void compat_show_guest_stack(struct cpu_user_regs *regs, int debug_stack_lines) unsigned int compat_iret(void) { struct cpu_user_regs *regs = guest_cpu_user_regs(); + struct vcpu *v = current; u32 eflags; /* Trim stack pointer to 32 bits. */ @@ -70,7 +71,7 @@ unsigned int compat_iret(void) * mode frames). */ const struct trap_info *ti; - u32 x, ksp = current->arch.guest_context.kernel_sp - 40; + u32 x, ksp = v->arch.guest_context.kernel_sp - 40; unsigned int i; int rc = 0; @@ -95,9 +96,9 @@ unsigned int compat_iret(void) if ( rc ) goto exit_and_crash; regs->_esp = ksp; - regs->ss = current->arch.guest_context.kernel_ss; + regs->ss = v->arch.guest_context.kernel_ss; - ti = ¤t->arch.guest_context.trap_ctxt[13]; + ti = &v->arch.guest_context.trap_ctxt[13]; if ( TI_GET_IF(ti) ) eflags &= ~X86_EFLAGS_IF; regs->_eflags = eflags & ~(X86_EFLAGS_VM|X86_EFLAGS_RF| @@ -121,10 +122,10 @@ unsigned int compat_iret(void) regs->_esp += 16; /* No longer in NMI context. */ - current->nmi_masked = 0; + v->nmi_masked = 0; /* Restore upcall mask from supplied EFLAGS.IF. */ - vcpu_info(current, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF); + vcpu_info(v, evtchn_upcall_mask) = !(eflags & X86_EFLAGS_IF); /* * The hypercall exit path will overwrite EAX with this return @@ -134,11 +135,12 @@ unsigned int compat_iret(void) exit_and_crash: gdprintk(XENLOG_ERR, "Fatal error\n"); - domain_crash(current->domain); + domain_crash(v->domain); return 0; } -static long compat_register_guest_callback(struct compat_callback_register *reg) +static long compat_register_guest_callback( + struct compat_callback_register *reg) { long ret = 0; struct vcpu *v = current; @@ -175,7 +177,8 @@ static long compat_register_guest_callback(struct compat_callback_register *reg) return ret; } -static long compat_unregister_guest_callback(struct compat_callback_unregister *unreg) +static long compat_unregister_guest_callback( + struct compat_callback_unregister *unreg) { long ret; diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c index ad4577ad55..1b8b0ad496 100644 --- a/xen/arch/x86/x86_64/traps.c +++ b/xen/arch/x86/x86_64/traps.c @@ -235,10 +235,10 @@ unsigned long do_iret(void) } /* No longer in NMI context. */ - current->nmi_masked = 0; + v->nmi_masked = 0; /* Restore upcall mask from supplied EFLAGS.IF. */ - vcpu_info(current, evtchn_upcall_mask) = !(iret_saved.rflags & EF_IE); + vcpu_info(v, evtchn_upcall_mask) = !(iret_saved.rflags & EF_IE); /* Saved %rax gets written back to regs->rax in entry.S. */ return iret_saved.rax; |