[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] minor x86-64 corrections

From: Filip Navara
Subject: Re: [Qemu-devel] [PATCH] minor x86-64 corrections
Date: Fri, 21 Jan 2005 23:07:40 +0100
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

Fabrice Bellard wrote:

Filip Navara wrote:


2005-01-21 Filip Navara <address@hidden>

* Add support for CR8 register.
* Don't throw exception when assigning zero to SS register
in 64-bit mode.

BTW, the callgate support for x86-64 in long mode is broken. See "AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions", page 90. Anybody cares to fix it?

No time yet. It would be interesting to find the problem for the Linux user code too.

Ok, I'll try to fix it myself. BTW the same issue is present also in the protected mode JMP code.

+++ target-i386/helper.c    21 Jan 2005 20:13:30 -0000
@@ -1454,8 +1454,13 @@
     selector &= 0xffff;
     if ((selector & 0xfffc) == 0) {
         /* null selector case */
-        if (seg_reg == R_SS)
+        if (seg_reg == R_SS) {
+#ifdef TARGET_X86_64
+            if (env->hflags & HF_CS64_MASK)
+                return;
             raise_exception_err(EXCP0D_GPF, 0);
+        }
         cpu_x86_load_seg_cache(env, seg_reg, selector, 0, 0, 0);

--- target-i386/helper.c    16 Jan 2005 23:35:43 -0000    1.40

Maybe the SS segment cache should be set to zero ?

I'm not sure really, but I guess you're right.

MOV documentation:
... "It is possible to move a null segment selector value (0000–0003h) into the DS, ES, FS, or GS register. This action does not cause a general protection fault, but a subsequent reference to such a segment does cause a #GP exception. For more information about
segment selectors, see “Segment Selectors and Registers” on page 84." ...

GPF is exception is thrown if ... "The SS register was loaded with a null segment selector in non-64-bit mode or while CPL = 3." ...

+void OPPROTO op_movtl_T0_cr7(void)
+    T0 = (cpu_get_apic_tpr(env) & 0xf) >> 4;

Why do you call it cr7 ?

Actually that's a typo.

Filip Navara

reply via email to

[Prev in Thread] Current Thread [Next in Thread]