Received: from eggs.gnu.org ([2001:4830:134:3::10]:45386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkyJ5-00049X-7T for qemu-devel@nongnu.org; Wed, 22 Apr 2015 13:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkyJ1-0002pX-UK for qemu-devel@nongnu.org; Wed, 22 Apr 2015 13:19:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43594 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkyJ1-0002pQ-NY for qemu-devel@nongnu.org; Wed, 22 Apr 2015 13:19:23 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) From: Alexander Graf In-Reply-To: <20150422155323.GD3466@thinpad.lan.raisama.net> Date: Wed, 22 Apr 2015 19:19:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3B347523-128F-4FBE-8F03-4AF5AC974234@suse.de> References: <1429655891-198219-1-git-send-email-agraf@suse.de> <1429655891-198219-2-git-send-email-agraf@suse.de> <20150422155323.GD3466@thinpad.lan.raisama.net> Subject: Re: [Qemu-devel] [PATCH 2/2] x86: Fix Opteron xlevels List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: "pbonzini@redhat.com" , "qemu-devel@nongnu.org" , "Bernhard M. Wiedemann" , "afaerber@suse.de" > Am 22.04.2015 um 17:53 schrieb Eduardo Habkost : >=20 >> On Wed, Apr 22, 2015 at 12:38:11AM +0200, Alexander Graf wrote: >> The AMD Opteron family has different xlevel levels depending on the >> generation. I looked up Gen1, Gen2 and Gen3 hardware and adapted the >> levels according to real silicon. >>=20 >> The reason this came up is that there is a sanity check in KVM making >> sure that SVM is only used when xlevel is high enough. Using real >> hardware levels, they now are. >=20 > As noted in the reply to the previous patch: if you increase xlevel you ar= e now > reporting new CPUID leaves as available. I still don't see any reason to s= tart > reporting new CPUID leaves as available if they are returning useless data= > (that doesn't match real hardware). >=20 > For reference, here are the new CPUID leaves you are introducing (and will= > return all-zeroes): >=20 > For Opteron_G[123]: > * CPUID Fn8000_0009 Reserved > * CPUID Fn8000_000A SVM Revision and Feature Identification (supported by Q= EMU) > * CPUID Fn8000_00[18:0B] Reserved >=20 > For Opteron_G3: > * CPUID Fn8000_0019_EAX TLB 1GB Page Identifiers > * CPUID Fn8000_0019_EBX TLB 1GB Page Identifiers > * CPUID Fn8000_0019_E[D,C]X Reserved > * CPUID Fn8000_001A_EAX Performance Optimization Identifiers > * CPUID Fn8000_001A_E[D,C,B]X Reserved >=20 > The reserved bits look safe, but we can't be 100% sure unless we confirm t= hat > real hardware is returning zeroes on all the reserved bits. If real hardwa= re > return some data, we don't know what exactly that data means (and what > all-zeroes would mean) until AMD documents it. >=20 > For L1 and L2 1GB page TLB info, all-zeroes means "TLB disabled". >=20 > The Performance Optimization Identifier leaf will now be available, and wi= ll > return 0 on the following bits: >=20 > * "MOVU: MOVU SSE (multimedia) instructions are more efficient and should b= e > preferred to SSE (multimedia) MOVL/MOVH. MOVUPS is more efficient than > MOVLPS/MOVHPS. MOVUPD is more efficient than MOVLPD/MOVHP"; > * "FP128: 128-bit SSE (multimedia) instructions are executed with full-wid= th > internal operations and pipelines rather than decomposing them into inter= nal > 64-bit suboperations. This may impact how soft- ware performs instruction= > selection and scheduling." >=20 > There's a simple way to avoid exposing additional useless information to > guests: just return 0x8000000A on xlevel. 0x8000000A is the CPUID leaf you= need > for SVM, the others are unrelated to SVM. I don't think creating a more Frankenstein cpu definition is superior over u= nset bits in the new leafs. How about I add support for the new leafs and fi= ll the bits with the same information as real hardware? Alex