WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] minios: Fix bug when blkfront reading int

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Fix bug when blkfront reading into zero-mapped buffer
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Jan 2008 07:40:17 -0800
Delivery-date: Tue, 29 Jan 2008 07:40:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1201619907 0
# Node ID 1a357a1504b26755edfac3fe0a37ea805d071d3a
# Parent  233f40973e1d689d66b25e439b2f48524dd579ea
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@xxxxxxxxxxxxx>
---
 extras/mini-os/blkfront.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -r 233f40973e1d -r 1a357a1504b2 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Tue Jan 29 15:16:35 2008 +0000
+++ b/extras/mini-os/blkfront.c Tue Jan 29 15:18:27 2008 +0000
@@ -88,7 +88,7 @@ struct blkfront_dev *init_blkfront(char 
     SHARED_RING_INIT(s);
     FRONT_RING_INIT(&dev->ring, s, PAGE_SIZE);
 
-    dev->ring_ref = gnttab_grant_access(0,virtual_to_mfn(s),0);
+    dev->ring_ref = gnttab_grant_access(0,virt_to_mfn(s),0);
 
     evtchn_alloc_unbound_t op;
     op.dom = DOMID_SELF;
@@ -274,6 +274,11 @@ void blkfront_aio(struct blkfront_aiocb 
 
     for (j = 0; j < n; j++) {
        uintptr_t data = start + j * PAGE_SIZE;
+        if (!write) {
+            /* Trigger CoW if needed */
+            *(char*)data = 0;
+            barrier();
+        }
        aiocbp->gref[j] = req->seg[j].gref =
             gnttab_grant_access(0, virtual_to_mfn(data), write);
        req->seg[j].first_sect = 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] minios: Fix bug when blkfront reading into zero-mapped buffer, Xen patchbot-unstable <=