direct-io.hg

changeset 15111:d431761a032a

[IA64] Defined guest_mode and use it instead of user_mode.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
author Alex Williamson <alex.williamson@hp.com>
date Thu May 10 13:29:33 2007 -0600 (2007-05-10)
parents eabda101b0c5
children 8745300bec4e
files xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/xen/faults.c xen/arch/ia64/xen/xenmisc.c xen/include/asm-ia64/linux-xen/asm/ptrace.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Tue May 08 13:12:52 2007 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Thu May 10 13:29:33 2007 -0600
     1.3 @@ -164,7 +164,7 @@ vmx_ia64_handle_break (unsigned long ifa
     1.4          if (iim == 0) 
     1.5              vmx_die_if_kernel("Break 0 in Hypervisor.", regs, iim);
     1.6  
     1.7 -        if (!user_mode(regs)) {
     1.8 +        if (ia64_psr(regs)->cpl == 0) {
     1.9              /* Allow hypercalls only when cpl = 0.  */
    1.10              if (iim == d->arch.breakimm) {
    1.11                  ia64_hypercall(regs);
     2.1 --- a/xen/arch/ia64/xen/faults.c	Tue May 08 13:12:52 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/faults.c	Thu May 10 13:29:33 2007 -0600
     2.3 @@ -209,7 +209,7 @@ void ia64_do_page_fault(unsigned long ad
     2.4  
     2.5  	if (is_ptc_l_needed)
     2.6  		vcpu_ptc_l(current, address, logps);
     2.7 -	if (!user_mode(regs)) {
     2.8 +	if (!guest_mode(regs)) {
     2.9  		/* The fault occurs inside Xen.  */
    2.10  		if (!ia64_done_with_exception(regs)) {
    2.11  			// should never happen.  If it does, region 0 addr may
     3.1 --- a/xen/arch/ia64/xen/xenmisc.c	Tue May 08 13:12:52 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Thu May 10 13:29:33 2007 -0600
     3.3 @@ -79,7 +79,7 @@ void console_print(char *msg)
     3.4  
     3.5  void die_if_kernel(char *str, struct pt_regs *regs, long err)
     3.6  {
     3.7 -	if (user_mode(regs))
     3.8 +	if (guest_mode(regs))
     3.9  		return;
    3.10  
    3.11  	printk("%s: %s %ld\n", __func__, str, err);
     4.1 --- a/xen/include/asm-ia64/linux-xen/asm/ptrace.h	Tue May 08 13:12:52 2007 -0600
     4.2 +++ b/xen/include/asm-ia64/linux-xen/asm/ptrace.h	Thu May 10 13:29:33 2007 -0600
     4.3 @@ -265,7 +265,11 @@ struct switch_stack {
     4.4    /* given a pointer to a task_struct, return the user's pt_regs */
     4.5  # define ia64_task_regs(t)		(((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1)
     4.6  # define ia64_psr(regs)			((struct ia64_psr *) &(regs)->cr_ipsr)
     4.7 +#ifdef XEN
     4.8 +# define guest_mode(regs)		(ia64_psr(regs)->cpl != 0)
     4.9 +#else
    4.10  # define user_mode(regs)		(((struct ia64_psr *) &(regs)->cr_ipsr)->cpl != 0)
    4.11 +#endif
    4.12  # define user_stack(task,regs)	((long) regs - (long) task == IA64_STK_OFFSET - sizeof(*regs))
    4.13  # define fsys_mode(task,regs)					\
    4.14    ({								\