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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100904111825.GA26654@merkur.ravnborg.org>
Date:	Sat, 4 Sep 2010 13:18:25 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Cc:	akpm@...ux-foundation.org, miklos@...redi.hu, jdike@...toit.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -mm] uml: disable CONFIG_HAS_DMA

On Sat, Sep 04, 2010 at 07:31:26PM +0900, FUJITA Tomonori wrote:
> On Sat, 4 Sep 2010 12:13:13 +0200
> Sam Ravnborg <sam@...nborg.org> wrote:
> 
> > On Sat, Sep 04, 2010 at 06:17:56PM +0900, FUJITA Tomonori wrote:
> > > I think that it's better to detect DMA misuse at build time rather
> > > than calling BUG_ON. Architectures that can't do DMA need to disable
> > > CONFIG_HAS_DMA.
> > > 
> > > Signed-off-by: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
> > > ---
> > >  arch/um/Kconfig.um                |    3 +
> > >  arch/um/defconfig                 |    1 -
> > >  arch/um/include/asm/dma-mapping.h |  112 -------------------------------------
> > >  3 files changed, 3 insertions(+), 113 deletions(-)
> > >  delete mode 100644 arch/um/include/asm/dma-mapping.h
> > > 
> > > diff --git a/arch/um/Kconfig.um b/arch/um/Kconfig.um
> > > index ec2b8da..3de40b8 100644
> > > --- a/arch/um/Kconfig.um
> > > +++ b/arch/um/Kconfig.um
> > > @@ -147,3 +147,6 @@ config KERNEL_STACK_ORDER
> > >  	  This option determines the size of UML kernel stacks.  They will
> > >  	  be 1 << order pages.  The default is OK unless you're running Valgrind
> > >  	  on UML, in which case, set this to 3.
> > > +
> > > +config HAS_DMA
> > > +       def_bool n
> > 
> > Other archs define NO_DMA to say they do not have DMA.
> > We should do it the same way for um.
> 
> Defining NO_DMA affects any code? In other words, we can kill NO_DMA
> definition?

NO_DMA affects HAS_DMA.

HAS_DMA is defined like this:

config HAS_DMA
        boolean
        depends on !NO_DMA
        default y

So to set HAS_DMA to true an arch should do:
1) Do not define NO_DMA
2) Define NO_DMA abd set it to 'n'

Must archs - including um - used principle 1).

In the um case we want to say that we do NOT have any DMA.
This can be done in two ways.
a) define NO_DMA and set it to 'y'
b) redefine HAS_DMA and set it to 'n'.

The patch you provided used principle b) where other archs use principle a).
So I suggest you should use principle a) for um too.

> Defining NO_DMA affects any code? 
As per above - yes it does. Because NO_DMA affects HAS_DMA and HAS_DMA affects code.

	Sam
--
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