~ubuntu-branches/ubuntu/oneiric/seabios/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/0018-Minor-improvements-to-virtio-allow-irqs-allocate-pag.patch

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn, Serge Hallyn, Dustin Kirkland
  • Date: 2011-02-14 14:38:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110214143850-cmzexufi3dlrt7ga
Tags: 0.6.1.2-0ubuntu1
[ Serge Hallyn ]
* upstream merge
  - updated debian/watch
  - remove all patches as they are applied upstream
  - removed debian-changes-0.6.0-0ubuntu2 - I'm not certain about this one,
    so it may re-introduce a regression

[ Dustin Kirkland ]
* debian/rules: fix lintian warnings, install changelog, make binary build
  arch indep
* debian/control: update standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From ea8ac63a06bf621408d65fbfc17d77fa4a19be6f Mon Sep 17 00:00:00 2001
2
 
From: Kevin O'Connor <kevin@koconnor.net>
3
 
Date: Sun, 16 May 2010 11:34:38 -0400
4
 
Subject: [PATCH 18/54] Minor improvements to virtio (allow irqs, allocate page aligned).
5
 
 
6
 
Allow irqs to be handled while waiting for virtio reads to complete.
7
 
 
8
 
Use native page aligned allocations instead of manually aligning the
9
 
data.  This reduces the amount of low memory virtio requires.
10
 
 
11
 
Also, some minor white space cleanups.
12
 
---
13
 
 src/virtio-blk.c  |    9 ++++-----
14
 
 src/virtio-ring.h |    2 +-
15
 
 2 files changed, 5 insertions(+), 6 deletions(-)
16
 
 
17
 
diff --git a/src/virtio-blk.c b/src/virtio-blk.c
18
 
index 6c3f8a5..7cc2edb 100644
19
 
--- a/src/virtio-blk.c
20
 
+++ b/src/virtio-blk.c
21
 
@@ -58,7 +58,7 @@ virtio_blk_read(struct disk_op_s *op)
22
 
 
23
 
     /* Wait for reply */
24
 
     while (!vring_more_used(vq))
25
 
-        udelay(5);
26
 
+        usleep(5);
27
 
 
28
 
     /* Reclaim virtqueue element */
29
 
     vring_get_buf(vq, NULL);
30
 
@@ -104,7 +104,7 @@ virtio_blk_setup(void)
31
 
                 pci_bdf_to_dev(bdf));
32
 
         char *desc = malloc_tmphigh(MAXDESCSIZE);
33
 
         struct virtiodrive_s *vdrive_g = malloc_fseg(sizeof(*vdrive_g));
34
 
-        struct vring_virtqueue *vq = malloc_low(sizeof(*vq));
35
 
+        struct vring_virtqueue *vq = memalign_low(PAGE_SIZE, sizeof(*vq));
36
 
         if (!vdrive_g || !desc || !vq) {
37
 
             free(vdrive_g);
38
 
             free(desc);
39
 
@@ -131,7 +131,7 @@ virtio_blk_setup(void)
40
 
             free(desc);
41
 
             free(vq);
42
 
             dprintf(1, "fail to find vq for virtio-blk %x:%x\n",
43
 
-                    pci_bdf_to_bus (bdf), pci_bdf_to_dev(bdf));
44
 
+                    pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf));
45
 
             continue;
46
 
         }
47
 
 
48
 
@@ -141,7 +141,7 @@ virtio_blk_setup(void)
49
 
         vdrive_g->drive.blksize = cfg.blk_size;
50
 
         vdrive_g->drive.sectors = cfg.capacity;
51
 
         dprintf(3, "virtio-blk %x:%x blksize=%d sectors=%u\n",
52
 
-                pci_bdf_to_bus (bdf), pci_bdf_to_dev(bdf),
53
 
+                pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf),
54
 
                 vdrive_g->drive.blksize, (u32)vdrive_g->drive.sectors);
55
 
 
56
 
         vdrive_g->drive.pchs.cylinders = cfg.cylinders;
57
 
@@ -160,4 +160,3 @@ virtio_blk_setup(void)
58
 
                       VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK);
59
 
     }
60
 
 }
61
 
-
62
 
diff --git a/src/virtio-ring.h b/src/virtio-ring.h
63
 
index 95ae85b..3fb86fe 100644
64
 
--- a/src/virtio-ring.h
65
 
+++ b/src/virtio-ring.h
66
 
@@ -72,7 +72,7 @@ struct vring {
67
 
          + PAGE_MASK) & ~PAGE_MASK) + \
68
 
          (sizeof(struct vring_used) + sizeof(struct vring_used_elem) * num))
69
 
 
70
 
-typedef unsigned char virtio_queue_t[PAGE_MASK + vring_size(MAX_QUEUE_NUM)];
71
 
+typedef unsigned char virtio_queue_t[vring_size(MAX_QUEUE_NUM)];
72
 
 
73
 
 struct vring_virtqueue {
74
 
    virtio_queue_t queue;
75
 
1.7.1
76