Skip to content

Commit

Permalink
phodevi: CPU core name additions based on latest Linux kernel patches
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellarabel committed Jun 25, 2022
1 parent ff47166 commit 36de1c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions pts-core/objects/phodevi/components/phodevi_cpu.php
Expand Up @@ -799,6 +799,17 @@ public static function cpu_model()
break;
}
}
else if($implementer == '0xc0')
{
$new_info = 'Ampere';
$part = phodevi_linux_parser::read_cpuinfo_single('CPU part');
switch($part)
{
case '0xac3':
$new_info .= 'One';
break;
}
}

if(strpos(phodevi::$vfs->dmesg, 'Ampere eMAG') !== false || stripos(pts_file_io::file_get_contents_if_exists('/sys/devices/virtual/dmi/id/sys_vendor'), 'Ampere') !== false || stripos(pts_file_io::file_get_contents_if_exists('/sys/devices/virtual/dmi/id/bios_vendor'), 'Ampere') !== false)
{
Expand Down Expand Up @@ -1153,6 +1164,7 @@ public static function get_core_name($family = false, $model = false, $cpu_strin
104 => 'Zen 2',
113 => 'Zen 2',
144 => 'Zen 2',
160 => 'Zen 2',
),
25 => array(
0 => 'Zen 3',
Expand Down Expand Up @@ -1195,6 +1207,8 @@ public static function get_core_name($family = false, $model = false, $cpu_strin
78 => 'Zen 3',
79 => 'Zen 3', // end of Yellow Carp
80 => 'Zen 3',
96 => 'Zen 4',
112 => 'Zen 4',
160 => 'Zen 4',
161 => 'Zen 4',
162 => 'Zen 4',
Expand Down
6 changes: 5 additions & 1 deletion pts-core/objects/phodevi/components/phodevi_system.php
Expand Up @@ -656,7 +656,11 @@ public static function sw_security_features()
$mds_tool = microsoft_dependency_handler::file_download_location() . 'mdstool-cli.exe';
if(is_file($mds_tool))
{
$mds_output = preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', shell_exec($mds_tool));
$mds_output = shell_exec($mds_tool);
if(!empty($mds_output))
{
$mds_output = preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $mds_output);
}
//echo PHP_EOL;
foreach(array('__user pointer sanitization: Disabled', 'Retpoline: Full', 'IBPB: Always', 'IBRS: Enabled', 'STIBP: Enabled', 'KPTI Enabled: Yes', 'PTE Inversion: Yes') as $check)
{
Expand Down

0 comments on commit 36de1c9

Please sign in to comment.