Received: from eggs.gnu.org ([2001:4830:134:3::10]:56562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnWhf-0000bE-Bm for qemu-devel@nongnu.org; Fri, 23 Sep 2016 16:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnWha-0006w3-Af for qemu-devel@nongnu.org; Fri, 23 Sep 2016 16:04:10 -0400 Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:34847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnWha-0006vj-6C for qemu-devel@nongnu.org; Fri, 23 Sep 2016 16:04:06 -0400 Received: by mail-io0-x241.google.com with SMTP id 92so2371344iom.2 for ; Fri, 23 Sep 2016 13:04:06 -0700 (PDT) Sender: Richard Henderson References: <1474659936-978-1-git-send-email-ehabkost@redhat.com> <1474659936-978-3-git-send-email-ehabkost@redhat.com> From: Richard Henderson Message-ID: <40f0fcc3-db94-fc63-afc3-e180df6b1ffb@twiddle.net> Date: Fri, 23 Sep 2016 13:04:03 -0700 MIME-Version: 1.0 In-Reply-To: <1474659936-978-3-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/7] target-i386: Don't try to enable PT State xsave component List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov On 09/23/2016 12:45 PM, Eduardo Habkost wrote: > The code that calculates the set of supported XSAVE components on > CPUID looks at ext_save_areas to find out which components should > be enabled. However, if there are zeroed entries in the > ext_save_areas array, the > ((env->features[esa->feature] & esa->bits) == esa->bits) > check will always succeed and QEMU will unconditionally try to > enable the component. > > Luckily this never caused any problems because the only missing > entry in ext_save_areas is the PT State component (bit 8), and > KVM currently doesn't support it (so it was cleared on ena_mask). > But the code was still incorrect and would break if KVM starts > returning CPUID[EAX=0xD,ECX=0].EAX[bit 8] as supported on > GET_SUPPORTED_CPUID. > > Fix the problem by changing the code to not enable a XSAVE > component if ExtSaveArea::bits is zero. > > Signed-off-by: Eduardo Habkost > --- > target-i386/cpu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~