Skip to content

Commit 3cf4095

Browse files
Shannon ZhaoDavid Vrabel
authored andcommitted
arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table
Use xen_xlate_map_ballooned_pages to setup grant table. Then it doesn't rely on DT or ACPI to pass the start address and size of grant table. Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Julien Grall <julien.grall@arm.com> Tested-by: Julien Grall <julien.grall@arm.com>
1 parent 975fac3 commit 3cf4095

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

arch/arm/xen/enlighten.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,10 @@ static int __init xen_guest_init(void)
282282
{
283283
struct xen_add_to_physmap xatp;
284284
struct shared_info *shared_info_page = NULL;
285-
struct resource res;
286-
phys_addr_t grant_frames;
287285

288286
if (!xen_domain())
289287
return 0;
290288

291-
if (of_address_to_resource(xen_node, GRANT_TABLE_PHYSADDR, &res)) {
292-
pr_err("Xen grant table base address not found\n");
293-
return -ENODEV;
294-
}
295-
grant_frames = res.start;
296-
297289
xen_events_irq = irq_of_parse_and_map(xen_node, 0);
298290
if (!xen_events_irq) {
299291
pr_err("Xen event channel interrupt not found\n");
@@ -328,7 +320,10 @@ static int __init xen_guest_init(void)
328320
if (xen_vcpu_info == NULL)
329321
return -ENOMEM;
330322

331-
if (gnttab_setup_auto_xlat_frames(grant_frames)) {
323+
xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames();
324+
if (xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn,
325+
&xen_auto_xlat_grant_frames.vaddr,
326+
xen_auto_xlat_grant_frames.count)) {
332327
free_percpu(xen_vcpu_info);
333328
return -ENOMEM;
334329
}

0 commit comments

Comments
 (0)