if ( op->flags & GNTMAP_host_map )
{
/* Could be an iomem page for setting up permission */
- if( iomem_page_test(frame, mfn_to_page(frame)) ) {
+ if ( iomem_page_test(frame, mfn_to_page(frame)) )
+ {
is_iomem = 1;
- if ( iomem_permit_access(ld, frame, frame) ) {
+ if ( iomem_permit_access(ld, frame, frame) )
+ {
gdprintk(XENLOG_WARNING,
- "Could not permit access to grant frame %lx as iomem\n",
- frame);
+ "Could not permit access to grant frame "
+ "%lx as iomem\n", frame);
rc = GNTST_general_error;
goto undo_out;
}
}
}
- if (!is_iomem )
+ if ( !is_iomem )
{
if ( unlikely(!mfn_valid(frame)) ||
unlikely(!((op->flags & GNTMAP_readonly) ?
PGT_writable_page))))
{
if ( !rd->is_dying )
- gdprintk(XENLOG_WARNING, "Could not pin grant frame %lx\n", frame);
+ gdprintk(XENLOG_WARNING,
+ "Could not pin grant frame %lx\n", frame);
rc = GNTST_general_error;
goto undo_out;
}
rd = op->rd;
- if ( rd == NULL ) {
+ if ( rd == NULL )
+ {
/*
* Suggests that __gntab_unmap_common failed in
* rcu_lock_domain_by_id() or earlier, and so we have nothing
struct gnttab_unmap_grant_ref op;
struct gnttab_unmap_common common[GNTTAB_UNMAP_BATCH_SIZE];
- while (count != 0) {
+ while ( count != 0 )
+ {
c = min(count, (unsigned int)GNTTAB_UNMAP_BATCH_SIZE);
partial_done = 0;
flush_tlb_mask(current->domain->domain_dirty_cpumask);
for ( i = 0; i < partial_done; i++ )
- {
__gnttab_unmap_common_complete(&(common[i]));
- }
count -= c;
done += c;
flush_tlb_mask(current->domain->domain_dirty_cpumask);
for ( i = 0; i < partial_done; i++ )
- {
__gnttab_unmap_common_complete(&(common[i]));
- }
return -EFAULT;
}
struct gnttab_unmap_and_replace op;
struct gnttab_unmap_common common[GNTTAB_UNMAP_BATCH_SIZE];
- while (count != 0) {
+ while ( count != 0 )
+ {
c = min(count, (unsigned int)GNTTAB_UNMAP_BATCH_SIZE);
partial_done = 0;
flush_tlb_mask(current->domain->domain_dirty_cpumask);
for ( i = 0; i < partial_done; i++ )
- {
__gnttab_unmap_common_complete(&(common[i]));
- }
count -= c;
done += c;
flush_tlb_mask(current->domain->domain_dirty_cpumask);
for ( i = 0; i < partial_done; i++ )
- {
__gnttab_unmap_common_complete(&(common[i]));
- }
return -EFAULT;
}
guest_handle_cast(uop, gnttab_map_grant_ref_t);
if ( unlikely(!guest_handle_okay(map, count)) )
goto out;
- rc = -EPERM;
- if ( unlikely(!grant_operation_permitted(d)) )
- goto out;
rc = gnttab_map_grant_ref(map, count);
break;
}
guest_handle_cast(uop, gnttab_unmap_grant_ref_t);
if ( unlikely(!guest_handle_okay(unmap, count)) )
goto out;
- rc = -EPERM;
- if ( unlikely(!grant_operation_permitted(d)) )
- goto out;
rc = gnttab_unmap_grant_ref(unmap, count);
break;
}
guest_handle_cast(uop, gnttab_unmap_and_replace_t);
if ( unlikely(!guest_handle_okay(unmap, count)) )
goto out;
- rc = -EPERM;
- if ( unlikely(!grant_operation_permitted(d)) )
- goto out;
rc = -ENOSYS;
if ( unlikely(!replace_grant_supported()) )
goto out;
guest_handle_cast(uop, gnttab_transfer_t);
if ( unlikely(!guest_handle_okay(transfer, count)) )
goto out;
- rc = -EPERM;
- if ( unlikely(!grant_operation_permitted(d)) )
- goto out;
rc = gnttab_transfer(transfer, count);
break;
}