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 16:55:22 +0800 Message-ID: <20161020085522.GK15168@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> 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]:33604 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935266AbcJTIz3 (ORCPT ); Thu, 20 Oct 2016 04:55:29 -0400 Content-Disposition: inline In-Reply-To: <20161020084137.csjiv3dq6uuikupy@kamzik.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Thanks, -- peterx