Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jan 2012 19:18:46 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: bus dma: a flag/quirk for page zero
Message-ID:  <4F0DC476.8050509@FreeBSD.org>
In-Reply-To: <201201111001.04724.jhb@freebsd.org>
References:  <4F0C9D14.60705@FreeBSD.org> <201201111001.04724.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 11/01/2012 17:01 John Baldwin said the following:
> I think this is fine, but you should just always exclude page zero when allocating
> bounce pages.  Bounce pages are assigned to zones that can be shared by multiple
> tags, so other tags that map to the same zone can alloc bounce pages that ohci
> will use (add_bounce_page() should probably take the bounce zone as an arg instead
> of a tag).  I think it's not worth creating a separate zone just for ohci, but
> to forbid page zero from all zones instead.

Thank you for the explanation.
Actually, I think that on x86 we don't have to do anything special for any memory
allocations that we do, including the bounce pages, as the page zero is excluded
from phys_avail and is not available for normal use.
The only thing we have to do on x86 is to bounce the page zero if it gets passed
to us.  (And that can happen only in very special situations, obviously.  I am not
sure if anything besides the system dump would do that.)

And I would prefer to defer any changes to !x86 bus dma to the respective platform
maintainers, obviously ;-)

> Also, please change this:
> 
> -	if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem)
> -	 || newtag->alignment > 1)
> +	if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) ||
> +	    newtag->alignment > 1)
> +		newtag->flags |= BUS_DMA_COULD_BOUNCE;
> +
> +	if ((newtag->flags & BUS_DMA_NO_PAGEZERO) != 0)
>  		newtag->flags |= BUS_DMA_COULD_BOUNCE;
> 
> To just be one if.

Will do.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F0DC476.8050509>