RE: [PATCH v8 04/13] arch/resctrl: Bring all the macros to resctrl.h

From: Moger, Babu
Date: Tue Nov 20 2018 - 11:33:00 EST


Boris,

> -----Original Message-----
> From: Borislav Petkov <bp@xxxxxxxxx>
> Sent: Tuesday, November 20, 2018 3:36 AM
> To: Moger, Babu <Babu.Moger@xxxxxxx>
> Cc: tglx@xxxxxxxxxxxxx; mingo@xxxxxxxxxx; corbet@xxxxxxx;
> fenghua.yu@xxxxxxxxx; reinette.chatre@xxxxxxxxx; peterz@xxxxxxxxxxxxx;
> gregkh@xxxxxxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx; akpm@linux-
> foundation.org; hpa@xxxxxxxxx; x86@xxxxxxxxxx;
> mchehab+samsung@xxxxxxxxxx; arnd@xxxxxxxx;
> kstewart@xxxxxxxxxxxxxxxxxxx; pombredanne@xxxxxxxx;
> rafael@xxxxxxxxxx; kirill.shutemov@xxxxxxxxxxxxxxx; tony.luck@xxxxxxxxx;
> qianyue.zj@xxxxxxxxxxxxxxx; xiaochen.shen@xxxxxxxxx;
> pbonzini@xxxxxxxxxx; Singh, Brijesh <brijesh.singh@xxxxxxx>; Hurwitz,
> Sherry <sherry.hurwitz@xxxxxxx>; dwmw2@xxxxxxxxxxxxx; Lendacky,
> Thomas <Thomas.Lendacky@xxxxxxx>; luto@xxxxxxxxxx; joro@xxxxxxxxxx;
> jannh@xxxxxxxxxx; vkuznets@xxxxxxxxxx; rian@xxxxxxxxxxxx;
> jpoimboe@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-
> doc@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v8 04/13] arch/resctrl: Bring all the macros to resctrl.h
>
> On Fri, Nov 16, 2018 at 08:54:28PM +0000, Moger, Babu wrote:
> > diff --git a/arch/x86/kernel/cpu/resctrl_monitor.c
> b/arch/x86/kernel/cpu/resctrl_monitor.c
> > index 6d654f7b0eba..9fd62263dabd 100644
> > --- a/arch/x86/kernel/cpu/resctrl_monitor.c
> > +++ b/arch/x86/kernel/cpu/resctrl_monitor.c
> > @@ -28,9 +28,6 @@
> > #include <asm/cpu_device_id.h>
> > #include "resctrl.h"
> >
> > -#define MSR_IA32_QM_CTR 0x0c8e
> > -#define MSR_IA32_QM_EVTSEL 0x0c8d
> > -
> > struct rmid_entry {
> > u32 rmid;
> > int busy;
> > @@ -97,8 +94,8 @@ static u64 __rmid_read(u32 rmid, u32 eventid)
> > * IA32_QM_CTR.Error (bit 63) and IA32_QM_CTR.Unavailable (bit 62)
> > * are error bits.
> > */
> > - wrmsr(MSR_IA32_QM_EVTSEL, eventid, rmid);
> > - rdmsrl(MSR_IA32_QM_CTR, val);
> > + wrmsr(IA32_QM_EVTSEL, eventid, rmid);
> > + rdmsrl(IA32_QM_CTR, val);
>
> Well, if you have a look at arch/x86/include/asm/msr-index.h, you'll see
> that all MSR defines are prefixed with "MSR_" so dropping that prefix
> here loses information and staring at the define doesn't tell me what it
> is.

Ok. Sure. Will retain MSR_.

>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.