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: <20080812215659.GA12911@elf.ucw.cz>
Date:	Tue, 12 Aug 2008 23:56:59 +0200
From:	Pavel Machek <pavel@...e.cz>
To:	Mark Langsdorf <mark.langsdorf@....com>, Greg KH <greg@...ah.com>
Cc:	joachim.deguara@....com, gregkh@....cz, tglx@...utronix.de,
	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/01][retry 1] x86: L3 cache index disable for 2.6.26

Hi!

> > I think there's one-value-per-file rule in sysfs...
> > 
> > I guess it is better to return -EOPNOTSUP (or something) instead of
> > english text explaining that...
> > 
> > No, really, what you created is impossible to parse -- /proc like
> > nightmare.
> 
> Okay, this is a simpler version that includes most of Ingo's
> clean-ups and style changes.  It only displays the two
> cache index values.  Is this acceptable?

Not sure, lets ask greg. And it probably should have few lines
in Documentation going with it, so we know new interface is added and
how it looks.

> +static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf)
> +{
> +        int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map));
> +        struct pci_dev *dev = get_k8_northbridge(node);
> +        ssize_t ret = 0;
> +        int i;
> +
> +        if (!this_leaf->can_disable) 
> +                return sprintf(buf, "-1");

This should return -ERRNO, right?

> +        for (i = 0; i < 2; i++) {
> +                unsigned int reg = 0;
> +
> +                pci_read_config_dword(dev, 0x1BC + i * 4, &reg);
> +
> +                ret += sprintf(buf, "%s %x\t", buf, reg);
> +        }
> +	ret += sprintf(buf,"%s\n", buf);

So you print "buf" few times? Why? And you use both \t and \n as deliminer...

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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