From patchwork Mon Jun 22 07:11:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 31705 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5M7DOeF008726 for ; Mon, 22 Jun 2009 07:13:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbZFVHNT (ORCPT ); Mon, 22 Jun 2009 03:13:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751647AbZFVHNT (ORCPT ); Mon, 22 Jun 2009 03:13:19 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:7995 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbZFVHNS (ORCPT ); Mon, 22 Jun 2009 03:13:18 -0400 Received: by fg-out-1718.google.com with SMTP id d23so477707fga.17 for ; Mon, 22 Jun 2009 00:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=DJEZ0JrawmZMRVXyCzsQ8sCdzZASVAxB30JF9efUOw8=; b=Dtf0sM4xKqCWj/xiDo8hBfuu5gz2LBoZNH6lZzizhLkb9DhGi2PzMHkNBnEWIanJ8u wl+5VC8PTswRV7pz3q0vENX90aE9GUxvF+cA1Y3gH9RJKoOgO7a78XtoyQ6gmGvM9lpX wvzaL4tNMYKfua/r1Ye+gq29JqH+T89x5KciY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; b=sGJ31FU9FIjiIGa8P6a68LxkGgXqtkk6pVhyVdt21Ofi5AeG2fp/fRBj54rHJz25dA zdxrIXEngFRtLQQunSbJ2o23TlsnC1V0zuLJFIMjL0nkPcWF28+Thdc+fPRb0y407Rrw MEP702t3MujSnOOVIbuigtqL1Og8XbZb1DNU0= Received: by 10.86.98.10 with SMTP id v10mr6229138fgb.76.1245654799825; Mon, 22 Jun 2009 00:13:19 -0700 (PDT) Received: from eye3.emea.sgi.com (77-59-223-90.static.cablecom.ch [77.59.223.90]) by mx.google.com with ESMTPS id d6sm9322735fga.29.2009.06.22.00.13.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Jun 2009 00:13:18 -0700 (PDT) Message-ID: <4A3F2EAA.7010604@gmail.com> Date: Mon, 22 Jun 2009 09:11:38 +0200 From: Jes Sorensen User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Amit Shah CC: Avi Kivity , Gleb Natapov , "kvm@vger.kernel.org" Subject: Re: [patch] qemu-kvm introduce -maxcpus argument References: <4A3B99DD.50306@gmail.com> <20090619152441.GA1301@amit-x200.redhat.com> In-Reply-To: <20090619152441.GA1301@amit-x200.redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 06/19/2009 05:24 PM, Amit Shah wrote: > On (Fri) Jun 19 2009 [15:59:57], Jes Sorensen wrote: > ACK, but please fix this: > > +DEF("maxcpus", HAS_ARG, QEMU_OPTION_maxcpus, > + "-maxcpus n set maximumthe number of possibly CPUs to 'n'\n") > +STEXI Argh, thanks, dunno how I managed to create that. Here is an updated version. Cheers, Jes Build madt table based on max_cpus count. Signed-off-by: Jes Sorensen --- kvm/bios/rombios32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: qemu-kvm/kvm/bios/rombios32.c =================================================================== --- qemu-kvm.orig/kvm/bios/rombios32.c +++ qemu-kvm/kvm/bios/rombios32.c @@ -1168,13 +1168,13 @@ static void mptable_init(void) putstr(&q, "0.1 "); /* vendor id */ putle32(&q, 0); /* OEM table ptr */ putle16(&q, 0); /* OEM table size */ - putle16(&q, MAX_CPUS + 18); /* entry count */ + putle16(&q, max_cpus + 18); /* entry count */ putle32(&q, 0xfee00000); /* local APIC addr */ putle16(&q, 0); /* ext table length */ putb(&q, 0); /* ext table checksum */ putb(&q, 0); /* reserved */ - for(i = 0; i < MAX_CPUS ; i++) { + for(i = 0; i < max_cpus ; i++) { putb(&q, 0); /* entry type = processor */ putb(&q, i); /* APIC id */ putb(&q, 0x11); /* local APIC version number */ @@ -1700,7 +1700,7 @@ void acpi_bios_init(void) addr = (addr + 7) & ~7; madt_addr = addr; madt_size = sizeof(*madt) + - sizeof(struct madt_processor_apic) * MAX_CPUS + + sizeof(struct madt_processor_apic) * max_cpus + #ifdef BX_QEMU sizeof(struct madt_io_apic) + sizeof(struct madt_int_override) * MAX_INT_OVERRIDES; #else @@ -1778,7 +1778,7 @@ void acpi_bios_init(void) madt->local_apic_address = cpu_to_le32(0xfee00000); madt->flags = cpu_to_le32(1); *(uint32_t*)APIC_MADT_PTR = apic = (void *)(madt + 1); - for(i=0;itype = APIC_PROCESSOR; apic->length = sizeof(*apic); apic->processor_id = i;