]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/vulnerabilities.cgi
SMT: Show status on vulnerabilities.cgi
[ipfire-2.x.git] / html / cgi-bin / vulnerabilities.cgi
index 27643d16cccf7d5bd8cdf0541d8d2f754106976f..371ffa5473d73139986070f1f15c3f677e1ad548 100644 (file)
@@ -170,12 +170,20 @@ print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
 
 &Header::openbox('100%', 'center', $Lang::tr{'settings'});
 
+my $smt_status = &smt_status();
+
 print <<END;
        <table class="tbl" width="66%">
                <tbody>
+                       <tr>
+                               <th colspan="2" align="center">
+                                       <strong>$smt_status</strong>
+                               </th>
+                       </tr>
+
                        <tr>
                                <td width="50%" align="left">
-                                       <strong>$Lang::tr{'enable smt'}</strong>
+                                       $Lang::tr{'enable smt'}
                                </td>
 
                                <td width="50%" align="center">
@@ -222,3 +230,21 @@ sub check_status($) {
 
        return $status;
 }
+
+sub smt_status() {
+       open(FILE, "/sys/devices/system/cpu/smt/control");
+       my $status = <FILE>;
+       close(FILE);
+
+       chomp($status);
+
+       if ($status eq "on") {
+               return $Lang::tr{'smt enabled'};
+       } elsif (($status eq "off") || ($status eq "forceoff")) {
+               return $Lang::tr{'smt disabled'};
+       } elsif ($status eq "notsupported") {
+               return $Lang::tr{'smt not supported'};
+       }
+
+       return $status;
+}