On Tue, Oct 17, 2023 at 11:21:47AM +0200, Jan Beulich wrote: > On 17.10.2023 11:13, Roger Pau Monné wrote: > > On Tue, Oct 17, 2023 at 08:50:45AM +0100, Andrew Cooper wrote: > >> On 17/10/2023 8:44 am, Jan Beulich wrote: > >>> On 13.10.2023 17:38, Alejandro Vallejo wrote: > >>>> Fix adapted off Linux's mailing list: > >>>> > >>>> https://lore.kernel.org/lkml/d99589f4-bc5d-430b-87b2-72c20370c...@exactcode.com/T/#u > >>> Why reference the bug report when there's a proper commit (f454b18e07f5) > >>> now? > >>> Plus in any event a short summary of the erratum would help if put right > >>> here > >>> (without needing to look up any documents or follow any links). > >> > >> That is not public information yet. The erratum number alone is the > >> best we can do at this juncture. > >>>> --- a/xen/arch/x86/cpu/amd.c > >>>> +++ b/xen/arch/x86/cpu/amd.c > >>>> @@ -1004,6 +1004,28 @@ static void cf_check zen2_disable_c6(void *arg) > >>>> wrmsrl(MSR_AMD_CSTATE_CFG, val & mask); > >>>> } > >>>> > >>>> +static void amd_check_erratum_1485(void) > >>>> +{ > >>>> + uint64_t val, chickenbit = (1 << 5); > >>> Linux gives the bit a name. Any reason you don't? > >> > >> There are multiple different names depending on where you look, and none > >> are particularly relevant here. > > > > Could we make chickenbit const static? > > > > I would also use ULL just to be on the safe side, because we then copy > > this for a different bit and it explodes. > > I guess the way it is resembles what we already have in amd_check_zenbleed(). > Also it's not clear to me why besides "const" you also ask for "static".
Yes, makes no sense to put in .rodata, sorry, just const. Roger.