ia64/xen-unstable

changeset 16934:1a357a1504b2

minios: Fix bug when blkfront reading into zero-mapped buffer
by just poking the page.
No need to use virtual_to_mfn() for the ring since that is a real page.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 29 15:18:27 2008 +0000 (2008-01-29)
parents 233f40973e1d
children daf1862c4ee5
files extras/mini-os/blkfront.c
line diff
     1.1 --- a/extras/mini-os/blkfront.c	Tue Jan 29 15:16:35 2008 +0000
     1.2 +++ b/extras/mini-os/blkfront.c	Tue Jan 29 15:18:27 2008 +0000
     1.3 @@ -88,7 +88,7 @@ struct blkfront_dev *init_blkfront(char 
     1.4      SHARED_RING_INIT(s);
     1.5      FRONT_RING_INIT(&dev->ring, s, PAGE_SIZE);
     1.6  
     1.7 -    dev->ring_ref = gnttab_grant_access(0,virtual_to_mfn(s),0);
     1.8 +    dev->ring_ref = gnttab_grant_access(0,virt_to_mfn(s),0);
     1.9  
    1.10      evtchn_alloc_unbound_t op;
    1.11      op.dom = DOMID_SELF;
    1.12 @@ -274,6 +274,11 @@ void blkfront_aio(struct blkfront_aiocb 
    1.13  
    1.14      for (j = 0; j < n; j++) {
    1.15  	uintptr_t data = start + j * PAGE_SIZE;
    1.16 +        if (!write) {
    1.17 +            /* Trigger CoW if needed */
    1.18 +            *(char*)data = 0;
    1.19 +            barrier();
    1.20 +        }
    1.21  	aiocbp->gref[j] = req->seg[j].gref =
    1.22              gnttab_grant_access(0, virtual_to_mfn(data), write);
    1.23  	req->seg[j].first_sect = 0;