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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux