Commit 526e8262 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus-6.0-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip

Pull xen fix from Juergen Gross:
 "A single fix for an issue in the xenbus driver (initialization of
  multi-page rings for Xen PV devices)"

* tag 'for-linus-6.0-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xen/xenbus: fix xenbus_setup_ring()
parents 22565ae7 ce6b8ccd
...@@ -382,9 +382,10 @@ int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr, ...@@ -382,9 +382,10 @@ int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr,
unsigned long ring_size = nr_pages * XEN_PAGE_SIZE; unsigned long ring_size = nr_pages * XEN_PAGE_SIZE;
grant_ref_t gref_head; grant_ref_t gref_head;
unsigned int i; unsigned int i;
void *addr;
int ret; int ret;
*vaddr = alloc_pages_exact(ring_size, gfp | __GFP_ZERO); addr = *vaddr = alloc_pages_exact(ring_size, gfp | __GFP_ZERO);
if (!*vaddr) { if (!*vaddr) {
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
...@@ -401,13 +402,15 @@ int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr, ...@@ -401,13 +402,15 @@ int xenbus_setup_ring(struct xenbus_device *dev, gfp_t gfp, void **vaddr,
unsigned long gfn; unsigned long gfn;
if (is_vmalloc_addr(*vaddr)) if (is_vmalloc_addr(*vaddr))
gfn = pfn_to_gfn(vmalloc_to_pfn(vaddr[i])); gfn = pfn_to_gfn(vmalloc_to_pfn(addr));
else else
gfn = virt_to_gfn(vaddr[i]); gfn = virt_to_gfn(addr);
grefs[i] = gnttab_claim_grant_reference(&gref_head); grefs[i] = gnttab_claim_grant_reference(&gref_head);
gnttab_grant_foreign_access_ref(grefs[i], dev->otherend_id, gnttab_grant_foreign_access_ref(grefs[i], dev->otherend_id,
gfn, 0); gfn, 0);
addr += XEN_PAGE_SIZE;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment