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: <5551EFC1.2010704@linaro.org>
Date:	Tue, 12 May 2015 20:19:13 +0800
From:	Hanjun Guo <hanjun.guo@...aro.org>
To:	Jiang Liu <jiang.liu@...ux.intel.com>,
	"Rafael J . Wysocki" <rjw@...ysocki.net>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Marc Zyngier <marc.zyngier@....com>,
	Yijing Wang <wangyijing@...wei.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org
CC:	Lv Zheng <lv.zheng@...el.com>,
	"lenb @ kernel . org" <lenb@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>, linux-pci@...r.kernel.org,
	linux-acpi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC v2 6/7] x86/PCI/ACPI: Use common interface to support PCI
 host bridge

[...]
>   struct pci_root_info {
> -	struct acpi_device *bridge;
> -	char name[16];
> -	struct pci_controller sd;
> +	struct acpi_pci_root_info_common common;
>   #ifdef	CONFIG_PCI_MMCONFIG
>   	bool mcfg_added;
>   	u16 segment;
> @@ -165,14 +164,17 @@ static int check_segment(u16 seg, struct device *dev, char *estr)
>   	return 0;
>   }
>
> -static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start,
> -			  u8 end, phys_addr_t addr)
> +static int setup_mcfg_map(struct acpi_pci_root_info_common *ci)
>   {
>   	int result;
> -	struct device *dev = &info->bridge->dev;
> +	struct pci_root_info *info;
> +	struct acpi_pci_root *root = ci->root;
> +	struct device *dev = &ci->bridge->dev;
> +	int seg = ci->controller.segment;

...

>
> -	info->start_bus = start;
> -	info->end_bus = end;
> +	info = container_of(ci, struct pci_root_info, common);
> +	info->start_bus = (u8)root->secondary.start;
> +	info->end_bus = (u8)root->secondary.end;
>   	info->mcfg_added = false;

info->segment is not initialized here

>
>   	/* return success if MMCFG is not in use */
> @@ -182,7 +184,8 @@ static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start,
>   	if (!(pci_probe & PCI_PROBE_MMCONF))
>   		return check_segment(seg, dev, "MMCONFIG is disabled,");
>
> -	result = pci_mmconfig_insert(dev, seg, start, end, addr);
> +	result = pci_mmconfig_insert(dev, seg, info->start_bus, info->end_bus,
> +				     root->mcfg_addr);
>   	if (result == 0) {
>   		/* enable MMCFG if it hasn't been enabled yet */
>   		if (raw_pci_ext_ops == NULL)
> @@ -195,8 +198,11 @@ static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start,
>   	return 0;
>   }
>
> -static void teardown_mcfg_map(struct pci_root_info *info)
> +static void teardown_mcfg_map(struct acpi_pci_root_info_common *ci)
>   {
> +	struct pci_root_info *info;
> +
> +	info = container_of(ci, struct pci_root_info, common);
>   	if (info->mcfg_added) {
>   		pci_mmconfig_delete(info->segment, info->start_bus,

But the segment is used here to delete mmconfig entry, it seems that
the domain is 0 so there will be no problem, did I miss something?

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