From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH] KVM: SVM: Add xsetbv intercept Date: Mon, 6 Dec 2010 18:48:52 +0100 Message-ID: <20101206174852.GG4936@amd.com> References: <1291394523-7689-1-git-send-email-joerg.roedel@amd.com> <4CFD0B06.9010308@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Marcelo Tosatti , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <4CFD0B06.9010308@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Dec 06, 2010 at 11:10:46AM -0500, Avi Kivity wrote: > On 12/03/2010 06:42 PM, Joerg Roedel wrote: > > This patch implements the xsetbv intercept to the AMD part > > of KVM. This makes AVX usable in a save way for the guest on > > AVX capable AMD hardware. > > The patch is tested by using AVX in the guest and host in > > parallel and checking for data corruption. I also used the > > KVM xsave unit-tests and they all pass. > > > > That is really strange. You didn't need to do anything to get cpuid.avx > recognized. So running an older kvm on newer hardware will happily > expose avx even though it's not supported. > > We screwed up - we should have made cpuid.avx dependent on vendor support. Hmm, right. The set_supported_cpuid arch-callback should basically disable xsave on AMD for all KVM versions which do not handle the xsetbv intercept. 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