Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
162f677d
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
接近 2 年 前同步成功
通知
12
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
162f677d
编写于
4月 01, 2007
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update x86cpuid.pl to correctly detect shared cache and to support new
RC4_set_key.
上级
28754624
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
15 deletion
+46
-15
crypto/x86cpuid.pl
crypto/x86cpuid.pl
+24
-0
doc/crypto/OPENSSL_ia32cap.pod
doc/crypto/OPENSSL_ia32cap.pod
+22
-15
未找到文件。
crypto/x86cpuid.pl
浏览文件 @
162f677d
...
@@ -20,12 +20,36 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
...
@@ -20,12 +20,36 @@ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
&xor
("
ecx
","
eax
");
&xor
("
ecx
","
eax
");
&bt
("
ecx
",
21
);
&bt
("
ecx
",
21
);
&jnc
(
&label
("
nocpuid
"));
&jnc
(
&label
("
nocpuid
"));
&xor
("
eax
","
eax
");
&cpuid
();
&xor
("
eax
","
eax
");
&cmp
("
ebx
",
0x756e6547
);
# "Genu"
&setne
(
&LB
("
eax
"));
&mov
("
ebp
","
eax
");
&cmp
("
edx
",
0x49656e69
);
# "ineI"
&setne
(
&LB
("
eax
"));
&or
("
ebp
","
eax
");
&cmp
("
ecx
",
0x6c65746e
);
# "ntel"
&setne
(
&LB
("
eax
"));
&or
("
ebp
","
eax
");
&mov
("
eax
",
1
);
&mov
("
eax
",
1
);
&cpuid
();
&cpuid
();
&bt
("
edx
",
28
);
# test hyper-threading bit
&jnc
(
&label
("
nocpuid
"));
&cmp
("
ebp
",
0
);
&jne
(
&label
("
notintel
"));
&or
("
edx
",
1
<<
20
);
# use reserved bit to engage RC4_CHAR
&set_label
("
notintel
");
&shr
("
ebx
",
16
);
&cmp
(
&LB
("
ebx
"),
1
);
# see if cache is shared(*)
&ja
(
&label
("
nocpuid
"));
&and
("
edx
",
~
(
1
<<
28
));
# clear hyper-threading bit if not
&set_label
("
nocpuid
");
&set_label
("
nocpuid
");
&mov
("
eax
","
edx
");
&mov
("
eax
","
edx
");
&mov
("
edx
","
ecx
");
&mov
("
edx
","
ecx
");
&function_end
("
OPENSSL_ia32_cpuid
");
&function_end
("
OPENSSL_ia32_cpuid
");
# (*) on Core2 this value is set to 2 denoting the fact that L2
# cache is shared between cores.
&external_label
("
OPENSSL_ia32cap_P
");
&external_label
("
OPENSSL_ia32cap_P
");
...
...
doc/crypto/OPENSSL_ia32cap.pod
浏览文件 @
162f677d
...
@@ -17,20 +17,27 @@ register after executing CPUID instruction with EAX=1 input value (see
...
@@ -17,20 +17,27 @@ register after executing CPUID instruction with EAX=1 input value (see
Intel Application Note #241618). Naturally it's meaningful on IA-32[E]
Intel Application Note #241618). Naturally it's meaningful on IA-32[E]
platforms only. The variable is normally set up automatically upon
platforms only. The variable is normally set up automatically upon
toolkit initialization, but can be manipulated afterwards to modify
toolkit initialization, but can be manipulated afterwards to modify
crypto library behaviour. For the moment of this writing five bits are
crypto library behaviour. For the moment of this writing six bits are
significant, namely bit #28 denoting Hyperthreading, which is used to
significant, namely:
distinguish Intel P4 core, bit #26 denoting SSE2 support, bit #25
denoting SSE support, bit #23 denoting MMX support, and bit #4 denoting
1. bit #28 denoting Hyperthreading, which is used to distiguish
presence of Time-Stamp Counter. Clearing bit #26 at run-time for
cores with shared cache;
example disables high-performance SSE2 code present in the crypto
2. bit #26 denoting SSE2 support;
library. You might have to do this if target OpenSSL application is
3. bit #25 denoting SSE support;
executed on SSE2 capable CPU, but under control of OS which does not
4. bit #23 denoting MMX support;
support SSE2 extentions. Even though you can manipulate the value
5. bit #20, reserved by Intel, is used to choose between RC4 code
programmatically, you most likely will find it more appropriate to set
pathes;
up an environment variable with the same name prior starting target
6. bit #4 denoting presence of Time-Stamp Counter.
application, e.g. 'env OPENSSL_ia32cap=0x12800010 apps/openssl', to
achieve same effect without modifying the application source code.
For example, clearing bit #26 at run-time disables high-performance
Alternatively you can reconfigure the toolkit with no-sse2 option and
SSE2 code present in the crypto library. You might have to do this if
recompile.
target OpenSSL application is executed on SSE2 capable CPU, but under
control of OS which does not support SSE2 extentions. Even though you
can manipulate the value programmatically, you most likely will find it
more appropriate to set up an environment variable with the same name
prior starting target application, e.g. on Intel P4 processor 'env
OPENSSL_ia32cap=0x12900010 apps/openssl', to achieve same effect
without modifying the application source code. Alternatively you can
reconfigure the toolkit with no-sse2 option and recompile.
=cut
=cut
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录