public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Pan, Jacob jun" <jacob.jun.pan@intel.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [PATCH 8/9] x86/apic: match destination id with destination mode
Date: Fri, 26 Jun 2009 09:17:25 +0200	[thread overview]
Message-ID: <20090626071725.GE14078@elte.hu> (raw)
In-Reply-To: <43F901BD926A4E43B106BF17856F07556412B7E7@orsmsx508.amr.corp.intel.com>


* Pan, Jacob jun <jacob.jun.pan@intel.com> wrote:

> >From 791a44040dde6670f90a729cf91ed302d84b875a Mon Sep 17 00:00:00 2001
> From: Jacob Pan <jacob.jun.pan@intel.com>
> Date: Tue, 12 May 2009 10:51:08 -0700
> Subject: [PATCH] x86/apic: match destination id with destination mode
> 
> current code assigns logical destination IDs regardless of destination modes, this is not a problem since we only use logical delivery so far. but it could be a problem with platforms only supports physical mode

Please fix your commit msg line-warps to be at 70 cols or so.

> 
> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
> ---
>  arch/x86/kernel/apic/io_apic.c |   27 +++++++++++++++++++--------
>  1 files changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
> index 4d0216f..c84dc3d 100644
> --- a/arch/x86/kernel/apic/io_apic.c
> +++ b/arch/x86/kernel/apic/io_apic.c
> @@ -1431,7 +1431,10 @@ int setup_ioapic_entry(int apic_id, int irq,
>  	} else {
>  		entry->delivery_mode = apic->irq_delivery_mode;
>  		entry->dest_mode = apic->irq_dest_mode;
> -		entry->dest = destination;
> +		if (apic->irq_dest_mode)
> +			entry->dest = destination;
> +		else	/* physical ID of BSP */
> +			entry->dest = boot_cpu_id;
>  		entry->vector = vector;
>  	}
>  
> @@ -1576,7 +1579,10 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
>  	 */
>  	entry.dest_mode = apic->irq_dest_mode;
>  	entry.mask = 0;			/* don't mask IRQ for edge */
> -	entry.dest = apic->cpu_mask_to_apicid(apic->target_cpus());
> +	if (!apic->irq_dest_mode)
> +		entry.dest = boot_cpu_id;	/* physical apic id */
> +	else
> +		entry.dest = apic->cpu_mask_to_apicid(apic->target_cpus());
>  	entry.delivery_mode = apic->irq_delivery_mode;
>  	entry.polarity = 0;
>  	entry.trigger = 0;
> @@ -2343,7 +2349,8 @@ set_ioapic_affinity_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
>  	dest = set_desc_affinity(desc, mask);
>  	if (dest != BAD_APICID) {
>  		/* Only the high 8 bits are valid. */
> -		dest = SET_APIC_LOGICAL_ID(dest);
> +		if (apic->irq_dest_mode)
> +			dest = SET_APIC_LOGICAL_ID(dest);
>  		__target_IO_APIC_irq(irq, dest, cfg);
>  		ret = 0;
>  	}
> @@ -3273,9 +3280,11 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
>  	err = assign_irq_vector(irq, cfg, apic->target_cpus());
>  	if (err)
>  		return err;
> -
> -	dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
> -
> +	if (apic->irq_dest_mode)
> +		dest = apic->cpu_mask_to_apicid_and(cfg->domain,
> +						apic->target_cpus());
> +	else
> +		dest = boot_cpu_id;
>  	if (irq_remapped(irq)) {
>  		struct irte irte;
>  		int ir_index;
> @@ -3339,8 +3348,10 @@ static int set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
>  	struct irq_cfg *cfg;
>  	struct msi_msg msg;
>  	unsigned int dest;
> -
> -	dest = set_desc_affinity(desc, mask);
> +	if (apic->irq_dest_mode)
> +		dest = set_desc_affinity(desc, mask);
> +	else
> +		dest = boot_cpu_id;
>  	if (dest == BAD_APICID)
>  		return -1;

The question here is whether this should layer on top of Jeremy's 
IO-APIC driverization patches. I think it should.

	Ingo

  reply	other threads:[~2009-06-26  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26  0:15 [PATCH 8/9] x86/apic: match destination id with destination mode Pan, Jacob jun
2009-06-26  7:17 ` Ingo Molnar [this message]
2009-06-26 19:54   ` Eric W. Biederman
2009-06-26 20:59     ` Pan, Jacob jun
2009-06-26 21:47       ` Eric W. Biederman
2009-06-27 17:01     ` Ingo Molnar
2009-06-26 19:45 ` Eric W. Biederman
2009-06-26 21:21 ` Yinghai Lu
2009-06-26 21:41   ` Pan, Jacob jun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090626071725.GE14078@elte.hu \
    --to=mingo@elte.hu \
    --cc=hpa@linux.intel.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox