From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [kvm-unit-tests PATCH 02/14] x86: smp: allow multiple init for smp setup Date: Thu, 20 Oct 2016 09:27:40 +0800 Message-ID: <20161020012740.GD15168@pxdev.xzpeter.org> References: <1476448852-30062-1-git-send-email-peterx@redhat.com> <1476448852-30062-3-git-send-email-peterx@redhat.com> <20161019202354.GC8573@potion> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, jan.kiszka@web.de, agordeev@redhat.com, drjones@redhat.com, pbonzini@redhat.com To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932696AbcJTB1p (ORCPT ); Wed, 19 Oct 2016 21:27:45 -0400 Content-Disposition: inline In-Reply-To: <20161019202354.GC8573@potion> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 19, 2016 at 10:23:55PM +0200, Radim Krčmář wrote: > 2016-10-14 20:40+0800, Peter Xu: > > Signed-off-by: Peter Xu > > --- > > lib/x86/smp.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/lib/x86/smp.c b/lib/x86/smp.c > > index 1eb49f2..bb74087 100644 > > --- a/lib/x86/smp.c > > +++ b/lib/x86/smp.c > > @@ -111,8 +111,13 @@ void on_cpu_async(int cpu, void (*function)(void *data), void *data) > > void smp_init(void) > > { > > int i; > > + bool smp_inited = false; > > Missing "static". Oops. Will fix. > > The first two patches are just for sanity and not needed in the series? Yes actually these are not exactly related to vt-d, but good to have along the way, just like setup_idt() does. E.g., if one calls the new vtd_init() in future tests to init VT-d environment, he needs to make sure himself not to call the smp/vm init function twice (these things are required by VT-d and inited in vtd_init() already). These two patches will make sure it works in all cases. Thanks! -- peterx