lkml.org 
[lkml]   [2014]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/urgent] x86, cpu, amd: Add workaround for family 16h, erratum 793
On 01/14/2014 04:45 PM, tip-bot for Borislav Petkov wrote:
> + rdmsrl(MSR_AMD64_LS_CFG, val);
> + if (!(val & BIT(15)))
> + wrmsrl(MSR_AMD64_LS_CFG, val | BIT(15));

Incidentally, I'm wondering if we shouldn't have a
set_in_msr()/clear_in_msr() set of functions which would incorporate the
above construct:

void set_in_msr(u32 msr, u64 mask)
{
u64 old, new;

old = rdmsrl(msr);
new = old | mask;
if (old != new)
wrmsrl(msr, new);
}

... and the obvious equivalent for clear_in_msr().

The perhaps only question is if it should be "set/clear_bit_in_msr()"
rather than having to haul a full 64-bit mask in the common case.

-hpa




\
 
 \ /
  Last update: 2014-01-15 03:01    [W:0.082 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site