Re: [PATCH] qemu: define and use VIRTIO_PFN_SHIFT

Hollis Blanchard <[email protected]>
Newsgroups org.kernel.vger.kvm-ia64,org.kernel.vger.kvm,org.kernel.vger.kvm-ppc
Message-ID <[email protected]>
On Thu, 2008-11-06 at 08:01 -0600, Anthony Liguori wrote:
> Hollis Blanchard wrote:
> > # HG changeset patch
> > # User Hollis Blanchard <[email protected]>
> > # Date 1225946837 21600
> > # Node ID 43a111ea61b542d3823e2a11d017e7b06b7ec254
> > # Parent  b63967268af119e0faa4adc3086cdef857815548
> > qemu: define and use VIRTIO_PFN_SHIFT
> >
> > The virtio front and back ends must agree about how big a pfn really
> is. Since
> > qemu has no idea what "page size" the guest may be using, it must be
> > independent of TARGET_PAGE_BITS.
> >
> > This patch should have no functional effect on x86 or ia64, but I'd
> like an ack from the
> > ia64 guys.
> >   
> 
> Would be better to add a new header in target-XXX instead of using 
> cpu.h.  Virtio is not part of the CPU ISA.

OK.

> > Signed-off-by: Hollis Blanchard <[email protected]>
> >
> > diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
> > --- a/qemu/hw/virtio.c
> > +++ b/qemu/hw/virtio.c
> > @@ -56,6 +56,10 @@
> >   */
> >  #define wmb() do { } while (0)
> >  
> > +#define VRING_PAGE_SIZE (1<<12)
> > +
> > +#define ALIGN(x, a)  (((x)+(a)-1) & ~((a)-1))
> > +
> >  /* virt queue functions */
> 
> Why is VRING_PAGE_SIZE not architecture specific?

I wanted to make sure people on non-x86 architectures couldn't run into
vring-size related problems that didn't also appear on x86.

-- 
Hollis Blanchard
IBM Linux Technology Center
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.