From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH kvm-unit-tests 4/4] x86/taskswitch_vm86: Task switches into/out of VM86 Date: Tue, 24 Jan 2012 12:26:53 +0200 Message-ID: <20120124102653.GP9571@redhat.com> References: <1327334833-31650-1-git-send-email-kwolf@redhat.com> <1327334833-31650-5-git-send-email-kwolf@redhat.com> <20120123161017.GA12119@redhat.com> <4F1D88C6.2000208@redhat.com> <20120123162222.GB12119@redhat.com> <4F1D8BBB.1010907@redhat.com> <20120123164215.GC12119@redhat.com> <4F1E847F.7090908@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Kevin Wolf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45391 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753929Ab2AXK0z (ORCPT ); Tue, 24 Jan 2012 05:26:55 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0OAQsp6001657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 Jan 2012 05:26:54 -0500 Content-Disposition: inline In-Reply-To: <4F1E847F.7090908@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 24, 2012 at 11:14:23AM +0100, Kevin Wolf wrote: > Am 23.01.2012 17:42, schrieb Gleb Natapov: > > On Mon, Jan 23, 2012 at 05:32:59PM +0100, Kevin Wolf wrote: > >> Am 23.01.2012 17:22, schrieb Gleb Natapov: > >>> On Mon, Jan 23, 2012 at 05:20:22PM +0100, Kevin Wolf wrote: > >>>> Am 23.01.2012 17:10, schrieb Gleb Natapov: > >>>>> On Mon, Jan 23, 2012 at 05:07:13PM +0100, Kevin Wolf wrote: > >>>>>> This adds a test case that jumps into VM86 by iret-ing to a TSS and back > >>>>>> to Protected Mode using a task gate in the IDT. > >>>>>> > >>>>> Can you add the test case to taskswitch2.c? > >>>> > >>> Running one test to check all aspects of taskswitch emulation. > >> > >> (We all know that top-posting is disliked, but middle-posting looks even > >> crazier!) > >> > > Inserting replies > > Very true! > :) > > at random places is a new cool thing! > > > >> Does having one test provide any value in and of itself? It's just an > >> implementation detail of the test suite. When testing the KVM patches I > >> ran all three test cases with './run_tests.sh -g task', which is > >> hopefully easy enough. > >> > > I think it does. I do not have to use external script to combine tests > > on the same topic or even remember that such script exists. We do not > > create separate tests to test each instruction emulation either. And I > > usually run qemu not on the same machine I compile it on, so I need > > special tricks to make those test script work. Of course if putting this > > code into existing test file is hard separate test is OK, but is this > > really the case here? > > I haven't really checked whether they interfere. I guess I would have to > move the GDT indexes for my manually created TSSes and I would have to > hope that nobody else needs the memory I'm overwriting with the real > mode code (there doesn't seem to be memory management for < 1 MB). > You can add function alloc_vpage_low(). Other tests may find it useful. > Should taskswitch.c and taskswitch2.c be merged as well then? Or is > there a reason why they must stay separate? One file or three files > makes sense to me for three tests, but two not so much. > taskswitch.c should be removed. It tests nothing that taskswitch2.c does not check as far as I see. -- Gleb.