Re: [GIT PULL] Btrfs

From: Heiko Carstens
Date: Mon Nov 18 2013 - 04:37:22 EST


On Sun, Nov 17, 2013 at 11:36:04AM +0200, Gleb Natapov wrote:
> On Fri, Nov 15, 2013 at 03:57:23PM +0100, Heiko Carstens wrote:
> > On Fri, Nov 15, 2013 at 02:42:08PM +0100, Geert Uytterhoeven wrote:
> > > I was just going to comment that
> > >
> > > + const void *zero_page = (const void *) page_to_phys(ZERO_PAGE(0));
> > >
> > > won't fly. You can't just cast a physical address to "void *".
> >
> > Ouch.. I think that only works on s390 because we have a 1:1 mapping for
> > physical to virtual addresses in kernel space due to our split address spaces.
> >
> > So for btrfs and kvm it should be page_to_virt(), and for the dma_map_single()
> > case I have no idea. :)
> Can you send updated patch for kvm please?

See below. page_to_virt() is only defined for a couple of architectures, so I
used __va(page_to_phys()) instead.
I tested the patch on s390 only...