Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147727941
D29602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29602.diff
View Options
diff --git a/sys/dev/xen/grant_table/grant_table.c b/sys/dev/xen/grant_table/grant_table.c
--- a/sys/dev/xen/grant_table/grant_table.c
+++ b/sys/dev/xen/grant_table/grant_table.c
@@ -503,7 +503,7 @@
static vm_paddr_t resume_frames;
-static int
+static void
gnttab_map(unsigned int start_idx, unsigned int end_idx)
{
struct xen_add_to_physmap xatp;
@@ -521,21 +521,6 @@
if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
panic("HYPERVISOR_memory_op failed to map gnttab");
} while (i-- > start_idx);
-
- if (shared == NULL) {
- vm_offset_t area;
-
- area = kva_alloc(PAGE_SIZE * max_nr_grant_frames());
- KASSERT(area, ("can't allocate VM space for grant table"));
- shared = (grant_entry_t *)area;
- }
-
- for (i = start_idx; i <= end_idx; i++) {
- pmap_kenter((vm_offset_t) shared + i * PAGE_SIZE,
- resume_frames + i * PAGE_SIZE);
- }
-
- return (0);
}
int
@@ -557,15 +542,16 @@
if (gnttab_pseudo_phys_res == NULL)
panic("Unable to reserve physical memory for gnttab");
resume_frames = rman_get_start(gnttab_pseudo_phys_res);
+ shared = rman_get_virtual(gnttab_pseudo_phys_res);
}
+ gnttab_map(0, nr_gframes - 1);
- return (gnttab_map(0, nr_gframes - 1));
+ return (0);
}
static int
gnttab_expand(unsigned int req_entries)
{
- int error;
unsigned int cur, extra;
cur = nr_grant_frames;
@@ -573,11 +559,9 @@
if (cur + extra > max_nr_grant_frames())
return (ENOSPC);
- error = gnttab_map(cur, cur + extra - 1);
- if (!error)
- error = grow_gnttab_list(extra);
+ gnttab_map(cur, cur + extra - 1);
- return (error);
+ return (grow_gnttab_list(extra));
}
MTX_SYSINIT(gnttab, &gnttab_list_lock, "GNTTAB LOCK", MTX_DEF | MTX_RECURSE);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 14, 6:03 AM (20 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29655950
Default Alt Text
D29602.diff (1 KB)
Attached To
Mode
D29602: xen/grant-table: remove explicit linear mapping additions
Attached
Detach File
Event Timeline
Log In to Comment