* RE: [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode.
@ 2006-11-10 17:04 Jiang, Yunhong
2006-11-10 17:25 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Jiang, Yunhong @ 2006-11-10 17:04 UTC (permalink / raw)
To: Stephen C. Tweedie
Cc: Yu, Wilfred, Xin, Xiaohui, xen-devel, Herbert Xu, Li, Susie,
Steven Rostedt, Li, Xin B, Keir Fraser
This cause problem for some version's SMP windows, at least 2003 64-bit smp windows AP bringup code has such issue.
I'm not sure how much decoder left if we want to do full emulation. But at least we need to add the "mov reg->sreg" as Keir pointed out.
It's very later on my side, so Stephen, would you please add this?
Thanks
Yunhong Jiang
-----Original Message-----
From: Stephen C. Tweedie [mailto:sct@redhat.com]
Sent: 2006年11月11日 0:09
To: Jiang, Yunhong
Cc: Keir Fraser; Yu, Wilfred; Xin, Xiaohui; xen-devel@lists.xensource.com; Herbert Xu; Li, Susie; Steven Rostedt; Li, Xin B; Stephen Tweedie
Subject: RE: [Xen-devel] [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode.
Hi,
On Fri, 2006-11-10 at 22:39 +0800, 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.
Hmm... Do you know how much of a problem that causes in practice?
Which guests have that behaviour?
> Considering following code:
> mov eax, cr0
> or eax, 0x11
> mov cr0, eax ---> here enable PE, and old_ctx.ds is cleard
> mov ax, 0x0020
> mov ds, ax -> changes the DS here
Well, we've got commit log comments for the "pop %es" case:
2) In
current vmxassist, when entering VM86_PROTECTED_TO_REAL, we need to
decode every instruction manually until we catch instructions like
jmpl to reset cs to really return to real mode.
So I'm afraid I just assumed that we wouldn't need to deal with ds in
real life, since we haven't added emulation for that so far. Is that
emulation we need to add as a matter of some urgency, then?
--Stephen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode.
2006-11-10 17:04 [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode Jiang, Yunhong
@ 2006-11-10 17:25 ` Keir Fraser
2006-11-10 22:32 ` Steven Rostedt
0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2006-11-10 17:25 UTC (permalink / raw)
To: Jiang, Yunhong, Stephen C. Tweedie
Cc: Yu, Wilfred, Xin, Xiaohui, xen-devel, Herbert Xu, Li, Susie,
Steven Rostedt, Li, Xin B, Keir Fraser
I have a patch I'll check in. It'd be good get some testing of it.
Changeset is 12365:ca75b51d69c7
-- Keir
On 10/11/06 17:04, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
> This cause problem for some version's SMP windows, at least 2003 64-bit smp
> windows AP bringup code has such issue.
> I'm not sure how much decoder left if we want to do full emulation. But at
> least we need to add the "mov reg->sreg" as Keir pointed out.
> It's very later on my side, so Stephen, would you please add this?
>
> Thanks
> Yunhong Jiang
> -----Original Message-----
> From: Stephen C. Tweedie [mailto:sct@redhat.com]
> Sent: 2006年11月11日 0:09
> To: Jiang, Yunhong
> Cc: Keir Fraser; Yu, Wilfred; Xin, Xiaohui; xen-devel@lists.xensource.com;
> Herbert Xu; Li, Susie; Steven Rostedt; Li, Xin B; Stephen Tweedie
> Subject: RE: [Xen-devel] [Patch] Fix for x86_64 boot failures due tobadsegment
> setup for protected mode.
>
> Hi,
>
> On Fri, 2006-11-10 at 22:39 +0800, 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.
>
> Hmm... Do you know how much of a problem that causes in practice?
> Which guests have that behaviour?
>
>> Considering following code:
>> mov eax, cr0
>> or eax, 0x11
>> mov cr0, eax ---> here enable PE, and old_ctx.ds is cleard
>> mov ax, 0x0020
>> mov ds, ax -> changes the DS here
>
> Well, we've got commit log comments for the "pop %es" case:
>
> 2) In
> current vmxassist, when entering VM86_PROTECTED_TO_REAL, we need to
> decode every instruction manually until we catch instructions like
> jmpl to reset cs to really return to real mode.
>
> So I'm afraid I just assumed that we wouldn't need to deal with ds in
> real life, since we haven't added emulation for that so far. Is that
> emulation we need to add as a matter of some urgency, then?
>
> --Stephen
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode.
2006-11-10 17:25 ` Keir Fraser
@ 2006-11-10 22:32 ` Steven Rostedt
2006-11-11 0:09 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2006-11-10 22:32 UTC (permalink / raw)
To: Keir Fraser
Cc: Yu, Wilfred, Xin, Xiaohui, xen-devel, Li, Susie, Jiang, Yunhong,
Li, Xin B, Herbert Xu
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
Keir Fraser wrote:
> I have a patch I'll check in. It'd be good get some testing of it.
>
> Changeset is 12365:ca75b51d69c7
>
> -- Keir
>
Keir,
I was playing with Plan9 which happens to also tinker with ss, fs, and
gs in this critical section. It still crashes pretty early, but it
crashes earlier without this patch. This patch lets Plan9 crash at the
same location before the original patch Stephen Tweedie sent :}.
This patch makes the mov_to_seg more complete. I left out cs, since I
don't think that would even make sense with a mov.
-- Steve
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
[-- Attachment #2: xen-vmxassist-more-segs.patch --]
[-- Type: text/x-patch, Size: 1075 bytes --]
diff -r ca75b51d69c7 tools/firmware/vmxassist/vm86.c
--- a/tools/firmware/vmxassist/vm86.c Fri Nov 10 17:21:54 2006 +0000
+++ b/tools/firmware/vmxassist/vm86.c Fri Nov 10 17:28:02 2006 -0500
@@ -829,15 +829,33 @@ mov_to_seg(struct regs *regs, unsigned p
goto fail;
switch ((modrm & 0x38) >> 3) {
+ case 0: /* es */
+ regs->ves = getreg16(regs, modrm);
+ saved_rm_regs.ves = 0;
+ oldctx.es_sel = regs->ves;
+ return 1;
+
+ /* case 1: cs */
+
+ case 2: /* ss */
+ regs->uss = getreg16(regs, modrm);
+ saved_rm_regs.uss = 0;
+ oldctx.ss_sel = regs->uss;
+ return 1;
case 3: /* ds */
regs->vds = getreg16(regs, modrm);
saved_rm_regs.vds = 0;
oldctx.ds_sel = regs->vds;
return 1;
- case 0: /* es */
- regs->ves = getreg16(regs, modrm);
- saved_rm_regs.ves = 0;
- oldctx.es_sel = regs->ves;
+ case 4: /* fs */
+ regs->vfs = getreg16(regs, modrm);
+ saved_rm_regs.vfs = 0;
+ oldctx.fs_sel = regs->vfs;
+ return 1;
+ case 5: /* gs */
+ regs->vgs = getreg16(regs, modrm);
+ saved_rm_regs.vgs = 0;
+ oldctx.gs_sel = regs->vgs;
return 1;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode.
2006-11-10 22:32 ` Steven Rostedt
@ 2006-11-11 0:09 ` Keir Fraser
0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2006-11-11 0:09 UTC (permalink / raw)
To: Steven Rostedt, Keir Fraser
Cc: Yu, Wilfred, Xin, Xiaohui, xen-devel, Herbert Xu, Jiang, Yunhong,
Li, Xin B, Li, Susie
On 10/11/06 10:32 pm, "Steven Rostedt" <srostedt@redhat.com> wrote:
> I was playing with Plan9 which happens to also tinker with ss, fs, and
> gs in this critical section. It still crashes pretty early, but it
> crashes earlier without this patch. This patch lets Plan9 crash at the
> same location before the original patch Stephen Tweedie sent :}.
>
> This patch makes the mov_to_seg more complete. I left out cs, since I
> don't think that would even make sense with a mov.
Thanks, I'll check this in.
-- Keir
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-11-11 0:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-10 17:04 [Patch] Fix for x86_64 boot failures due tobadsegment setup for protected mode Jiang, Yunhong
2006-11-10 17:25 ` Keir Fraser
2006-11-10 22:32 ` Steven Rostedt
2006-11-11 0:09 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.