From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: VMX: fix vmwrite to invalid VMCS Date: Fri, 3 Jul 2015 17:12:57 +0200 Message-ID: <5596A679.1050202@redhat.com> References: <1435931368-27730-1-git-send-email-rkrcmar@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, stable@vger.kernel.org, Yang Zhang , Liang Li To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1435931368-27730-1-git-send-email-rkrcmar@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/07/2015 15:49, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > fpu_activate is called outside of vcpu_load(), which means it should = not > touch VMCS, but fpu_activate needs to. Avoid the call by moving it t= o a > point where we know that the guest needs eager FPU and VMCS is loaded= =2E >=20 > This will get rid of the following trace >=20 > vmwrite error: reg 6800 value 0 (err 1) > [] dump_stack+0x19/0x1b > [] vmwrite_error+0x2c/0x2e [kvm_intel] > [] vmcs_writel+0x1f/0x30 [kvm_intel] > [] vmx_fpu_activate.part.61+0x45/0xb0 [kvm_intel] > [] vmx_fpu_activate+0x15/0x20 [kvm_intel] > [] kvm_arch_vcpu_create+0x51/0x70 [kvm] > [] kvm_vm_ioctl+0x1c1/0x760 [kvm] > [] ? handle_mm_fault+0x49a/0xec0 > [] do_vfs_ioctl+0x2e5/0x4c0 > [] ? file_has_perm+0xae/0xc0 > [] SyS_ioctl+0xa1/0xc0 > [] system_call_fastpath+0x16/0x1b >=20 > (Note: we also unconditionally activate FPU in vmx_vcpu_reset(), so t= he > removed code added nothing.) >=20 > Fixes: c447e76b4cab ("kvm/fpu: Enable eager restore kvm FPU for MPX") > Cc: > Reported-by: Vlastimil Holer > Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Andrey reported offlist that the bug went away by reverting 1cde293. S= o the patch would at least need a new commit message. :) I'm putting it on hold. Paolo