Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jul 2008 13:02:08 -0700
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Christian Kandeler <christian.kandeler@hob.de>
Cc:        freebsd-ia64@freebsd.org
Subject:   Re: ia64_change_mode and BSPSTORE region
Message-ID:  <243F0C03-CDCD-4C3F-9FE0-FC9D199B52DA@mac.com>
In-Reply-To: <200807041626.00442.christian.kandeler@hob.de>
References:  <200807041626.00442.christian.kandeler@hob.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On Jul 4, 2008, at 7:26 AM, Christian Kandeler wrote:

> Hi,
>
> function ia64_change_mode (sys/ia64/ia64/support.S) changes the
> addressing mode from virtual to physical or vice versa. In the course
> of this, the address of the backing store is converted as well. This
> conversion is done by simply stripping off (or inserting) the virtual
> region number, so the function obviously assumes that BSPSTORE is
> identity-mapped (i.e. in region 7). This does not seem to be
> necessarily true, though: For instance, when I call
> ia64_call_pal_stacked_physical() from a kernel module (which I have
> no reason to believe is illegal), it crashes, because BSPSTORE is in
> region 5. I also recall that once during a kdb session, I tried to
> read the translation registers and it also crashed, presumably for
> the same reason. What's going wrong here?

The implementation has become stale. At first, the kernel
stack was physically contiguous for all threads and this
code was fine. But since it's not desirable to have to
find (physically) contiguous memory for kernel stacks, I
changed the implementation to use regular virtual memory.
In other words: kernel stacks became mapped by region 5
addresses.

Later this was also done for thread0's stack, so that
the temporary boot stack (stack0) became available for
exactly this reason: the ability to call PAL in phys.
mode. However, I haven't had the time to complete the
change. It's not a simple switch from virtual to physical
addressing anymore. It's also a kernel stack switch and
it requires a little but of extra work to get that right
and since this code is not used normally, it's simply
not high enough on my todo list to actually get to it.

FYI,

-- 
Marcel Moolenaar
xcllnt@mac.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?243F0C03-CDCD-4C3F-9FE0-FC9D199B52DA>