From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM: VMX: do not overwrite uptodate vcpu->arch.cr3 on KVM_SET_SREGS Date: Sun, 12 Jun 2011 11:50:09 +0300 Message-ID: <4DF47DC1.8000402@redhat.com> References: <20110606172747.GA30900@amt.cnet> <4DEDE051.2090908@redhat.com> <20110609171123.GA5030@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14659 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674Ab1FLIuN (ORCPT ); Sun, 12 Jun 2011 04:50:13 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5C8oDJ2025226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 12 Jun 2011 04:50:13 -0400 In-Reply-To: <20110609171123.GA5030@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 06/09/2011 08:11 PM, Marcelo Tosatti wrote: > > > > Applied and queued, but I think there is something rotten here. How > > does arch.cr3 get into GUEST_CR3 after KVM_SET_SREGS? arch.cr3 is a > > supposed to be write-through cache - it only has a bit in > > regs_avail, not regs_dirty. > > > KVM_SET_SREGS sets good kvm->arch.cr3. Then vmx_decache_cr3 overwrites > kvm->arch.cr3 from GUEST_CR3, which is stale. > Right. Should have called kvm_set_cr3(). It's tricky since we need to set the order of writing various registers, I'll take a look. -- error compiling committee.c: too many arguments to function