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: <20100125155234.a2e397a1.akpm@linux-foundation.org>
Date:	Mon, 25 Jan 2010 15:52:34 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mike Travis <travis@....com>
Cc:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Ingo Molnar <mingo@...e.hu>, Russ Anderson <rja@....com>,
	Dave Airlie <airlied@...hat.com>, Alex Chiang <achiang@...com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Robin Holt <holt@....com>, "Rafael J. Wysocki" <rjw@...k.pl>,
	Adam Jackson <ajax@...k.net>,
	Kenji Kaneshige <kaneshige.kenji@...fujitsu.com>,
	Gaetan Nadon <memsize@...eotron.ca>,
	"H. Peter Anvin" <hpa@...or.com>,
	Aaron Plattner <aplattner@...dia.com>,
	Jack Steiner <steiner@....com>,
	Tiago Vignatti <tiago.vignatti@...ia.com>,
	Cliff Wickman <cpw@....com>,
	Matthew Wilcox <willy@...ux.intel.com>,
	Christian Zander <chzander@...dia.com>,
	Yu Zhao <yu.zhao@...el.com>, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH 1/4] pci: Update pci_set_vga_state to call arch
 functions

On Mon, 18 Jan 2010 12:34:13 -0600
Mike Travis <travis@....com> wrote:

> Update pci_set_vga_state to call arch dependent functions to enable
> Legacy VGA I/O transactions to be redirected to correct target.
> 

Changelog doesn't explain the reason for doing this, but it looks like
that becomes clearer in later patches.

>  
> +/* Some architectures require additional programming to enable VGA */
> +static arch_set_vga_state_t arch_set_vga_state;
> +
> +void pci_register_set_vga_state(arch_set_vga_state_t func)
> +{
> +	arch_set_vga_state = func;	/* NULL disables */
> +}
> +
> +static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
> +		      unsigned int command_bits, bool change_bridge)
> +{
> +	if (arch_set_vga_state)
> +		return arch_set_vga_state(dev, decode, command_bits,
> +						change_bridge);
> +	return 0;
> +}

hm, that's not terribly elegant.  It's racy too, although it seems
unlikely that an arch will call pci_set_vga_state_arch() more than
once.

Still, a neater solution might be

int arch_pci_set_vga_state(...) __weak
{
	return 0;
}

and then resolve it at linkage time?


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