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]
Date:	Sat, 30 Sep 2006 10:43:20 +0200
From:	Segher Boessenkool <segher@...nel.crashing.org>
To:	Michael Ellerman <michael@...erman.id.au>
Cc:	<linux-kernel@...r.kernel.org>, linuxppc-dev@...abs.org,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH] Preliminary MPIC MSI backend

> A pretty hackish MPIC backend, just enough to flesh out the design.
> Based on code from Segher.

It's pretty alright, and very hackish ;-)  I'll sign off on it,
but some comments...

Signed-off-by: Segher Boessenkool <segher@...nel.crashing.org>
> Signed-off-by: Michael Ellerman <michael@...erman.id.au>

> +static int msi_mpic_check(struct pci_dev *pdev, int num,
> +			struct msix_entry *entries, int type)
> +{
> +	/* The irq allocator needs more work to support MSI-X/multi-MSI */
> +	if (type == PCI_CAP_ID_MSIX || num != 1)
> +		return 1;

I never tested any MSI-X, so maybe keep MSI-X disabled completely
for now?

> +static int msi_mpic_alloc(struct pci_dev *pdev, int num,
> +			struct msix_entry *entries, int type)
> +{
> +	irq_hw_number_t hwirq;
> +	unsigned int virq;
> +
> +	/* We need a smarter allocator for MSI-X/multi-MSI */
> +	hwirq = irq_map[pdev->irq].hwirq;
> +	hwirq += 100;

Yep, that's the main problem with this code.  A sanity check to
make sure the number isn't >= 120 would be good, too.

> +	set_irq_type(virq, IRQ_TYPE_EDGE_RISING);

I also had some code to show MSI IRQs as "MSI" instead of "EDGE"
in /proc/interrupts, maybe you want to add a generic version of
that?  Or maybe you have, and I judt didn't see it.

> +static int msi_mpic_setup_msi_msg(struct pci_dev *pdev,
> +		struct msix_entry *entry, struct msi_msg *msg, int type)
> +{
> +	msg->address_lo = 0xfee00000;	/* XXX What is this value? */
> +	msg->address_hi = 0;
> +	msg->data = pdev->irq | 0x8000;

Lose the | 0x8000 part, that was an old experiment to work around
U3/U4 MPIC brokenness (and it didn't work).

> +static int msi_mpic_init(void)
> +{
> +	/* XXX Do this in mpic_init ? */
> +	pr_debug("mpic_msi_init: Registering MPIC MSI ops.\n");
> +	ppc_md.get_msi_ops = mpic_get_msi_ops;

It's best to do this in the platform code I think.


Segher

-
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