[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/6] x86/AMD Split init_amd() into per-uarch helpers
On Fri, Dec 28, 2018 at 12:39:31PM +0000, Andrew Cooper wrote: > This reduces the complexity of init_amd(), and collects related > workarounds together. > > It also offers us the opportunity to stop performing workarounds when > virtualised - doing so is wasteful, as it all involves poking MSRs which > no hypervisor will let us touch in practice. > > As amd.c has diverged almost entirely from its Linux heratage, start > switching it to using Xen hypervisor style. > > Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > --- > CC: Jan Beulich <JBeulich@xxxxxxxx> > CC: Wei Liu <wei.liu2@xxxxxxxxxx> > CC: Roger Pau Monné <roger.pau@xxxxxxxxxx> > > I've dropped various printk()s about working around some errata, because > their use was completely inconsistent. They want to be uniform, whether > that is missing or present. > --- > xen/arch/x86/cpu/amd.c | 266 > ++++++++++++++++++++++++++++--------------------- > 1 file changed, 153 insertions(+), 113 deletions(-) > > diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c > index c790416..c3aa1f4 100644 > --- a/xen/arch/x86/cpu/amd.c > +++ b/xen/arch/x86/cpu/amd.c > @@ -534,22 +534,165 @@ static void early_init_amd(struct cpuinfo_x86 *c) > ctxt_switch_levelling(NULL); > } > > +static void init_amd_k8(struct cpuinfo_x86 *c) > +{ > + uint64_t val; > + > + /* > + * Skip errata workarounds if we are virtualised. We won't have > + * sufficient control of hardware to do anything useful. > + */ > + if ( !cpu_has_hypervisor ) I think you want `if ( cpu_has_hypervisor ) return;` according to the comment (here and below). The rest LGTM, as is mostly code movement AFAICT: Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |