From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: [kvm-unit-tests PATCH 2/3] x86: smp: assert to avoid multiple init of smp Date: Tue, 25 Oct 2016 17:00:29 +0800 Message-ID: <1477386030-13955-3-git-send-email-peterx@redhat.com> References: <1477386030-13955-1-git-send-email-peterx@redhat.com> Cc: pbonzini@redhat.com, drjones@redhat.com, rkrcmar@redhat.com, peterx@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51462 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754577AbcJYJAh (ORCPT ); Tue, 25 Oct 2016 05:00:37 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D8E18EB41 for ; Tue, 25 Oct 2016 09:00:37 +0000 (UTC) In-Reply-To: <1477386030-13955-1-git-send-email-peterx@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Peter Xu --- lib/x86/smp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/x86/smp.c b/lib/x86/smp.c index 1eb49f2..1a05d0f 100644 --- a/lib/x86/smp.c +++ b/lib/x86/smp.c @@ -113,6 +113,7 @@ void smp_init(void) int i; void ipi_entry(void); + assert(_cpu_count == 0); _cpu_count = fwcfg_get_nb_cpus(); setup_idt(); -- 2.7.4