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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0908191652040.3361@localhost.localdomain>
Date:	Wed, 19 Aug 2009 16:56:26 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	"Pan, Jacob jun" <jacob.jun.pan@...el.com>
cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v2 4/10] x86: make use of platform feature flags during
 setup

Jacob,

On Thu, 16 Jul 2009, Pan, Jacob jun wrote:

> diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
> index 7bf325a..c0839f7 100644
> --- a/arch/x86/include/asm/setup.h
> +++ b/arch/x86/include/asm/setup.h
> @@ -32,6 +32,7 @@ struct x86_quirks {
>  				unsigned short oemsize);
>  	int (*setup_ioapic_ids)(void);
>  	void (*setup_secondary_clock)(void);
> +	void (*reserve_ebda_region)(void);
>  };

Nice you used the field in the previous patch already

> -	reserve_ebda_region();
> +	platform_feature_init_default();
> +
> +	if (x86_quirks->reserve_ebda_region)
> +		reserve_ebda_region();

Eek. What's the quirks function pointer for ?
 
>  static struct resource system_rom_resource = {
>  	.name	= "System ROM",
> @@ -99,6 +100,8 @@ void __init probe_roms(void)
>  	unsigned char c;
>  	int i;
>  
> +	if (!platform_has(X86_PLATFORM_FEATURE_BIOS))
> +		return;

That should be done with a function pointer which is initialized in
the platform code.

>  
>  #ifdef CONFIG_X86_32
> -	request_resource(&iomem_resource, &video_ram_resource);
> +	if (platform_has(X86_PLATFORM_FEATURE_BIOS))
> +		request_resource(&iomem_resource, &video_ram_resource);
>  #endif
> -	reserve_standard_io_resources();
> +	if (platform_has(X86_PLATFORM_FEATURE_ISA))
> +		reserve_standard_io_resources();

Ditto. And the function pointer could eliminate the X86_32 ifdef as well.
 
> @@ -1190,6 +1195,24 @@ static int pirq_enable_irq(struct pci_dev *dev)
>  	u8 pin;
>  
>  	pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
> +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SFI)
> +	/* For platforms only have IOAPIC, the PCI irq line is 1:1 mapped to
> +	 * IOAPIC RTE entries, so we just enable RTE for the device.
> +	 */
> +	if (platform_has(X86_PLATFORM_FEATURE_IOAPIC) &&
> +		!platform_has(X86_PLATFORM_FEATURE_8259) &&
> +		!platform_has(X86_PLATFORM_FEATURE_ACPI) &&
> +		!platform_has(X86_PLATFORM_FEATURE_BIOS) &&

You are not serious about that #ifdef and featuritis mess ?

Thanks,

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