Keir Fraser writes:
> On 11/11/08 07:39, "Kouya Shimura" <kouya@xxxxxxxxxxxxxx> wrote:
>
> > In VMX real mode, the return value of segment register from
> > getvcpucontext is corrupt.
> >
> This isn't unique to VMX realmode. The code you added is actually
> HVM-generic and belongs directly in arch_get_info_guest() for all SVM and
> VMX execution modes.
>
> -- Keir
>
Okay. Revised patch attached.
Actually I'm not familiar with SVM.
Thanks,
Kouya
x86: fix getvcpucontext about segment registers in real mode
Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Signed-off-by: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
diff -r 5fd51e1e9c79 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c Wed Nov 05 10:57:21 2008 +0000
+++ b/xen/arch/x86/domctl.c Tue Nov 11 17:54:16 2008 +0900
@@ -1079,6 +1079,24 @@ void arch_get_info_guest(struct vcpu *v,
c.nat->ctrlreg[2] = v->arch.hvm_vcpu.guest_cr[2];
c.nat->ctrlreg[3] = v->arch.hvm_vcpu.guest_cr[3];
c.nat->ctrlreg[4] = v->arch.hvm_vcpu.guest_cr[4];
+ if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PE) )
+ {
+ struct cpu_user_regs *regs = &c.nat->user_regs;
+ struct segment_register sreg;
+
+ hvm_get_segment_register(v, x86_seg_cs, &sreg);
+ regs->cs = sreg.sel;
+ hvm_get_segment_register(v, x86_seg_ss, &sreg);
+ regs->ss = sreg.sel;
+ hvm_get_segment_register(v, x86_seg_ds, &sreg);
+ regs->ds = sreg.sel;
+ hvm_get_segment_register(v, x86_seg_es, &sreg);
+ regs->es = sreg.sel;
+ hvm_get_segment_register(v, x86_seg_fs, &sreg);
+ regs->fs = sreg.sel;
+ hvm_get_segment_register(v, x86_seg_gs, &sreg);
+ regs->gs = sreg.sel;
+ }
}
else
{
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|