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-next>] [day] [month] [year] [list]
Message-Id: <200806301551.42252.oliver@neukum.org>
Date:	Mon, 30 Jun 2008 15:51:41 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	"Francis Moreau" <francis.moro@...il.com>
Cc:	"David Brownell" <david-b@...bell.net>, linux-usb@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: usb_get_status(): what a weird implementation !

Am Montag 30 Juni 2008 14:41:37 schrieb Francis Moreau:
> On Mon, Jun 30, 2008 at 1:46 PM, Oliver Neukum <oliver@...kum.org> wrote:
> > Am Montag 30 Juni 2008 13:04:21 schrieb Francis Moreau:

> >> well, it wouldn't be hard to allocated a buf on the stack with correct
> >> alignement
> >> and size for DMA mapping.
> >
> > Where would you put it and meet the alignment requirements?
> >
> 
> wouldn't this code below do the trick ?
> 
> void foo(void)
> {
>     unsigned char __buf[2 * CACHE_LINE_SIZE];
>     unsigned char *buf;
> 
>     buf = ((unsigned long)__buf) + CACHE_LINE_SIZE-1) & ~(CACHE_LINE_SIZE-1);
> }
> 
> but I agree it looks hackish.

If your buffer is smaller than CACHE_LINE_SIZE it should work.
However, this needs input from people who understand DMA in and out.
But how large is 2 * CACHE_LINE_SIZE compared to the kernel stack?

	Regards
		Oliver
--
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