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

Christian Borntraeger
2007-08-22T09:18:00Z

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 <borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>

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