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: <DB9PR04MB8477CD99D5847291A629994180B09@DB9PR04MB8477.eurprd04.prod.outlook.com>
Date:   Mon, 20 Jun 2022 16:15:40 +0000
From:   Aisheng Dong <aisheng.dong@....com>
To:     Mark Brown <broonie@...nel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "dongas86@...il.com" <dongas86@...il.com>,
        "l.stach@...gutronix.de" <l.stach@...gutronix.de>,
        Peng Fan <peng.fan@....com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>
Subject: RE: [PATCH RFC 1/2] regmap: add option to disable debugfs

> From: Mark Brown <broonie@...nel.org>
> Sent: Monday, June 20, 2022 11:50 PM
> 
> On Mon, Jun 20, 2022 at 03:47:05PM +0000, Aisheng Dong wrote:
> 
> > > As indicated in the message you're linking to here if the device
> > > can't be accessed it should be being put in cache only mode which
> > > will ensure that nothing can do any physical accesses.
> 
> > I wonder that's not a stable solution assuming there're possible volatile
> registers.
> > Isn't that?
> 
> The driver is going to need to power the device back up to access the volatile
> registers so it can take the device out of cache only mode when it's doing that
> can't it?

Sorry, I didn't quite get it.
There's no problem in driver to access volatile registers as it usually will power up
device first by rpm.
But for debugfs, from what I saw in code, if there's a volatile register, _regmap_read()
will bypass cache and try to read the register value from HW.
Then system may hang as no one powered up the device before.
Anything I missed?

static int _regmap_read(struct regmap *map, unsigned int reg,
                        unsigned int *val)
{
        int ret;
        void *context = _regmap_map_get_context(map);

        if (!map->cache_bypass) {
                ret = regcache_read(map, reg, val);
                if (ret == 0)
                        return 0;
        }

        ret = map->reg_read(context, reg, val);
        ...
}

Or you mean simply forgetting about volatile registers and let debugfs
to read the stale value from cache?

Regards
Aisheng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ