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:	Mon, 19 Dec 2011 18:03:42 -0500
From:	Dave Jones <davej@...hat.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, trenn@...e.de,
	kay.sievers@....org, Andi Kleen <ak@...ux.intel.com>,
	kay.sievers@...y.org
Subject: Re: [PATCH 08/10] cpufreq: Add support for x86 cpuinfo auto loading

On Mon, Dec 19, 2011 at 02:47:44PM -0800, Andi Kleen wrote:

 > diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c
 > index ffe1f2c..05d0f7f 100644
 > --- a/drivers/cpufreq/gx-suspmod.c
 > +++ b/drivers/cpufreq/gx-suspmod.c
 > @@ -82,6 +82,7 @@
 >  #include <linux/errno.h>
 >  #include <linux/slab.h>
 >  
 > +#include <asm/cpu_device_id.h>
 >  #include <asm/processor-cyrix.h>
 >  
 >  /* PCI config registers, all at F0 */
 > @@ -171,12 +172,20 @@ static struct pci_device_id gx_chipset_tbl[] __initdata = {
 >  	{ PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510), },
 >  	{ 0, },
 >  };
 > +/* MODULE_DEVICE_TABLE here too? But the CPU should be enough. */
 >  
 >  static void gx_write_byte(int reg, int value)
 >  {
 >  	pci_write_config_byte(gx_params->cs55x0, reg, value);
 >  }
 >  
 > +static const struct x86_cpu_id gx_ids[] = {
 > +	{ X86_VENDOR_NSC, },
 > +	{ X86_VENDOR_CYRIX },
 > +	{}
 > +};
 > +MODULE_DEVICE_TABLE(x86cpu, gx_ids);
 > +
 >  /**
 >   * gx_detect_chipset:
 >   *
 > @@ -185,12 +194,8 @@ static __init struct pci_dev *gx_detect_chipset(void)
 >  {
 >  	struct pci_dev *gx_pci = NULL;
 >  
 > -	/* check if CPU is a MediaGX or a Geode. */
 > -	if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
 > -	    (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
 > -		pr_debug("error: no MediaGX/Geode processor found!\n");
 > +	if (!x86_match_cpu(gx_ids))
 >  		return NULL;
 > -	}
 >  
 >  	/* detect which companion chip is used */
 >  	for_each_pci_dev(gx_pci) {

Looking closer at this one, I think we could possibly just autoload based on the PCI IDs
in gx_chipset_tbl, and remove the cpu vendor checking entirely.
Pretty sure those Cyrix PCI devices won't show up anywhere else.

Otherwise, we could narrow the range this gets loaded on to Cyrix Fam 4 model 5, and
NatSemi Fam 5, model 4.  (afaik, that covers all the possible cpus this driver works on)

	Dave

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