From: Yang Shi <yang.shi@windriver.com>
To: Zhuang Yuyao <mlistz@gmail.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [BUG] Cavium OCTEON strange illegal instruction
Date: Mon, 28 Jun 2010 13:58:49 +0800 [thread overview]
Message-ID: <4C283A19.1000709@windriver.com> (raw)
In-Reply-To: <AANLkTim_pFHPaMdgG23Ijxwv-9EcXPQU5sWeCze2786Q@mail.gmail.com>
Zhuang Yuyao 写道:
> Thanks, Yang, the patch works. But it seems that this patch is not yet
> applied to the linux source master branch on
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary
>
http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=summary
Yang
> On Mon, Jun 28, 2010 at 10:09 AM, Yang Shi <yang.shi@windriver.com> wrote:
>
>> Zhuang Yuyao 写道:
>>
>>> Hi,
>>>
>>> I compiled octeon openssl engine libocteon.so based on
>>> OCTEON-CRYPTO-CORE-1.9.0-60 and OCTEON-ENGINE-LINUX-0.5.0-18.
>>>
>>> it works fine under linux-2.6.32.15, but while I upgraded the kernel
>>> to 2.6.33.5 or 2.6.34, running openssl speed test gives me the
>>> following error:
>>>
>>> ~ # openssl speed -engine octeon rsa1024
>>> Octeon_init success
>>> engine "octeon" set.
>>> Illegal instruction
>>>
>>> ~ # openssl speed -engine octeon -evp des
>>> Octeon_init success
>>> engine "octeon" set.
>>> Doing des-cbc for 3s on 16 size blocks: Illegal instruction
>>>
>>>
>> This should be caused by MIPS CU2 exception handler. You can try Jesper's
>> patch sumbitted one week ago, see below:
>>
>> Breaking here dropped us to the default code which always sends
>> a SIGILL to the current process, no matter what the CU2 notifier says.
>>
>> Signed-off-by: Jesper Nilsson <jesper@jni.nu>
>> ---
>> traps.c
>> <mailbox:///home/yshi/.mozilla-thunderbird/caj8i8s5.default/Mail/Local%20Folders/linux-mips?number=11063936#traps.c>
>> | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> traps.c
>> =======================================
>>
>> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
>> index 8bdd6a6..8527808 100644
>>
>> --- a/arch/mips/kernel/traps.c
>>
>> +++ b/arch/mips/kernel/traps.c
>>
>> @@ -976,8 +976,8 @@
>>
>> 976asmlinkage·void·do_cpu(struct·pt_regs·*regs)
>> 977
>> 978» case·2:
>> 979» » raw_notifier_call_chain(&cu2_chain,·CU2_EXCEPTION,·regs);
>> -980» » break;
>> +980» » return;
>> 981
>> 982» case·3:
>> 983» » break;
>>
>>
>> Yang
>>
>>
>>> Here is the compiling output:
>>>
>>> make[1]: Entering directory
>>> `/root/octcrypto/applications/linux_engine/sample'
>>> make[1]: Leaving directory
>>> `/root/octcrypto/applications/linux_engine/sample'
>>> mips64-octeon-linux-gnu-gcc -I/root/octcrypto/target/include -Iconfig
>>> -DUSE_RUNTIME_MODEL_CHECKS=1 -DCVMX_ENABLE_PARAMETER_CHECKING=0
>>> -DCVMX_ENABLE_CSR_ADDRESS_CHECKING=0 -DCVMX_ENABLE_POW_CHECKS=0 -g
>>> -DOCTEON_MODEL=OCTEON_CN56XX_PASS2 -DOCTEON_TARGET=linux_64 -mabi=64
>>> -march=octeon -msoft-float -Dmain=appmain
>>>
>>> -I/opt/netone/buildfarm/build_mips64_glibc/linux-2.6.33.5x-mips64-o60h/arch/mips/include
>>> -MD -c -o mul_lin.o mul_lin.S
>>> mips64-octeon-linux-gnu-gcc -I.
>>> -I/opt/netone/buildfarm/build_mips64_glibc/openssl-0.9.8n//include
>>> -I/root/octcrypto/components/crypto-api/core/cryptolinux
>>> -I/root/octcrypto/executive -O3 -Wall
>>> -I/root/octcrypto/target/include -Iconfig
>>> -DUSE_RUNTIME_MODEL_CHECKS=1 -DCVMX_ENABLE_PARAMETER_CHECKING=0
>>> -DCVMX_ENABLE_CSR_ADDRESS_CHECKING=0 -DCVMX_ENABLE_POW_CHECKS=0
>>> -DOCTEON_MODEL=OCTEON_CN56XX_PASS2 -DOCTEON_TARGET=linux_64 -mabi=64
>>> -march=octeon -msoft-float -Dmain=appmain -MD -c -o e_octeon.o
>>> e_octeon.c
>>> mips64-octeon-linux-gnu-gcc -I/root/octcrypto/target/include -Iconfig
>>> -DUSE_RUNTIME_MODEL_CHECKS=1 -DCVMX_ENABLE_PARAMETER_CHECKING=0
>>> -DCVMX_ENABLE_CSR_ADDRESS_CHECKING=0 -DCVMX_ENABLE_POW_CHECKS=0
>>> -DOCTEON_MODEL=OCTEON_CN56XX_PASS2 -DOCTEON_TARGET=linux_64 -mabi=64
>>> -march=octeon -msoft-float -Dmain=appmain -shared -o libocteon.so
>>> mul_lin.o e_octeon.o
>>> -L/opt/netone/buildfarm/build_mips64_glibc/openssl-0.9.8n/ -lcrypto
>>>
>>>
>>> What's happened in the kernel?
>>>
>>> thanks very much.
>>>
>>> Best regards,
>>> Zhuang Yuyao
>>>
>>>
>>>
>>>
>>
>
>
prev parent reply other threads:[~2010-06-28 5:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-27 6:53 [BUG] Cavium OCTEON strange illegal instruction Zhuang Yuyao
2010-06-28 2:08 ` Yang Shi
2010-06-28 2:08 ` Yang Shi
2010-06-28 2:09 ` Yang Shi
[not found] ` <AANLkTim_pFHPaMdgG23Ijxwv-9EcXPQU5sWeCze2786Q@mail.gmail.com>
2010-06-28 5:58 ` Yang Shi [this message]
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=4C283A19.1000709@windriver.com \
--to=yang.shi@windriver.com \
--cc=linux-mips@linux-mips.org \
--cc=mlistz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.