}
max_bitsize = domain_clamp_alloc_bitsize(
- e, BITS_PER_LONG+PAGE_SHIFT-1);
+ e, e->grant_table->gt_version > 1 || paging_mode_translate(e)
+ ? BITS_PER_LONG + PAGE_SHIFT : 32 + PAGE_SHIFT);
if ( (1UL << (max_bitsize - PAGE_SHIFT)) <= mfn )
{
struct page_info *new_page;
if ( e->grant_table->gt_version == 1 )
{
grant_entry_v1_t *sha = &shared_entry_v1(e->grant_table, gop.ref);
+
guest_physmap_add_page(e, sha->frame, mfn, 0);
- sha->frame = mfn;
+ if ( !paging_mode_translate(e) )
+ sha->frame = mfn;
}
else
{
grant_entry_v2_t *sha = &shared_entry_v2(e->grant_table, gop.ref);
+
guest_physmap_add_page(e, sha->full_page.frame, mfn, 0);
- sha->full_page.frame = mfn;
+ if ( !paging_mode_translate(e) )
+ sha->full_page.frame = mfn;
}
smp_wmb();
shared_entry_header(e->grant_table, gop.ref)->flags |=
/* The domain being granted foreign privileges. [GST] */
domid_t domid;
/*
- * GTF_permit_access: Frame that @domid is allowed to map and access. [GST]
- * GTF_accept_transfer: Frame whose ownership transferred by @domid. [XEN]
+ * GTF_permit_access: GFN that @domid is allowed to map and access. [GST]
+ * GTF_accept_transfer: GFN that @domid is allowed to transfer into. [GST]
+ * GTF_transfer_completed: MFN whose ownership transferred by @domid
+ * (non-translated guests only). [XEN]
*/
uint32_t frame;
};