linux-mips
[Top] [All Lists]

Re: [PATCH v3] Virtual memory size detection for 64 bit MIPS CPUs

To: Guenter Roeck <guenter.roeck@ericsson.com>
Subject: Re: [PATCH v3] Virtual memory size detection for 64 bit MIPS CPUs
From: David Daney <ddaney@caviumnetworks.com>
Date: Mon, 01 Feb 2010 15:44:21 -0800
Cc: linux-mips@linux-mips.org, "Maciej W. Rozycki" <macro@linux-mips.org>
In-reply-to: <1265064686-31278-1-git-send-email-guenter.roeck@ericsson.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1265064686-31278-1-git-send-email-guenter.roeck@ericsson.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Guenter Roeck wrote:
Linux kernel 2.6.32 and later allocates memory from the top of virtual memory
space.

This patch implements virtual memory size detection for 64 bit MIPS CPUs
to avoid resulting crashes.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
[...]
+static inline void cpu_set_vmbits(struct cpuinfo_mips *c)
+{
+       if (cpu_has_64bits) {
+               write_c0_entryhi(0xfffffffffffff000ULL);

macro indicated that we need to avoid hazards here on R4000.

Perhaps adding:

        back_to_back_c0_hazard();

+               c->vmbits = fls64(read_c0_entryhi() & 0x3ffffffffffff000ULL);
+       } else
+               c->vmbits = 32;
+}
+



<Prev in Thread] Current Thread [Next in Thread>