forked from Minki/linux
- Complete the MSR write filtering by applying it to the MSR ioctl
interface too. - Other misc small fixups. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmAqXSoACgkQEsHwGGHe VUq9Hw//fnO5VfcQ7f2nBOpy+1sXLV6iuA4F0tR7MlI4kTLH5ULYYEn0SsQn8/OP nx9o6UANQH2NL9IRsN1B/ME3PTF32kMuauXTfFYhO7Zp0cRPXuE/Ew6sv7wfBYXo Cf/XHt8jn7RPm/NcMEYXiMKpE1fUiBIkcMjmDHPHJOe6SaE5MUeA85c2BIBdPQ0S 0g5SlzYZWuxXoUOC3aDi4PMQJqO+tFUYVRP0Zz70XEqbZx9KHLD7U4VhCoYYW4ey FDqo33TAJeOBLMg8jLnPt5v3tXUPf7Rfx5hpxlk8dpiMhcZGbP8BeIj2BLrdufS/ ScuvrMaBqHRyKdOjE6aLhtsZmnoTt/ofOvpyFuoDkvkNgQFk+AiYNXVSZCBPAeEH kTPfHk6s4BsVMZaqV2giAAzWoJxTi/5z0c3ut/OEN894piKpIeXq+FpFdOatRD41 9L2M16vHVvd6WT8RKWeXINpzWp3yOT3VB8Su4+qr3dypugWNlQDHEDH1DWY5xCWS 6MHhvs80JgLBV5RZ9sXxsWQjqQqbZjUEoVQtyyXfuEEP3Y4r+CR1Oks00OO8KXon frRrkZluYUZwCUCYXdNjlP+WINefZrQ9TCVihvYsaRp9jCGIDZHyd7liH4VhKUNG GxTepHmSBB4Pix7YlPVFZSbsPzAAKuHMpSBmasHBAhS3FN6YVMU= =TbqQ -----END PGP SIGNATURE----- Merge tag 'x86_misc_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 misc updates from Borislav Petkov: - Complete the MSR write filtering by applying it to the MSR ioctl interface too. - Other misc small fixups. * tag 'x86_misc_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/MSR: Filter MSR writes through X86_IOC_WRMSR_REGS ioctl too selftests/fpu: Fix debugfs_simple_attr.cocci warning selftests/x86: Use __builtin_ia32_read/writeeflags x86/reboot: Add Zotac ZBOX CI327 nano PCI reboot quirk
This commit is contained in:
commit
317d4f4593
@ -182,6 +182,13 @@ static long msr_ioctl(struct file *file, unsigned int ioc, unsigned long arg)
|
||||
err = security_locked_down(LOCKDOWN_MSR);
|
||||
if (err)
|
||||
break;
|
||||
|
||||
err = filter_write(regs[1]);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
|
||||
|
||||
err = wrmsr_safe_regs_on_cpu(cpu, regs);
|
||||
if (err)
|
||||
break;
|
||||
|
@ -477,6 +477,15 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = {
|
||||
},
|
||||
},
|
||||
|
||||
{ /* PCIe Wifi card isn't detected after reboot otherwise */
|
||||
.callback = set_pci_reboot,
|
||||
.ident = "Zotac ZBOX CI327 nano",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "NA"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "ZBOX-CI327NANO-GS-01"),
|
||||
},
|
||||
},
|
||||
|
||||
/* Sony */
|
||||
{ /* Handle problems with rebooting on Sony VGN-Z540N */
|
||||
.callback = set_bios_reboot,
|
||||
|
@ -63,7 +63,7 @@ static int test_fpu_get(void *data, u64 *val)
|
||||
return status;
|
||||
}
|
||||
|
||||
DEFINE_SIMPLE_ATTRIBUTE(test_fpu_fops, test_fpu_get, NULL, "%lld\n");
|
||||
DEFINE_DEBUGFS_ATTRIBUTE(test_fpu_fops, test_fpu_get, NULL, "%lld\n");
|
||||
static struct dentry *selftest_dir;
|
||||
|
||||
static int __init test_fpu_init(void)
|
||||
@ -72,8 +72,8 @@ static int __init test_fpu_init(void)
|
||||
if (!selftest_dir)
|
||||
return -ENOMEM;
|
||||
|
||||
debugfs_create_file("test_fpu", 0444, selftest_dir, NULL,
|
||||
&test_fpu_fops);
|
||||
debugfs_create_file_unsafe("test_fpu", 0444, selftest_dir, NULL,
|
||||
&test_fpu_fops);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -6,36 +6,20 @@
|
||||
|
||||
static inline unsigned long get_eflags(void)
|
||||
{
|
||||
unsigned long eflags;
|
||||
|
||||
asm volatile (
|
||||
#ifdef __x86_64__
|
||||
"subq $128, %%rsp\n\t"
|
||||
"pushfq\n\t"
|
||||
"popq %0\n\t"
|
||||
"addq $128, %%rsp"
|
||||
return __builtin_ia32_readeflags_u64();
|
||||
#else
|
||||
"pushfl\n\t"
|
||||
"popl %0"
|
||||
return __builtin_ia32_readeflags_u32();
|
||||
#endif
|
||||
: "=r" (eflags) :: "memory");
|
||||
|
||||
return eflags;
|
||||
}
|
||||
|
||||
static inline void set_eflags(unsigned long eflags)
|
||||
{
|
||||
asm volatile (
|
||||
#ifdef __x86_64__
|
||||
"subq $128, %%rsp\n\t"
|
||||
"pushq %0\n\t"
|
||||
"popfq\n\t"
|
||||
"addq $128, %%rsp"
|
||||
__builtin_ia32_writeeflags_u64(eflags);
|
||||
#else
|
||||
"pushl %0\n\t"
|
||||
"popfl"
|
||||
__builtin_ia32_writeeflags_u32(eflags);
|
||||
#endif
|
||||
:: "r" (eflags) : "flags", "memory");
|
||||
}
|
||||
|
||||
#endif /* __SELFTESTS_X86_HELPERS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user