xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: xen-devel@lists.xen.org
Cc: JBeulich@suse.com
Subject: Fix off-by-one comparison when using apic_flat mode
Date: Thu, 22 Mar 2012 10:20:28 +0100	[thread overview]
Message-ID: <1332408028-3727-1-git-send-email-drjones@redhat.com> (raw)

This patch fixes an off-by-one error in the genapic code so that apic_flat
is only used when the maximum APIC ID is less than 8, not also 8 (9 IDs).

Without this patch the kernel may hang when it attempts to process interrupts,
if there are exactly 9 cpus assigned.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 arch/x86_64/kernel/genapic-xen.c |  2 +-
 arch/x86_64/kernel/genapic.c     |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/genapic-xen.c b/arch/x86_64/kernel/genapic-xen.c
--- a/arch/x86_64/kernel/genapic-xen.c
+++ b/arch/x86_64/kernel/genapic-xen.c
@@ -85,7 +85,7 @@
 		   we have ACPI platform support for CPU hotplug
 		   we should detect hotplug capablity from ACPI tables and
 		   only do this when really needed. -AK */
-		if (max_apic <= 8)
+		if (max_apic < 8)
 			genapic = &apic_flat;
 #endif
  		goto print;
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86_64/kernel/genapic.c
@@ -79,7 +79,7 @@
 		   we have ACPI platform support for CPU hotplug
 		   we should detect hotplug capablity from ACPI tables and
 		   only do this when really needed. -AK */
-		if (max_apic <= 8)
+		if (max_apic < 8)
 			genapic = &apic_flat;
 #endif
  		goto print;

             reply	other threads:[~2012-03-22  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22  9:20 Andrew Jones [this message]
2012-03-22 10:52 ` Fix off-by-one comparison when using apic_flat mode Jan Beulich
2012-03-22 11:01   ` Andrew Jones

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=1332408028-3727-1-git-send-email-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).