From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: [RFC PATCH 0/3] kvm: x86: speedups for APICv Date: Tue, 27 Sep 2016 23:20:10 +0200 Message-ID: <1475011213-34225-1-git-send-email-pbonzini@redhat.com> Cc: yang.zhang.wz@gmail.com, feng.wu@intel.com, mst@redhat.com, rkrcmar@redhat.com To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: Received: from mail-wm0-f54.google.com ([74.125.82.54]:36395 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbcI0VUS (ORCPT ); Tue, 27 Sep 2016 17:20:18 -0400 Sender: kvm-owner@vger.kernel.org List-ID: These patches save 40 cycles on kvm-unit-tests "inl" tests, but I suspect the effect is bigger on workloads that inject interrupts heavily. The difficult one is patch 2. I find the new code easier to follow than the old one, but it doesn't mean it works. :) The aim is for APICv to not use KVM_REQ_EVENT at all for interrupts, therefore turning APICv's weakness (having to look at PIR on every vmentry) into a strength (because checking PIR.ON is cheaper than processing KVM_REQ_EVENT). The others are just micro-optimization of the surrounding code. Tested extremely lightly and obviously not for 4.9, just shooting it out now. Paolo Paolo Bonzini (3): kvm: x86: avoid atomic operations on APICv vmentry kvm: x86: do not use KVM_REQ_EVENT for APICv interrupt injection KVM: x86: do not scan IRR twice on APICv vmentry arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/lapic.c | 31 +++++++++++++++++++------------ arch/x86/kvm/lapic.h | 4 ++-- arch/x86/kvm/svm.c | 2 +- arch/x86/kvm/vmx.c | 30 ++++++++++++++++++------------ arch/x86/kvm/x86.c | 16 ++++++++++------ 6 files changed, 51 insertions(+), 34 deletions(-) -- 1.8.3.1