All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type
@ 2007-03-26 13:53 Bernhard Kauer
  2007-03-26 13:54 ` Julian Seward
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Kauer @ 2007-03-26 13:53 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

The Intel manual states for LTR and 64-Bit Exceptions:

    #GP(selector)
       If the descriptor type of the upper 8-byte of the 16-byte descriptor
       is non-zero.

Qemu currently does not check this. The attached patch fixes the bug.


    Bernhard Kauer

[-- Attachment #2: qemu_ltr.diff --]
[-- Type: text/plain, Size: 605 bytes --]

--- helper.c.orig	2007-03-26 15:39:11.000000000 +0200
+++ helper.c	2007-03-26 15:40:27.000000000 +0200
@@ -1825,8 +1825,11 @@
             raise_exception_err(EXCP0B_NOSEG, selector & 0xfffc);
 #ifdef TARGET_X86_64
         if (env->hflags & HF_LMA_MASK) {
-            uint32_t e3;
+            uint32_t e3, e4;
             e3 = ldl_kernel(ptr + 8);
+	    e4 = ldl_kernel(ptr + 12);
+	    if ((e4 >> DESC_TYPE_SHIFT) & 0xf)
+		raise_exception_err(EXCP0D_GPF, selector & 0xfffc);
             load_seg_cache_raw_dt(&env->tr, e1, e2);
             env->tr.base |= (target_ulong)e3 << 32;
         } else 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type
  2007-03-26 13:53 [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type Bernhard Kauer
@ 2007-03-26 13:54 ` Julian Seward
  2007-03-26 14:04   ` Bernhard Kauer
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Seward @ 2007-03-26 13:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Bernhard Kauer


Does this fix some specific bug you encountered?

J

On Monday 26 March 2007 14:53, Bernhard Kauer wrote:
> The Intel manual states for LTR and 64-Bit Exceptions:
>
>     #GP(selector)
>        If the descriptor type of the upper 8-byte of the 16-byte descriptor
>        is non-zero.
>
> Qemu currently does not check this. The attached patch fixes the bug.
>
>
>     Bernhard Kauer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type
  2007-03-26 13:54 ` Julian Seward
@ 2007-03-26 14:04   ` Bernhard Kauer
  0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Kauer @ 2007-03-26 14:04 UTC (permalink / raw)
  To: qemu-devel

On Mon, Mar 26, 2007 at 01:54:43PM +0000, Julian Seward wrote:
> 
> Does this fix some specific bug you encountered?

I have some code here that runs on Qemu but not on real hardware
due to this missing check.


    Bernhard


> On Monday 26 March 2007 14:53, Bernhard Kauer wrote:
> > The Intel manual states for LTR and 64-Bit Exceptions:
> >
> >     #GP(selector)
> >        If the descriptor type of the upper 8-byte of the 16-byte descriptor
> >        is non-zero.
> >
> > Qemu currently does not check this. The attached patch fixes the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-03-26 14:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26 13:53 [Qemu-devel] Patch: ltr for x86_64 should check the upper descriptor type Bernhard Kauer
2007-03-26 13:54 ` Julian Seward
2007-03-26 14:04   ` Bernhard Kauer

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.