linux-mips
[Top] [All Lists]

Re: [PATCH 35/37] Set c0 status for ST0_KX on Cavium OCTEON.

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 35/37] Set c0 status for ST0_KX on Cavium OCTEON.
From: Chad Reese <kreese@caviumnetworks.com>
Date: Sun, 26 Oct 2008 18:33:44 -0700
Cc: ddaney@caviumnetworks.com, linux-mips@linux-mips.org, Tomaso Paoletti <tpaoletti@caviumnetworks.com>, Paul Gortmaker <Paul.Gortmaker@windriver.com>
In-reply-to: <20081026124821.GN25297@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1224809821-5532-1-git-send-email-ddaney@caviumnetworks.com> <1224809821-5532-36-git-send-email-ddaney@caviumnetworks.com> <20081026124821.GN25297@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.17) Gecko/20080829 Iceape/1.1.12 (Debian-1.1.12-1)
>> -#ifdef CONFIG_64BIT
>> +#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_CAVIUM_OCTEON)
>> +    /*
>> +     * Note: We always set ST0_KX on Octeon since IO addresses are at
>> +     * 64bit addresses. Keep in mind this also moves the TLB handler.
>> +     */
>>      setup_c0_status ST0_KX 0
> 
> That's a bit odd - on 64-bit kernels KX would be set anyway and on 32-bit
> kernels would be corrupted by exceptions or interrupts, so 64-bit
> addresses are not safe to use on 32-bit kernels for most part.
> 
> 32-bit virtual addresses mapped to a non-compat address otoh will work fine
> without KX set.
> 
>   Ralf

The Octeon IO space regions are significantly larger than a 32bit kernel
could tlb map easily. The entire range takes 49 bits to address. As a
not particularly clean, but working alternative, we enable 64bit
addressing in the kernel and used XKPHYS to access IO. Every access was
surrounded by a local_irq_save/local_irq_restore. Since this is ugly to
the extreme, maybe we should drop being able to boot a 32bit kernel on
Octeon until something better is worked out.

Chad



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