From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [kvm-unit-tests PATCH 01/14] x86: vm: allow multiple init for vm setup Date: Thu, 20 Oct 2016 19:01:07 +0800 Message-ID: <20161020110107.GL15168@pxdev.xzpeter.org> References: <1476448852-30062-1-git-send-email-peterx@redhat.com> <1476448852-30062-2-git-send-email-peterx@redhat.com> <20161020081707.6ewyxtkaxuoslz6u@kamzik.brq.redhat.com> <20161020082408.GI15168@pxdev.xzpeter.org> <20161020084137.csjiv3dq6uuikupy@kamzik.brq.redhat.com> <20161020085522.GK15168@pxdev.xzpeter.org> <20161020093906.fn2tzg2flr4n3wpa@kamzik.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, jan.kiszka@web.de, agordeev@redhat.com, rkrcmar@redhat.com, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906AbcJTLBM (ORCPT ); Thu, 20 Oct 2016 07:01:12 -0400 Content-Disposition: inline In-Reply-To: <20161020093906.fn2tzg2flr4n3wpa@kamzik.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 20, 2016 at 11:39:06AM +0200, Andrew Jones wrote: > On Thu, Oct 20, 2016 at 04:55:22PM +0800, Peter Xu wrote: > > On Thu, Oct 20, 2016 at 10:41:37AM +0200, Andrew Jones wrote: > > > > [...] > > > > > Let's do these patches separate from the series and maybe change setup_idt > > > too? It'd be interesting to see if the assert in setup_idt would fire, > > > i.e. if any users are relying on it being tolerant to multiple calls, and > > > then find out why. > > > > The problem should be: smp_init() is calling setup_idt(). So if we > > change the init stuff in setup_idt() into an assertion, any test > > program that calls both smp_init() and setup_idt() would possibly fail > > the assertion. Actually I see most test cases are using: > > > > setup_vm(); > > smp_init(); > > setup_idt(); > > > > to setup a basic environment, so I guess all of these use cases would > > fail. In that sense, I'd slightly prefer keep setup_idt() as it is. > > Well I guess the fix is just to remove the unnecessary setup_idt calls > from all unit tests that do smp_init(). Anyway, I won't fight too hard > for this cleanup, but I certainly prefer not to propagate the sloppiness > further into the other setups. It won't be hard to do that. Let me cook one for this. Thanks, -- peterx