From patchwork Wed Mar 11 17:09:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bandan Das X-Patchwork-Id: 5987721 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61D87BF910 for ; Wed, 11 Mar 2015 17:10:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 918DF203B0 for ; Wed, 11 Mar 2015 17:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B928B2041F for ; Wed, 11 Mar 2015 17:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578AbbCKRJ4 (ORCPT ); Wed, 11 Mar 2015 13:09:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbbCKRJr (ORCPT ); Wed, 11 Mar 2015 13:09:47 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2BH9ihO009606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Mar 2015 13:09:44 -0400 Received: from aqua (unused [10.10.51.37] (may be forged)) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2BH9gsM021291 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 11 Mar 2015 13:09:43 -0400 From: Bandan Das To: "Kevin O'Connor" Cc: "Dr. David Alan Gilbert" , Paolo Bonzini , kraxel@redhat.com, Andrey Korolyov , "qemu-devel\@nongnu.org" , "kvm\@vger.kernel.org" Subject: Re: [Qemu-devel] E5-2620v2 - emulation stop error References: <20150310165755.GL2338@work-vm> <54FF337A.1010202@redhat.com> <54FF4541.9080608@redhat.com> <20150310202958.GR2338@work-vm> <20150311134556.GH2334@work-vm> <20150311154220.GA26463@morn.localdomain> Date: Wed, 11 Mar 2015 13:09:42 -0400 In-Reply-To: <20150311154220.GA26463@morn.localdomain> (Kevin O'Connor's message of "Wed, 11 Mar 2015 11:42:20 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "Kevin O'Connor" writes: ... > > Something is very odd here. When I run the above command (on an older > AMD machine) I get: > > Found 128 cpu(s) max supported 128 cpu(s) > > That first value (1 vs 128) comes from QEMU (via cmos index 0x5f). > That is, during smp init, SeaBIOS expects QEMU to tell it how many > cpus are active, and SeaBIOS waits until that many CPUs check in from > its SIPI request before proceeding. > > I wonder if QEMU reported only 1 active cpu via that cmos register, > but more were actually active. If that was the case, it could I was daring enough to try this and I don't see the crash :) So, the while loop results in a race somehow ? Bandan > certainly explain the failure - as multiple cpus could be running > without the sipi trapoline in place. > > What does the log look like on a non-failure case? > > -Kevin --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/fw/smp.c b/src/fw/smp.c index a466ea6..a346d46 100644 --- a/src/fw/smp.c +++ b/src/fw/smp.c @@ -49,6 +49,7 @@ int apic_id_is_present(u8 apic_id) void VISIBLE32FLAT handle_smp(void) { + dprintf(DEBUG_HDL_smp, "Calling handle_smp\n"); if (!CONFIG_QEMU) return; @@ -128,6 +129,8 @@ smp_setup(void) // Wait for other CPUs to process the SIPI. u8 cmos_smp_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; + while (cmos_smp_count == 1) + cmos_smp_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; while (cmos_smp_count != CountCPUs) asm volatile( // Release lock and allow other processors to use the stack.