Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "Uhler, Mike" <uhler@mips.com>
Cc: Fuxin Zhang <fxzhang@ict.ac.cn>,
	tiansm@lemote.com, linux-mips@linux-mips.org,
	Fuxin Zhang <zhangfx@lemote.com>
Subject: Re: [PATCH 3/16] Kconfig update for lemote fulong mini-PC
Date: Wed, 18 Apr 2007 17:38:06 +0100	[thread overview]
Message-ID: <20070418163806.GA27199@linux-mips.org> (raw)
In-Reply-To: <692AB3595F5D76428B34B9BEFE20BC1FC1D723@Exchange.mips.com>

On Wed, Apr 18, 2007 at 08:28:16AM -0700, Uhler, Mike wrote:

> > Yes. Most 64bit MIPS processors cannot access 64bit content 
> > of registers when it is in 32bit mode.
> 
> For clarity, there is no 32/64-bit mode in MIPS processors.  There is a
> mode in which 64-bit OPERATIONS are enabled (that is, those instructions
> which operate on the full width of the registers) - See the definition
> of 64-bit Operations Enable in the MIPS64 Architecture for Programmers,
> volume III.  Note that such operations are always enabled while the
> processor is running in Kernel Mode.
> 
> The patch is a little short on context, but if you've got a 64-bit
> kernel, I had always assumed that save/restore of context is always done
> with LD/SD, not by figuring out whether a process has 64-bit operations
> enabled, then doing a conditional LD/SD or LW/SW.

Here's a funny one where we have something like a mode.  This is a
reposting from Bill Earl:

[...]
     One other issue is that UX should always be set, to allow use of
MIPS3 instructions, and that XX (bit 31) should be set on R5000 and
R10000 processors, to enable MIPS4 instructions.  This in turn means
that, to avoid various illegal address exceptions, the VM system
should not allow a 32-bit user program to map anything into the top 32
KB of the user address space.

     The problem has to do with some compilers using integer
arithmetic to compute a base for some variables in the current stack
frame, and then using negative displacements to address the variables,
for cases where the stack frame exceeds 32 KB, but is located near the
top of memory.  The 32-bit unsigned integer add to, say, 0x7fffff00
(64-bit address 0x000000007fffff00) produces a signed 32-bit value
such as 0x80000f00, which is the 64-bit value 0xffffffff80000f00,
since all 32-bit values, signed or unsigned, are stored as 32-bit
signed values sign-extended to 64 bits.  When you do a load with a
negative offset of, say, -0x1000, you get an address
0xffffffff7fffff00, not 0x000000007fffff00.  With UX=0, this would be
fine, but, with UX=1 (to enable MIPS3 instructions), the above address
is illegal.  If the $sp is always at least 32 KB below the top of the
address space, this problem does not arise, since any such intermediate
pointer generated by the compiler will always be below 0x80000000.
[...]

The original posting is at http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=14452.59571.970106.514001%40liveoak.engr.sgi.com

  Ralf

  parent reply	other threads:[~2007-04-18 16:38 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-15 15:25 lemote-fulong patch update tiansm
2007-04-15 15:25 ` [PATCH 1/16] new files for lemote fulong mini-PC support tiansm
2007-04-15 15:25   ` [PATCH 2/16] arch related Makefile update for lemote fulong mini-PC tiansm
2007-04-15 15:25     ` [PATCH 3/16] Kconfig " tiansm
2007-04-15 15:25       ` [PATCH 4/16] TO_PHYS_MASK for loongson2 tiansm
2007-04-15 15:25         ` [PATCH 5/16] add MACH_GROUP_LEMOTE & MACH_LEMOTE_FULONG tiansm
2007-04-15 15:25           ` [PATCH 6/16] define Hit_Invalidate_I to Index_Invalidate_I for loongson2 tiansm
2007-04-15 15:25             ` [PATCH 7/16] add Loongson processor definitions tiansm
2007-04-15 15:25               ` [PATCH 8/16] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-04-15 15:25                 ` [PATCH 9/16] add serial port definition for lemote fulong tiansm
2007-04-15 15:25                   ` [PATCH 10/16] make cpu_probe recognize Loongson2 tiansm
2007-04-15 15:26                     ` [PATCH 11/16] add Loongson support to /proc/cpuinfo tiansm
2007-04-15 15:26                       ` [PATCH 12/16] cheat for support of more than 256MB memory tiansm
2007-04-15 15:26                         ` [PATCH 13/16] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-04-15 15:26                           ` [PATCH 14/16] tlb handling support for Loongson2 processor tiansm
2007-04-15 15:26                             ` [PATCH 15/16] work around for more than 256MB memory support tiansm
2007-04-15 15:26                               ` [PATCH 16/16] alsa sound support for mips tiansm
2007-04-18 13:54                                 ` Ralf Baechle
2007-04-18 14:13                                   ` Fuxin Zhang
2007-04-20  9:39                                     ` Atsushi Nemoto
2007-04-18 12:11             ` [PATCH 6/16] define Hit_Invalidate_I to Index_Invalidate_I for loongson2 Ralf Baechle
2007-04-18 13:51               ` Fuxin Zhang
2007-04-18 13:56                 ` Fuxin Zhang
2007-04-18 12:02         ` [PATCH 4/16] TO_PHYS_MASK " Ralf Baechle
2007-04-18 12:06       ` [PATCH 3/16] Kconfig update for lemote fulong mini-PC Ralf Baechle
2007-04-18 13:32         ` Fuxin Zhang
2007-04-18 15:28           ` Uhler, Mike
2007-04-18 15:28             ` Uhler, Mike
2007-04-18 15:43             ` Fuxin Zhang
2007-04-18 16:38             ` Ralf Baechle [this message]
2007-04-18 22:27               ` Uhler, Mike
2007-04-18 22:27                 ` Uhler, Mike
2007-04-19  0:34                 ` Ralf Baechle
2007-04-15 22:28     ` [PATCH 2/16] arch related Makefile " Thiemo Seufer
2007-04-16  7:37       ` Tian
2007-04-16  8:48       ` Fuxin Zhang
2007-04-16  8:49       ` Zhang Fuxin
2007-04-16 12:44         ` Thiemo Seufer
2007-04-16 14:01           ` Ralf Baechle
2007-04-16 15:10           ` Zhang Fuxin
  -- strict thread matches above, loose matches on Subject: below --
2007-04-04 14:38 [PATCH 3/16] Kconfig " zhangfx

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070418163806.GA27199@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=fxzhang@ict.ac.cn \
    --cc=linux-mips@linux-mips.org \
    --cc=tiansm@lemote.com \
    --cc=uhler@mips.com \
    --cc=zhangfx@lemote.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox