forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/mattst88/alpha Pull alpha updates from Matt Turner: "A few small changes for alpha" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha: alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering alpha: Implement CPU vulnerabilities sysfs functions. alpha: rtc: stop validating rtc_time in .read_time alpha: rtc: remove unused set_mmss ops
- Loading branch information
Showing
5 changed files
with
55 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
#include <asm/hwrpb.h> | ||
#include <linux/device.h> | ||
|
||
|
||
#ifdef CONFIG_SYSFS | ||
|
||
static int cpu_is_ev6_or_later(void) | ||
{ | ||
struct percpu_struct *cpu; | ||
unsigned long cputype; | ||
|
||
cpu = (struct percpu_struct *)((char *)hwrpb + hwrpb->processor_offset); | ||
cputype = cpu->type & 0xffffffff; | ||
/* Include all of EV6, EV67, EV68, EV7, EV79 and EV69. */ | ||
return (cputype == EV6_CPU) || ((cputype >= EV67_CPU) && (cputype <= EV69_CPU)); | ||
} | ||
|
||
ssize_t cpu_show_meltdown(struct device *dev, | ||
struct device_attribute *attr, char *buf) | ||
{ | ||
if (cpu_is_ev6_or_later()) | ||
return sprintf(buf, "Vulnerable\n"); | ||
else | ||
return sprintf(buf, "Not affected\n"); | ||
} | ||
|
||
ssize_t cpu_show_spectre_v1(struct device *dev, | ||
struct device_attribute *attr, char *buf) | ||
{ | ||
if (cpu_is_ev6_or_later()) | ||
return sprintf(buf, "Vulnerable\n"); | ||
else | ||
return sprintf(buf, "Not affected\n"); | ||
} | ||
|
||
ssize_t cpu_show_spectre_v2(struct device *dev, | ||
struct device_attribute *attr, char *buf) | ||
{ | ||
if (cpu_is_ev6_or_later()) | ||
return sprintf(buf, "Vulnerable\n"); | ||
else | ||
return sprintf(buf, "Not affected\n"); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters