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]
Message-ID: <CAMjpGUeMqVzcAWKpAojZVbj9ywH+4HmW4Hx-8D1WQmTqPSNqQA@mail.gmail.com>
Date:	Sat, 2 Jul 2011 13:04:05 -0400
From:	Mike Frysinger <vapier@...too.org>
To:	Jonas Bonn <jonas@...thpole.se>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	liqin.chen@...plusct.com, gxt@...c.pku.edu.cn
Subject: Re: [PATCH 1/2] asm-generic: add MMU variants of io.h functions

On Sat, Jul 2, 2011 at 12:47, Jonas Bonn wrote:
> On Sat, 2011-07-02 at 12:38 -0400, Mike Frysinger wrote:
>> On Sat, Jul 2, 2011 at 11:53, Jonas Bonn wrote:
>> > +#ifdef CONFIG_MMU
>> > +#define xlate_dev_mem_ptr(p)   __va(p)
>> > +#else
>> >  #define xlate_dev_mem_ptr(p)   ((void *) (p))
>> > +#endif
>>
>> i wonder if we could do:
>> #ifndef __va
>> #define __va(p) ((void *)(p))
>> #endif
>> #define xlate_dev_mem_ptr(p)   __va(p)
>> -mike
>
> This seems to introduce an artificial definition of a "virtual" address
> for systems without an MMU, which strikes me as a bit odd.  If this is
> what people prefer, that's fine... I think I prefer the former variant,
> though.

this isnt a problem.  we do this sort of thing in many places since
people develop under MMU and use the API that exists there.

however, i see that we already have __va() in asm-generic/page.h.  so
you can assume __va() exists.  so just change the existing definition
to:
#define xlate_dev_mem_ptr(p)   __va(p)
-mike
--
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