Am Mittwoch, 22. August 2007 schrieb Rusty Russell:
> +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 <[EMAIL PROTECTED]>

---
 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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to