From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] When switching to a vm8086 task, load segments as 16-bit Date: Tue, 11 Aug 2009 19:56:57 +0300 Message-ID: <4A81A2D9.5080703@redhat.com> References: <1249952431-7764-1-git-send-email-aliguori@us.ibm.com> <4A819DD3.4060308@redhat.com> <4A81A034.7050603@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Gleb Natapov To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33224 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754357AbZHKQuw (ORCPT ); Tue, 11 Aug 2009 12:50:52 -0400 In-Reply-To: <4A81A034.7050603@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/11/2009 07:45 PM, Anthony Liguori wrote: > Avi Kivity wrote: >> On 08/11/2009 04:00 AM, Anthony Liguori wrote: >> >> kvm_load_segment_descriptor() can already load plain segments: >> >> if (!(vcpu->arch.cr0 & X86_CR0_PE)) >> return kvm_load_realmode_segment(vcpu, selector, seg); >> >> so we can simplify the patch a bit by extending the check. > > I went down that road but you need to check the to-be-switched-into > tss, which isn't available directly from vcpu so we would have to > either pass the tss as a parameter to the function or at least a flag > indicating that we're going into vm8086 mode. > eflags is already updated at this point, so no need for an additional parameter. > There are other callers of kvm_load_segment_descriptor that would need > updating and it already takes a few extra parameters. That's why I > went down this road. The other callers are a good reason to do it in kvm_load_segment_descriptor(), so they don't have to perform the check themselves. In fact with this change your patch will fix a few more bugs. -- error compiling committee.c: too many arguments to function