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:	Sat, 26 Feb 2011 20:23:54 +0800
From:	"Guan Xuetao" <gxt@...c.pku.edu.cn>
To:	"'Arnd Bergmann'" <arnd@...db.de>
Cc:	<linux-kernel@...r.kernel.org>, <linux-arch@...r.kernel.org>,
	"'Greg KH'" <greg@...ah.com>
Subject: RE: [PATCH 09/12] unicore32 machine related files: hardware registers



> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@...db.de]
> Sent: Tuesday, February 22, 2011 10:19 PM
> To: Guan Xuetao
> Cc: linux-kernel@...r.kernel.org; linux-arch@...r.kernel.org; 'Greg KH'
> Subject: Re: [PATCH 09/12] unicore32 machine related files: hardware registers
> 
> On Tuesday 22 February 2011, Guan Xuetao wrote:
> > > > diff --git a/arch/unicore32/include/mach/hardware.h b/arch/unicore32/include/mach/hardware.h
> > > > index 3fb7236..ebce7de 100644
> > > > --- a/arch/unicore32/include/mach/hardware.h
> > > > +++ b/arch/unicore32/include/mach/hardware.h
> > > > @@ -17,19 +17,14 @@
> > > >
> > > >  #include "PKUnity.h"
> > > >
> > > > -#define io_p2v(x)  ((x) - PKUNITY_IOSPACE_BASE)
> > > > -#define io_v2p(x)  ((x) + PKUNITY_IOSPACE_BASE)
> > > > +#define io_p2v(x)  ((x) - PKUNITY_MMIO_BASE)
> > > > +#define io_v2p(x)  ((x) + PKUNITY_MMIO_BASE)
> > > >
> > I apply the patch as following:
> >
> > @@ -22,8 +22,7 @@
> >
> >  #ifndef __ASSEMBLY__
> >
> > -# define __REG(x)      (*((volatile unsigned long *)io_p2v(x)))
> > -# define __PREG(x)     (io_v2p((unsigned long)&(x)))
> > +# define __REG(x)      (void __iomem *)io_p2v(x)
> 
> The patch looks correct, but if you make the the definition for
> PKUNITY_MMIO_BASE contain the cast to (void __iomem *), you no
> longer need another cast.
Because the io_p2v(x) calculate x and PKUNITY_IOSPACE_BASE,
all registers should be added with (void __iomem *).
So I prefer to remain the previous patch.

> 
> > __REG reserved only for all registers prefix.
> > And all using for __REG converted to readl/writel.
> 
> Fair enough.
> 
> 	Arnd

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