From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Rostedt Subject: Re: [Patch] Fix for x86_64 boot failures due to badsegment setup for protected mode. Date: Fri, 10 Nov 2006 10:26:48 -0500 Message-ID: <45549A38.60906@redhat.com> References: <391BF3CDD2DC0848B40ACB72FA97AD596CE372@pdsmsx413.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <391BF3CDD2DC0848B40ACB72FA97AD596CE372@pdsmsx413.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" Cc: "Yu, Wilfred" , "Xin, Xiaohui" , xen-devel@lists.xensource.com, "Li, Susie" , "Li, Xin B" , Herbert Xu , Keir Fraser List-Id: xen-devel@lists.xenproject.org Jiang, Yunhong wrote: > This patch caused one problem. > > If the guest change the DS/SS etc between it set cr0.PE and the jump instruction. > Considering following code: > mov eax, cr0 > or eax, 0x11 > mov cr0, eax ---> here enable PE, and old_ctx.ds is cleard Isn't this where the vmxassist starts emulating? > mov ax, 0x0020 > mov ds, ax -> changes the DS here So we only need to emulate the above change. > jmp pword ptr [edi + 0x60] > mov ax, word ptr [bx + 0x00a8] > > The vmxassit clear the oldctx.ds_sel when guest enable PE, and when guest executed the mov ds, ax, the content on oldctx is not updated. Later when the last instruction, the ds is infact 0x0, not the 0x20 as guest hoped. > > This issue is in fact not caused entirely by this change, since we should emulate all instructions between the set cr0.PE and the jump instruction. But because the "mov ds, ax" is in fact executed by guest, not by vmxassist, it do cause problem for us. Are you sure about that? I thought vmxassist stated full software emulation as soon as PE was set. -- Steve