*** /home/vduvvuru/xen-3.3.0/xen/common/grant_table.c 2008-12-19 19:41:28.000000000 +0530 --- xen/common/grant_table.c 2009-02-02 21:38:23.000000000 +0530 *************** *** 1284,1289 **** --- 1284,1290 ---- act = &active_entry(rd->grant_table, gref); sha = &shared_entry(rd->grant_table, gref); + /* If already pinned, check the active domid and avoid refcnt overflow. */ if ( act->pin && ((act->domid != current->domain->domain_id) || *************** *** 1300,1313 **** for ( ; ; ) { /* If not already pinned, check the grant domid and type. */ ! if ( !act->pin && (((scombo.shorts.flags & GTF_type_mask) != GTF_permit_access) || (scombo.shorts.domid != current->domain->domain_id)) ) PIN_FAIL(unlock_out, GNTST_general_error, "Bad flags (%x) or dom (%d). (expected dom %d)\n", scombo.shorts.flags, scombo.shorts.domid, current->domain->domain_id); new_scombo = scombo; new_scombo.shorts.flags |= GTF_reading; --- 1301,1317 ---- for ( ; ; ) { /* If not already pinned, check the grant domid and type. */ ! /* if ( !act->pin && (((scombo.shorts.flags & GTF_type_mask) != GTF_permit_access) || (scombo.shorts.domid != current->domain->domain_id)) ) + { + gdprintk(XENLOG_INFO, "Grant entry Info \n Domid=%d, Flags=%d, Frame=%d\n",sha->domid,sha->flags,sha->frame); PIN_FAIL(unlock_out, GNTST_general_error, "Bad flags (%x) or dom (%d). (expected dom %d)\n", scombo.shorts.flags, scombo.shorts.domid, current->domain->domain_id); + }*/ new_scombo = scombo; new_scombo.shorts.flags |= GTF_reading; *************** *** 1366,1375 **** src_is_gref = op->flags & GNTCOPY_source_gref; dest_is_gref = op->flags & GNTCOPY_dest_gref; ! if ( (op->source.domid != DOMID_SELF && !src_is_gref ) || (op->dest.domid != DOMID_SELF && !dest_is_gref) ) PIN_FAIL(error_out, GNTST_permission_denied, ! "only allow copy-by-mfn for DOMID_SELF.\n"); if ( op->source.domid == DOMID_SELF ) sd = rcu_lock_current_domain(); --- 1370,1379 ---- src_is_gref = op->flags & GNTCOPY_source_gref; dest_is_gref = op->flags & GNTCOPY_dest_gref; ! /* if ( (op->source.domid != DOMID_SELF && !src_is_gref ) || (op->dest.domid != DOMID_SELF && !dest_is_gref) ) PIN_FAIL(error_out, GNTST_permission_denied, ! "only allow copy-by-mfn for DOMID_SELF.\n");*/ if ( op->source.domid == DOMID_SELF ) sd = rcu_lock_current_domain(); *************** *** 1392,1401 **** --- 1396,1408 ---- if ( src_is_gref ) { + gdprintk(XENLOG_INFO, "Entering Source Stuff \n"); + gdprintk(XENLOG_INFO, "Source gref is %d \n",op->source.u.ref); rc = __acquire_grant_for_copy(sd, op->source.u.ref, 1, &s_frame); if ( rc != GNTST_okay ) goto error_out; have_s_grant = 1; + gdprintk(XENLOG_INFO, "Exiting Source Stuff \n"); } else { *************** *** 1415,1424 **** --- 1422,1434 ---- if ( dest_is_gref ) { + gdprintk(XENLOG_INFO, "Entering dest Stuff \n"); + gdprintk(XENLOG_INFO, "dest gref is %d \n",op->dest.u.ref); rc = __acquire_grant_for_copy(dd, op->dest.u.ref, 0, &d_frame); if ( rc != GNTST_okay ) goto error_out; have_d_grant = 1; + gdprintk(XENLOG_INFO, "Exiting dest Stuff \n"); } else {