mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
32-on-64: Fixes to previous changeset.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
5cc77f9098
commit
cdac12a18c
4 files changed
+15
-9
No files matched your search
@@ -1031,6 +1031,7 @@ gnttab_transfer(
|
||||
grant_entry_t *sha;
|
||||
struct gnttab_transfer gop;
|
||||
unsigned long mfn;
|
||||
unsigned int max_bitsize;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
@@ -1081,24 +1082,27 @@ gnttab_transfer(
|
||||
|
||||
if ( xsm_grant_transfer(d, e) )
|
||||
{
|
||||
gop.status = GNTST_permission_denied;
|
||||
unlock_and_copyback:
|
||||
rcu_unlock_domain(e);
|
||||
page->count_info &= ~(PGC_count_mask|PGC_allocated);
|
||||
free_domheap_page(page);
|
||||
gop.status = GNTST_permission_denied;
|
||||
goto copyback;
|
||||
}
|
||||
|
||||
if ( (1UL << domain_clamp_alloc_bitsize(e, BITS_PER_LONG-1)) <= mfn )
|
||||
max_bitsize = domain_clamp_alloc_bitsize(
|
||||
e, BITS_PER_LONG+PAGE_SHIFT-1);
|
||||
if ( (1UL << (max_bitsize - PAGE_SHIFT)) <= mfn )
|
||||
{
|
||||
struct page_info *new_page;
|
||||
void *sp, *dp;
|
||||
|
||||
new_page = alloc_domheap_pages(
|
||||
NULL, 0,
|
||||
MEMF_bits(domain_clamp_alloc_bitsize(e, BITS_PER_LONG-1)));
|
||||
new_page = alloc_domheap_pages(NULL, 0, MEMF_bits(max_bitsize));
|
||||
if ( new_page == NULL )
|
||||
{
|
||||
gop.status = GNTST_address_too_big;
|
||||
goto unlock_and_copyback;
|
||||
}
|
||||
|
||||
sp = map_domain_page(mfn);
|
||||
dp = map_domain_page(page_to_mfn(new_page));
|
||||
|
||||
+1
-1
@@ -342,7 +342,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
|
||||
d = current->domain;
|
||||
|
||||
memflags |= MEMF_bits(domain_clamp_alloc_bitsize(
|
||||
d, exch.out.address_bits ? : BITS_PER_LONG));
|
||||
d, exch.out.address_bits ? : (BITS_PER_LONG+PAGE_SHIFT)));
|
||||
|
||||
cpu = select_local_cpu(d);
|
||||
|
||||
|
||||
@@ -786,7 +786,7 @@ struct page_info *__alloc_domheap_pages(
|
||||
|
||||
ASSERT(!in_irq());
|
||||
|
||||
bits = domain_clamp_alloc_bitsize(d, bits ? : BITS_PER_LONG);
|
||||
bits = domain_clamp_alloc_bitsize(d, bits ? : (BITS_PER_LONG+PAGE_SHIFT));
|
||||
if ( bits <= (PAGE_SHIFT + 1) )
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -400,7 +400,8 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t);
|
||||
#define GNTST_no_device_space (-7) /* Out of space in I/O MMU. */
|
||||
#define GNTST_permission_denied (-8) /* Not enough privilege for operation. */
|
||||
#define GNTST_bad_page (-9) /* Specified page was invalid for op. */
|
||||
#define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary */
|
||||
#define GNTST_bad_copy_arg (-10) /* copy arguments cross page boundary. */
|
||||
#define GNTST_address_too_big (-11) /* transfer page address too large. */
|
||||
|
||||
#define GNTTABOP_error_msgs { \
|
||||
"okay", \
|
||||
@@ -413,7 +414,8 @@ DEFINE_XEN_GUEST_HANDLE(gnttab_unmap_and_replace_t);
|
||||
"no spare translation slot in the I/O MMU", \
|
||||
"permission denied", \
|
||||
"bad page", \
|
||||
"copy arguments cross page boundary" \
|
||||
"copy arguments cross page boundary", \
|
||||
"page address size too large" \
|
||||
}
|
||||
|
||||
#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
|
||||
|
||||