Skip to content
Commit 42b36cc0 authored by Rusty Russell's avatar Rusty Russell
Browse files

virtio: Force use of power-of-two for descriptor ring sizes



The virtio descriptor rings of size N-1 were nicely set up to be
aligned to an N-byte boundary.  But as Anthony Liguori points out, the
free-running indices used by virtio require that the sizes be a power
of 2, otherwise we get problems on wrap (demonstrated with lguest).

So we replace the clever "2^n-1" scheme with a simple "align to page
boundary" scheme: this means that all virtio rings take at least two
pages, but it's safer than guessing cache alignment.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 1200e646
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment