Re: output of ksymoops for wabi bug ...

Bill Hawes (whawes@transmeta.com)
Fri, 07 Aug 1998 20:22:17 -0700


This is a multi-part message in MIME format.
--------------BBECAFA7ED0538D2896EC79F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Dave Airlie wrote:

> Here is the output of ksymoops for the wabi bug I reported earlier ..

Hi Dave,

>From the oops output it looks like the ldt slot address has been messed up
somehow. I'm not sure what's causing this, but have attached a small patch to
help diagnose the problem.

If you could you please apply the patch and then try to recreate the oops,
hopefully I can get this fixed right away ...

Regards,
Bill

--------------BBECAFA7ED0538D2896EC79F
Content-Type: text/plain; charset=us-ascii; name="i386_ldt115-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="i386_ldt115-patch"

--- linux-2.1.115/arch/i386/kernel/ldt.c.old Tue Jul 7 12:35:14 1998
+++ linux-2.1.115/arch/i386/kernel/ldt.c Fri Aug 7 20:02:37 1998
@@ -36,9 +36,7 @@
static int write_ldt(void * ptr, unsigned long bytecount, int oldmode)
{
struct mm_struct * mm = current->mm;
- void * ldt;
__u32 entry_1, entry_2, *lp;
- __u16 selector, reg_fs, reg_gs;
int error;
struct modify_ldt_ldt_s ldt_info;

@@ -70,8 +68,8 @@
* For no good reason except historical, the GDT index of the LDT
* is chosen to follow the index number in the task[] array.
*/
- ldt = mm->segments;
- if (!ldt) {
+ if (!mm->segments) {
+ void * ldt;
error = -ENOMEM;
ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE);
if (!ldt)
@@ -93,19 +91,7 @@
}
}

- /*
- * Check whether the entry to be changed is currently in use.
- * If it is, we may need extra validation checks in case the
- * kernel is forced to save and restore the selector.
- *
- * Note: we check the fs and gs values as well, as these are
- * loaded by the signal code and during a task switch.
- */
- selector = (ldt_info.entry_number << 3) | 4;
- __asm__("movw %%fs,%0" : "=r"(reg_fs));
- __asm__("movw %%gs,%0" : "=r"(reg_gs));
-
- lp = (__u32 *) ((selector & ~7) + (char *) ldt);
+ lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->segments);

/* Allow LDTs to be cleared by the user. */
if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
@@ -138,6 +124,8 @@

out_check:
/* OK to change the entry ... */
+printk("write_ldt: ldt=%p, entry=%u, slot=%p\n",
+mm->segments, ldt_info.entry_number, lp);
*lp = entry_1;
*(lp+1) = entry_2;
error = 0;

--------------BBECAFA7ED0538D2896EC79F--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html