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: <19893519-20a6-47cf-bb3b-c61dada627bc@sirena.org.uk>
Date: Mon, 17 Jun 2024 23:47:10 +0100
From: Mark Brown <broonie@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, Armin Wolf <W_Armin@....de>
Subject: Re: Page select register restrictions in regmap core

On Mon, Jun 17, 2024 at 02:55:09PM -0700, Guenter Roeck wrote:
> On 6/17/24 10:22, Mark Brown wrote:

> > The range is *entirely* defined within the driver, it is 100% a software
> > construct, the hardware only influences our choice of range in that we
> > can't place it on top of hardware registers.

> I _think_ what you are saying is that I'd have to model all registers
> which are to be addressed through regmap as virtual registers with an offset
> outside the range of real registers. Something like adding 0x100 to the

No, only registers that are accessed through a window need to be
mapped into a range.  Any other registers can just be accessed.

> each register address and then accessing, say, the revision register
> not as register 0x02 but as register 0x102. I would then define the matching
> range from 0x100 .. 0x17f and the window from 0x00..0x7f.

That would make the range exactly the same size as the window so there'd
be no paging going on and the registers could be accessed directly?  I
guess that's another check that should be added...

> Hmm, yes, I see that this should work. I don't think it is worth doing though
> since I need to be able to access some registers outside regmap, and I'd have
> to define two sets of addresses for all those registers. That would simplify
> the code a bit but one would have to remember that register addresses through
> regmap are different than register addresses when calling smbus functions
> directly. I think we'll just stick with the current code and keep the paging
> implementation in the driver.

Mixing regmap and non-regmap access to the same registers seems like a
bad idea in general, you will have locking issues (especially around the
paging).

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ