direct-io.hg

changeset 2720:cf913b2c5774

bitkeeper revision 1.1159.1.262 (417937bdRu3MLdOeOXMt7hGr1AHoeg)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xeno.bk-26dom0
into freefall.cl.cam.ac.uk:/local/scratch/cl349/xeno.bk-24dom0
author cl349@freefall.cl.cam.ac.uk
date Fri Oct 22 16:39:25 2004 +0000 (2004-10-22)
parents 77fbe6c094f2 bd93b9d866a5
children 057ea964561d
files linux-2.6.8.1-xen-sparse/arch/xen/kernel/ctrl_if.c xen/arch/x86/memory.c xen/common/event_channel.c
line diff
     1.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Oct 22 15:56:04 2004 +0000
     1.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Oct 22 16:39:25 2004 +0000
     1.3 @@ -481,6 +481,8 @@ void ctrl_if_resume(void)
     1.4          op.cmd = EVTCHNOP_bind_interdomain;
     1.5          op.u.bind_interdomain.dom1 = DOMID_SELF;
     1.6          op.u.bind_interdomain.dom2 = DOMID_SELF;
     1.7 +        op.u.bind_interdomain.port1 = 0;
     1.8 +        op.u.bind_interdomain.port2 = 0;
     1.9          if ( HYPERVISOR_event_channel_op(&op) != 0 )
    1.10              BUG();
    1.11          xen_start_info.domain_controller_evtchn = op.u.bind_interdomain.port1;
     2.1 --- a/xen/arch/x86/memory.c	Fri Oct 22 15:56:04 2004 +0000
     2.2 +++ b/xen/arch/x86/memory.c	Fri Oct 22 16:39:25 2004 +0000
     2.3 @@ -401,16 +401,9 @@ get_page_from_l1e(
     2.4          return 0;
     2.5      }
     2.6  
     2.7 -    if ( unlikely(!get_page_from_pagenr(pfn, d)) )
     2.8 -        return 0;
     2.9 -
    2.10 -    if ( l1v & _PAGE_RW )
    2.11 -    {
    2.12 -        if ( unlikely(!get_page_type(page, PGT_writable_page)) )
    2.13 -            return 0;
    2.14 -    }
    2.15 -
    2.16 -    return 1;
    2.17 +    return ((l1v & _PAGE_RW) ?
    2.18 +            get_page_and_type(page, d, PGT_writable_page) :
    2.19 +            get_page(page, d));
    2.20  }
    2.21  
    2.22  
     3.1 --- a/xen/common/event_channel.c	Fri Oct 22 15:56:04 2004 +0000
     3.2 +++ b/xen/common/event_channel.c	Fri Oct 22 16:39:25 2004 +0000
     3.3 @@ -167,9 +167,12 @@ static long evtchn_bind_interdomain(evtc
     3.4          break;
     3.5  
     3.6      case ECS_INTERDOMAIN:
     3.7 -        rc = ((d1->event_channel[port1].u.interdomain.remote_dom != d2) ||
     3.8 -              (d1->event_channel[port1].u.interdomain.remote_port != port2)) ?
     3.9 -            -EINVAL : 0;
    3.10 +        if ( d1->event_channel[port1].u.interdomain.remote_dom != d2 )
    3.11 +            ERROR_EXIT(-EINVAL);
    3.12 +        if ( (d1->event_channel[port1].u.interdomain.remote_port != port2) &&
    3.13 +             (bind->port2 != 0) )
    3.14 +            ERROR_EXIT(-EINVAL);
    3.15 +        port2 = d1->event_channel[port1].u.interdomain.remote_port;
    3.16          goto out;
    3.17  
    3.18      default:
    3.19 @@ -180,6 +183,8 @@ static long evtchn_bind_interdomain(evtc
    3.20      switch ( d2->event_channel[port2].state )
    3.21      {
    3.22      case ECS_FREE:
    3.23 +        if ( !IS_PRIV(current) && (dom2 != DOMID_SELF) )
    3.24 +            ERROR_EXIT(-EPERM);
    3.25          break;
    3.26  
    3.27      case ECS_UNBOUND:
    3.28 @@ -187,6 +192,15 @@ static long evtchn_bind_interdomain(evtc
    3.29              ERROR_EXIT(-EINVAL);
    3.30          break;
    3.31  
    3.32 +    case ECS_INTERDOMAIN:
    3.33 +        if ( d2->event_channel[port2].u.interdomain.remote_dom != d1 )
    3.34 +            ERROR_EXIT(-EINVAL);
    3.35 +        if ( (d2->event_channel[port2].u.interdomain.remote_port != port1) &&
    3.36 +             (bind->port1 != 0) )
    3.37 +            ERROR_EXIT(-EINVAL);
    3.38 +        port1 = d2->event_channel[port2].u.interdomain.remote_port;
    3.39 +        goto out;
    3.40 +
    3.41      default:
    3.42          ERROR_EXIT(-EINVAL);
    3.43      }