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: <20111208144516.GE24062@one.firstfloor.org>
Date:	Thu, 8 Dec 2011 15:45:16 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Jean Delvare <khali@...ux-fr.org>
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	kay.sievers@...y.org, trenn@...e.de,
	Andi Kleen <ak@...ux.intel.com>, davej@...hat.com,
	axboe@...nel.dk, hpa@...or.com, herbert@...dor.apana.org.au,
	ying.huang@...el.com, lenb@...nel.org
Subject: Re: [PATCH 01/10] Add driver auto probing for x86 features

On Thu, Dec 08, 2011 at 10:35:40AM +0100, Jean Delvare wrote:
> > +/**
> > + * x86_match_cpu - match current CPU again an array of x86_cpu_ids
> 
> The code is actually matching the boot cpu, which isn't necessarily the
> current CPU. I think it would be better to let the caller pass a
> specific cpu as a parameter. At least the hwmon drivers would benefit
> from that. Then you can add an helper function x86_match_boot_cpu()
> calling x86_match_cpu() on &boot_cpu_data if you want.

I don't really see a point of this currently -- the udev/modprobe loading is 
global anyways.  If we really want to support asymmetric configs a lot 
more work all over the kernel is needed and this could be still
changed.
> 
> > + * @match: Pointer to array of x86_cpu_ids. Last entry terminated with
> > + *         X86_MODEL_END.
> 
> I see no such X86_MODEL_END, your loop below is instead treating entries
> with all fields set to 0 as the terminating entry (which seems
> reasonable.)

Hmm yes I ended up with {}. I'll fix the comment.

> > +#define X86_VENDOR_ANY 0xffff
> > +#define X86_FAMILY_ANY 0
> > +#define X86_MODEL_ANY  0
> 
> Are you sure family 0 or model 0 are never used, by any vendor? I

They could be, but we never match for them.

> wouldn't take the risk. What's wrong with 0xffff?

That would not allow abbreviating the entries: the C compiler
doesn't know how to fill in 0xffff automatically.

> 
> > +#define X86_FEATURE_ANY 0	/* Same as FPU, you can't test for that */
> 
> Might be better to set X86_FEATURE_ANY to either 10 (unused feature
> bit) or 0xffff then.

I don't think this is a problem in practice.

Thanks for the review.

-Andi
-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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