From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH 7/8] x86/apic: Make cpu_mask_to_apicid() operations return error code
Date: Thu, 07 Jun 2012 15:24:05 -0700 [thread overview]
Message-ID: <1339107848.28766.104.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <20120607131559.GF4759@dhcp-26-207.brq.redhat.com>
On Thu, 2012-06-07 at 15:15 +0200, Alexander Gordeev wrote:
> Current cpu_mask_to_apicid() and cpu_mask_to_apicid_and()
> implementations have few shortcomings:
>
> 1. A value returned by cpu_mask_to_apicid() is written to hardware
> registers unconditionally. Should BAD_APICID get ever returned it will
> be written to a hardware too. But the value of BAD_APICID is not
> universal across all hardware in all modes and might cause unexpected
> results, i.e. interrupts might get routed to CPUs that are not
> configured to receive it.
>
> 2. Because the value of BAD_APICID is not universal it is counter-
> intuitive to return it for a hardware where it does not make sense
> (i.e. x2apic).
>
> 3. cpu_mask_to_apicid_and() operation is thought as an complement to
> cpu_mask_to_apicid() that only applies a AND mask on top of a cpumask
> being passed. Yet, as consequence of 18374d8 commit the two operations
> are inconsistent in that of:
> cpu_mask_to_apicid() should not get a offline CPU with the cpumask
> cpu_mask_to_apicid_and() should not fail and return BAD_APICID
> These limitations are impossible to realize just from looking at the
> operations prototypes.
>
> Most of these shortcomings are resolved by returning a error code
> instead of BAD_APICID. As the result, faults are reported back early
> rather than possibilities to cause a unexpected behaviour exist (in case
> of [1]).
>
> The only exception is setup_timer_IRQ0_pin() routine. Although obviously
> controversial to this fix, its existing behaviour is preserved to not
> break the fragile check_timer() and would better addressed in a separate
> fix.
>
I am ok with these changes. But even better would be to remove the
cpu_mask_to_apicid() and just use cpu_mask_to_apicid_and() instead.
Looks like there are only two places cpu_mask_to_apicid() being used
anyways. So instead of patches 7 and 8, can you remove
cpu_mask_to_apicid() in patch-7 and fixup the return value of
cpu_mask_to_apicid_and() in patch-8
thanks,
suresh
next prev parent reply other threads:[~2012-06-07 22:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 11:23 [PATCH 4/8] x86: apic: Factor out default vector_allocation_domain() operations Alexander Gordeev
2012-06-06 8:22 ` Ingo Molnar
2012-06-06 8:42 ` Alexander Gordeev
2012-06-07 13:14 ` [PATCH 4/8] x86/apic: Factor out default vector_allocation_domain() operation Alexander Gordeev
2012-06-07 22:24 ` Suresh Siddha
2012-06-08 14:49 ` [tip:x86/apic] " tip-bot for Alexander Gordeev
2012-06-07 13:15 ` [PATCH 5/8] x86/apic: Try to spread IRQ vectors to different priority levels Alexander Gordeev
2012-06-07 22:26 ` Suresh Siddha
2012-06-08 14:50 ` [tip:x86/apic] " tip-bot for Alexander Gordeev
2012-06-20 17:23 ` H. Peter Anvin
2012-06-20 21:41 ` Suresh Siddha
2012-06-20 21:46 ` H. Peter Anvin
2012-06-07 13:15 ` [PATCH 6/8] x86/apic: Avoid useless scanning thru a cpumask in assign_irq_vector() Alexander Gordeev
2012-06-07 22:28 ` Suresh Siddha
2012-06-08 14:51 ` [tip:x86/apic] " tip-bot for Alexander Gordeev
2012-06-07 13:15 ` [PATCH 7/8] x86/apic: Make cpu_mask_to_apicid() operations return error code Alexander Gordeev
2012-06-07 22:24 ` Suresh Siddha [this message]
2012-06-08 15:15 ` Alexander Gordeev
2012-06-08 16:53 ` [PATCH] x86/apic: Eliminate cpu_mask_to_apicid() operation Alexander Gordeev
2012-06-08 18:24 ` Suresh Siddha
2012-06-08 22:36 ` Yinghai Lu
2012-06-11 8:22 ` Ingo Molnar
2012-06-11 10:51 ` Alexander Gordeev
2012-06-08 14:51 ` [tip:x86/apic] x86/apic: Make cpu_mask_to_apicid() operations return error code tip-bot for Alexander Gordeev
2012-06-07 13:16 ` [PATCH 8/8] x86/apic: Make cpu_mask_to_apicid() operations check cpu_online_mask Alexander Gordeev
2012-06-08 14:52 ` [tip:x86/apic] " tip-bot for Alexander Gordeev
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=1339107848.28766.104.camel@sbsiddha-desk.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=agordeev@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
--cc=yinghai@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
all inboxes | Powered by JetHome®