lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 20 Apr 2015 13:02:43 +0100
From:	David Vrabel <david.vrabel@...rix.com>
To:	Chen Baozi <cbz@...zis.org>, David Vrabel <david.vrabel@...rix.com>
CC:	<stefano.stabellini@...citrix.com>, <linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <xen-devel@...ts.xen.org>
Subject: Re: [Xen-devel] [PATCH] xen: Add __GFP_DMA flag when xen_swiotlb_init
 gets free pages.

On 20/04/15 12:07, Chen Baozi wrote:
> On Mon, Apr 20, 2015 at 11:53:47AM +0100, David Vrabel wrote:
>> On 20/04/15 11:48, Chen Baozi wrote:
>>> Make sure that xen_swiotlb_init allocates buffers that is DMA capable.
>>>
>>> Signed-off-by: Chen Baozi <baozich@...il.com>
>>> ---
>>>  drivers/xen/swiotlb-xen.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
>>> index 810ad41..7345afd 100644
>>> --- a/drivers/xen/swiotlb-xen.c
>>> +++ b/drivers/xen/swiotlb-xen.c
>>> @@ -235,7 +235,8 @@ retry:
>>>  #define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT))
>>>  #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
>>>  		while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) {
>>> -			xen_io_tlb_start = (void *)__get_free_pages(__GFP_NOWARN, order);
>>> +			xen_io_tlb_start = (void *)__get_free_pages(
>>> +						__GFP_NOWARN|__GFP_DMA, order);
>>
>> I think this breaks x86 where __GFP_DMA means below 16 MB.  Perhaps you
>> mean __GFP_DMA32?
> 
> __GFP_DMA32 doesn't help on arm64...
> 
> I guess there might be conflicts about the meaning of __GFP_DMA between x86 and
> arm?

Yes.

This is also conceptually wrong since it doesn't matter where the pages
are in PFN space,  but where they are in bus address (MFN) space (which
is what the subsequent hypercall is required to sort out).

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ