From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH 3/4] test: Add mode-switch test for nested svm Date: Mon, 2 Aug 2010 16:56:03 +0200 Message-ID: <20100802145603.GB18307@amd.com> References: <1280756016-11330-1-git-send-email-joerg.roedel@amd.com> <1280756016-11330-4-git-send-email-joerg.roedel@amd.com> <4C56CE5E.2080908@redhat.com> <20100802141146.GB25471@amd.com> <4C56D52B.2050804@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Marcelo Tosatti , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from va3ehsobe006.messaging.microsoft.com ([216.32.180.16]:37687 "EHLO VA3EHSOBE009.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581Ab0HBPwP (ORCPT ); Mon, 2 Aug 2010 11:52:15 -0400 Content-Disposition: inline In-Reply-To: <4C56D52B.2050804@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Aug 02, 2010 at 10:24:43AM -0400, Avi Kivity wrote: > On 08/02/2010 05:11 PM, Roedel, Joerg wrote: > > This is testing the failure case without the nested-svm efer patch I > > submitted last week. The sequence above (which switches from long mode > > to real mode and back to long mode) fails without this patch. > > A direct test would be to > > mov $MSR_EFER, %ecx > rdmsr > xor $EFER_NX, %eax > wrmsr > > and see that L1 EFER was updated. > > I don't object to the more complicated test, but in general prefer > simpler, direct tests so that when they fail we know exactly why. True, smaller tests are generally better. But I think its good to also test that the whole sequence works. I can add a seperate test for the efer bug if you want. It gets more tricky to test cr0 or cr4 writes because this will require to put the nested guest into real-mode or protected-mode directly. Joerg -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632