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-next>] [day] [month] [year] [list]
Message-ID: <20200925152118.2afb794b@canb.auug.org.au>
Date:   Fri, 25 Sep 2020 15:21:18 +1000
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
        "H. Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>
Cc:     Jon Derrick <jonathan.derrick@...el.com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: linux-next: manual merge of the tip tree with the pci tree

Hi all,

Today's linux-next merge of the tip tree got a conflict in:

  drivers/pci/controller/vmd.c

between commit:

  42443f036042 ("PCI: vmd: Create IRQ Domain configuration helper")

from the pci tree and commit:

  585dfe8abc44 ("PCI: vmd: Dont abuse vector irqomain as parent")

from the tip tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/pci/controller/vmd.c
index 3c4418cbde1c,aa1b12bac9a1..000000000000
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@@ -304,50 -298,6 +304,50 @@@ static struct msi_domain_info vmd_msi_d
  	.chip		= &vmd_msi_controller,
  };
  
 +static void vmd_enable_msi_remapping(struct vmd_dev *vmd, bool enable)
 +{
 +	u16 reg;
 +
 +	pci_read_config_word(vmd->dev, PCI_REG_VMCONFIG, &reg);
 +	reg = enable ? (reg & ~0x2) : (reg | 0x2);
 +	pci_write_config_word(vmd->dev, PCI_REG_VMCONFIG, reg);
 +}
 +
 +static int vmd_create_irq_domain(struct vmd_dev *vmd)
 +{
 +	struct fwnode_handle *fn;
 +
 +	fn = irq_domain_alloc_named_id_fwnode("VMD-MSI", vmd->sysdata.domain);
 +	if (!fn)
 +		return -ENODEV;
 +
 +	vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info,
- 						    x86_vector_domain);
++						    NULL);
 +	if (!vmd->irq_domain) {
 +		irq_domain_free_fwnode(fn);
 +		return -ENODEV;
 +	}
 +
 +	return 0;
 +}
 +
 +static void vmd_remove_irq_domain(struct vmd_dev *vmd)
 +{
 +	/*
 +	 * Some production BIOS won't enable remapping between soft reboots.
 +	 * Ensure remapping is restored before unloading the driver
 +	 */
 +	if (!vmd->msix_count)
 +		vmd_enable_msi_remapping(vmd, true);
 +
 +	if (vmd->irq_domain) {
 +		struct fwnode_handle *fn = vmd->irq_domain->fwnode;
 +
 +		irq_domain_remove(vmd->irq_domain);
 +		irq_domain_free_fwnode(fn);
 +	}
 +}
 +
  static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
  				  unsigned int devfn, int reg, int len)
  {
@@@ -717,12 -568,24 +717,18 @@@ static int vmd_enable_domain(struct vmd
  
  	sd->node = pcibus_to_node(vmd->dev->bus);
  
 -	fn = irq_domain_alloc_named_id_fwnode("VMD-MSI", vmd->sysdata.domain);
 -	if (!fn)
 -		return -ENODEV;
 -
 -	vmd->irq_domain = pci_msi_create_irq_domain(fn, &vmd_msi_domain_info,
 -						    NULL);
 -
 -	if (!vmd->irq_domain) {
 -		irq_domain_free_fwnode(fn);
 -		return -ENODEV;
 +	if (vmd->msix_count) {
 +		ret = vmd_create_irq_domain(vmd);
 +		if (ret)
 +			return ret;
  	}
  
+ 	/*
+ 	 * Override the irq domain bus token so the domain can be distinguished
+ 	 * from a regular PCI/MSI domain.
+ 	 */
+ 	irq_domain_update_bus_token(vmd->irq_domain, DOMAIN_BUS_VMD_MSI);
+ 
  	pci_add_resource(&resources, &vmd->resources[0]);
  	pci_add_resource_offset(&resources, &vmd->resources[1], offset[0]);
  	pci_add_resource_offset(&resources, &vmd->resources[2], offset[1]);

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ