ptrace "fix" breaks ia64

From: David Mosberger
Date: Wed Jul 07 2004 - 13:26:43 EST


Roland,

Peter Chubb found that your recent ptrace change to fix x86-64 access
to the 32-bit vsyscall page breaks ia64. See:

http://www.gelato.unsw.edu.au/linux-ia64/0407/10253.html

The problem is due to the fact that the gate page on ia64 really does
live in the kernel-mapped segment (as your original code correctly
assumed). Furthermore, pgd_offset_k() is different from pgd_offset()
since the kernel-mapped segment gets a full page-directory inside a
single region, whereas user-space regions get only 1/8th of a
page-directory, so it's not OK to use pgd_offset() in lieu of
pgd_offset().

As Peter's mail suggests, we _could_ make pgd_offset() smarter by
automatically redirecting it to pgd_offset_k() when necessary, but
that's not a nice solution because it would slow down everything else
and would kind of defeat the purpose of having separate pgd_offset_k()
and pgd_offset() macros.

I suppose we could have a new macro pgd_offset_gate() or something
along those lines to accommodate platform-differences in where the
gage page lives.

--david
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/