Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
HardenedBSD
Commits
03473e8e
Commit
03473e8e
authored
Jul 04, 2022
by
Dmitry Chagin
Browse files
linux(4): Use saved cpu feature bits
MFC after: 3 days
parent
42317e64
Changes
1
Hide whitespace changes
Inline
Side-by-side
sys/x86/linux/linux_vdso_selector_x86.c
View file @
03473e8e
...
...
@@ -61,21 +61,10 @@ linux_vdso_tsc_selector_idx()
int
linux_vdso_cpu_selector_idx
()
{
u_int
amd_feature
,
cpu_exthigh
,
p
[
4
];
if
((
cpu_stdext_feature2
&
CPUID_STDEXT2_RDPID
)
!=
0
)
return
(
LINUX_VDSO_CPU_RDPID
);
amd_feature
=
0
;
if
(
cpu_feature
!=
0
)
{
do_cpuid
(
0x80000000
,
p
);
cpu_exthigh
=
p
[
0
];
if
(
cpu_exthigh
>=
0x80000001
)
{
do_cpuid
(
0x80000001
,
p
);
amd_feature
=
p
[
3
];
}
}
return
((
amd_feature
&
AMDID_RDTSCP
)
==
0
?
LINUX_VDSO_CPU_DEFAULT
:
LINUX_VDSO_CPU_RDTSCP
);
}
HardenedBSD Services
@hardenedbsd-services
mentioned in commit
00c933e9
·
Jul 11, 2022
mentioned in commit
00c933e9
mentioned in commit 00c933e9254c0890f6f7cf695f82dcf6ba2a6c51
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment