[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200603011716.GC24169@linux.intel.com>
Date: Tue, 2 Jun 2020 18:17:17 -0700
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: tglx@...utronix.de, luto@...capital.net,
linux-kernel@...r.kernel.org, x86@...nel.org,
Lai Jiangshan <laijs@...ux.alibaba.com>,
andrew.cooper3@...rix.com, daniel.thompson@...aro.org,
a.darwish@...utronix.de, rostedt@...dmis.org,
bigeasy@...utronix.de, Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH 08/14] x86/entry: Optimize local_db_save() for virt
On Fri, May 29, 2020 at 11:27:36PM +0200, Peter Zijlstra wrote:
> Because DRn access is 'difficult' with virt; but the DR7 read is
> cheaper than a cacheline miss on native, add a virt specific
> fast path to local_db_save(), such that when breakpoints are not in
> use we avoid touching DRn entirely.
>
> Suggested-by: Andy Lutomirski <luto@...nel.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> arch/x86/include/asm/debugreg.h | 7 ++++++-
> arch/x86/kernel/hw_breakpoint.c | 26 ++++++++++++++++++++++----
> arch/x86/kvm/vmx/nested.c | 2 +-
> 3 files changed, 29 insertions(+), 6 deletions(-)
...
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -3028,9 +3028,9 @@ static int nested_vmx_check_vmentry_hw(s
> /*
> * VMExit clears RFLAGS.IF and DR7, even on a consistency check.
> */
> - local_irq_enable();
> if (hw_breakpoint_active())
> set_debugreg(__this_cpu_read(cpu_dr7), 7);
> + local_irq_enable();
> preempt_enable();
This should be a separate patch, probably with:
Cc: stable@...r.kernel.org
Fixes: 52017608da33 ("KVM: nVMX: add option to perform early consistency checks via H/W")
Powered by blists - more mailing lists