From: Nitesh Narayan Lal <nitesh@redhat.com>
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, mtosatti@redhat.com, rkrcmar@redhat.com,
vkuznets@redhat.com, sean.j.christopherson@intel.com,
wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org
Subject: [PATCH v2 0/2] KVM: deliver IOAPIC scan request only to the target vCPUs
Date: Thu, 7 Nov 2019 07:53:41 -0500 [thread overview]
Message-ID: <1573131223-5685-1-git-send-email-nitesh@redhat.com> (raw)
IOAPIC scan requests with fixed delivery mode should only be delivered to the
vCPUs specified by the destination ID.
The second patch in this patch-set introduces an additional
kvm_get_dest_vcpus_mask() API which retrieves a bitmap with bits set for each
target vCPUs. This bitmap is later passed on to the
kvm_make_vcpus_request_mask().
I have re-used the patch sent by Radim Krčmář, which adds the support to
remember the position of each vCPUs in kvm->vcpus array.
As I needed to find out the vCPUs index in kvm->vcpus array for setting the
bits in the bitmap corresponding to the target vCPUs.
This support will enable us to reduce the latency overhead on isolated
vCPUs caused by the IPI to process due to KVM_REQ_IOAPIC_SCAN. With the current
implementation, the KVM_REQ_IOAPIC_SCAN is flushed on to all the vCPUs even
if it is meant for just one of them.
Testing:
I have added the support for testing IOAPIC logical and physical destination
mode under Fixed Delivery mode to kvm-unit-test and used it to test this patch.
https://patchwork.kernel.org/cover/11230215/
Tested the scenario where kvm_apic_map_get_dest_lapic() returns false in
kvm_get_dest_vcpus_mask() using the same patch-set mentioned above.
Changes from v1:
https://lkml.org/lkml/2019/11/6/535
- Renamed vcpus_idx to vcpu_idx.
- Fixed a bug in kvm_get_dest_vcpus_mask(), which would have triggered when
kvm_apic_map_get_dest_lapic() returned false.
- Removed kvm_make_cpus_request_mask() from kvm_main.c. Now, I am directly
calling kvm_make_vcpus_request_mask() from
kvm_make_scan_ioapic_request_mask().
Nitesh Narayan Lal (1):
KVM: x86: deliver KVM IOAPIC scan request to target vCPUs
Radim Krčmář (1):
KVM: remember position in kvm->vcpus array
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/kvm/ioapic.c | 33 +++++++++++++++++++++++++++++--
arch/x86/kvm/lapic.c | 44 +++++++++++++++++++++++++++++++++++++++++
arch/x86/kvm/lapic.h | 3 +++
arch/x86/kvm/x86.c | 14 +++++++++++++
include/linux/kvm_host.h | 13 +++++-------
virt/kvm/kvm_main.c | 5 +++--
7 files changed, 102 insertions(+), 12 deletions(-)
--
next reply other threads:[~2019-11-07 12:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 12:53 Nitesh Narayan Lal [this message]
2019-11-07 12:53 ` [Patch v2 1/2] KVM: remember position in kvm->vcpus array Nitesh Narayan Lal
2019-11-07 12:53 ` [Patch v2 2/2] KVM: x86: deliver KVM IOAPIC scan request to target vCPUs Nitesh Narayan Lal
2019-11-15 10:26 ` Paolo Bonzini
2019-11-15 11:45 ` Nitesh Narayan Lal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1573131223-5685-1-git-send-email-nitesh@redhat.com \
--to=nitesh@redhat.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox