Thread (1 message) 1 message, 1 author, 2007-08-22

Re: [kvm-devel] [PATCH 00/10] PV-IO v3

From: Christian Borntraeger <hidden>
Date: 2007-08-22 09:18:00

Am Mittwoch, 22. August 2007 schrieb Rusty Russell:
quoted hunk
+struct desc_pages
+{
+	/* Page of descriptors. */
+	struct lguest_desc desc[NUM_DESCS];
+
+	/* Next page: how we tell other side what buffers are available. */
+	unsigned int avail_idx;
+	unsigned int available[NUM_DESCS];
+	char pad[PAGE_SIZE - (NUM_DESCS+1) * sizeof(unsigned int)];
+
+	/* Third page: how other side tells us what's used. */
+	unsigned int used_idx;
+	struct lguest_used used[NUM_DESCS];
+};
Please consider to add this patch to make this data structure work on 64 bit 
to make the second page, really page aligned. On 32 bit this should be a 
no-op.

Signed-Off-by: Christian Borntraeger <redacted>

---
 drivers/lguest/lguest_virtio.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: lguest/drivers/lguest/lguest_virtio.c
===================================================================
--- lguest.orig/drivers/lguest/lguest_virtio.c
+++ lguest/drivers/lguest/lguest_virtio.c
@@ -33,11 +33,12 @@ struct desc_pages
 {
 	/* Page of descriptors. */
 	struct lguest_desc desc[NUM_DESCS];
+	char pad0[PAGE_SIZE - NUM_DESCS * sizeof(struct lguest_desc)];
 
 	/* Next page: how we tell other side what buffers are available. */
 	unsigned int avail_idx;
 	unsigned int available[NUM_DESCS];
-	char pad[PAGE_SIZE - (NUM_DESCS+1) * sizeof(unsigned int)];
+	char pad1[PAGE_SIZE - (NUM_DESCS+1) * sizeof(unsigned int)];
 
 	/* Third page: how other side tells us what's used. */
 	unsigned int used_idx;

-- 
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Herbert Kircher 
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help