[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403164156.GY20730@hirez.programming.kicks-ass.net>
Date: Fri, 3 Apr 2020 18:41:56 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
"Kenneth R. Crudup" <kenny@...ix.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Jessica Yu <jeyu@...nel.org>,
Fenghua Yu <fenghua.yu@...el.com>,
Xiaoyao Li <xiaoyao.li@...el.com>,
Nadav Amit <namit@...are.com>,
Thomas Hellstrom <thellstrom@...are.com>,
Tony Luck <tony.luck@...el.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [patch 1/2] x86,module: Detect VMX modules and disable
Split-Lock-Detect
On Fri, Apr 03, 2020 at 09:36:05AM -0700, Sean Christopherson wrote:
> On Thu, Apr 02, 2020 at 02:32:59PM +0200, Thomas Gleixner wrote:
> > --- a/arch/x86/kernel/module.c
> > +++ b/arch/x86/kernel/module.c
> > @@ -24,6 +24,7 @@
> > #include <asm/pgtable.h>
> > #include <asm/setup.h>
> > #include <asm/unwind.h>
> > +#include <asm/cpu.h>
> >
> > #if 0
> > #define DEBUGP(fmt, ...) \
> > @@ -253,6 +254,11 @@ int module_finalize(const Elf_Ehdr *hdr,
> > tseg, tseg + text->sh_size);
> > }
> >
> > + if (text && !me->sld_safe) {
>
> As also reported by the test bot, sld_safe only exist if CPU_SUP_INTEL=y.
>
> This can also be conditioned on boot_cpu_has(X86_FEATURE_VMX), or the
> static variant. If CPU_SUP_INTEL=y, X86_FEATURE_VMX will be set if and
> only if VMX is fully enabled, i.e. supported by the CPU and enabled in
> MSR_IA32_FEATURE_CONTROl.
>
> > + void *tseg = (void *)text->sh_addr;
> > + split_lock_validate_module_text(me, tseg, tseg + text->sh_size);
> > + }
Ideally we push it all into arch code, but load_info isn't exposed to
arch module code :/.
Powered by blists - more mailing lists