From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Amit Subject: Re: [PATCH 08/21] KVM: x86: Reset FPU state during reset Date: Wed, 5 Nov 2014 22:31:09 +0200 Message-ID: References: <1414922101-17626-1-git-send-email-namit@cs.technion.ac.il> <1414922101-17626-9-git-send-email-namit@cs.technion.ac.il> <545A1264.5030002@redhat.com> <545A3A6C.3010302@redhat.com> Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nadav Amit , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail-wg0-f50.google.com ([74.125.82.50]:45786 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbaKEUbN convert rfc822-to-8bit (ORCPT ); Wed, 5 Nov 2014 15:31:13 -0500 Received: by mail-wg0-f50.google.com with SMTP id z12so1835813wgg.37 for ; Wed, 05 Nov 2014 12:31:12 -0800 (PST) In-Reply-To: <545A3A6C.3010302@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: > On Nov 5, 2014, at 16:55, Paolo Bonzini wrote: >=20 >=20 >=20 > On 05/11/2014 14:20, Nadav Amit wrote: >>>> Actually it shouldn't be after INIT. XCR0 is not mentioned explic= itly=20 >>>> in Table 9-1 of the SDM (IA-32 Processor States Following Power-up= ,=20 >>>> Reset, or INIT), but since MSR_IA32_XSS is not specified, I think = XCR0=20 >>>> should fall under "All other MSRs=94. >>=20 >> I should have given a reference, since Intel SDM is a wild place - s= ee section 2.6 =93EXTENDED CONTROL REGISTERS (INCLUDING XCR0)=94 : "Aft= er reset, all bits (except bit 0) in XCR0 are cleared to zero, XCR0[0] = is set to 1." >=20 > Yes, I found that, but INIT is not reset. :) Paolo, you kill me=85 You are correct, it does not appear clearly in the SDM, but that is wha= t real hardware does. If you look at bochs - http://code.metager.de/source/xref/bochs/bochs/c= pu/init.cc - you=92ll see they call "BX_CPU_THIS_PTR xcr0.set32(0x1);=94 regardless to whether it is hardwa= re or software reset (the latter happens on INIT). > Reset is typically handled by userspace in the case of KVM. > kvm_vcpu_reset is only called by KVM when you get an INIT interrupt, = in > kvm_accept_apic_events. I know. Yet, my testing environment relies on INIT=85 Nadav