Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757309AbYHUULQ (ORCPT ); Thu, 21 Aug 2008 16:11:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752993AbYHUULA (ORCPT ); Thu, 21 Aug 2008 16:11:00 -0400 Received: from rn-out-0910.google.com ([64.233.170.184]:28019 "EHLO rn-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbYHUUK7 (ORCPT ); Thu, 21 Aug 2008 16:10:59 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=VH8OEf14twyfthzxgmfJpWWMcDXAjJLpeBXZfK1IEuFWaGgIfHVj8cCBGoQq6cUJJJ 42aHf+kXvnHFOlws5FxLoirU/SJiag0KCdgig+Dthfi+hSU20gJKiI26JaPh/wyB5AYL 8JNLwD0y9OqYkdXxXb0fFG5OU6OW9mktnJAZc= From: Yinghai Lu To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton Cc: linux-kernel@vger.kernel.org, Yinghai Lu , Alex Nixon Subject: [PATCH] x86: fix probe_nr_irqs for xen Date: Thu, 21 Aug 2008 13:10:09 -0700 Message-Id: <1219349409-15698-1-git-send-email-yhlu.kernel@gmail.com> X-Mailer: git-send-email 1.5.4.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1146 Lines: 44 otherwise Xen is _completely_ unusable with 5 or more VCPUs. ( when !CONFIG_HAVE_SPARSE_IRQ) based on Alex's patch also add +1 offset after redir_entries Signed-off-by: Yinghai Lu Cc: Alex Nixon Index: linux-2.6/arch/x86/kernel/io_apic.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/io_apic.c +++ linux-2.6/arch/x86/kernel/io_apic.c @@ -3625,16 +3625,21 @@ int __init probe_nr_irqs(void) { int idx; int nr = 0; +#ifndef CONFIG_XEN + int nr_min = 32; +#else + int nr_min = NR_IRQS; +#endif for (idx = 0; idx < nr_ioapics; idx++) - nr += io_apic_get_redir_entries(idx); + nr += io_apic_get_redir_entries(idx) + 1; /* double it for hotplug and msi and nmi */ nr <<= 1; /* something wrong ? */ - if (nr < 32) - nr = 32; + if (nr < nr_min) + nr = nr_min; return nr; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/