Skip to content

pic/ioapic/irqchip cleanups + minor fixes

David Hildenbrand kvm 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest24 patches 9 repliesIn review
  2. v224 patches 4 repliesSuperseded
  3. v122 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Added memory barriers as requested by Paolo to patch 2-4

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24KVM: x86: race between KVM_SET_GSI_ROUTING and KVM_CREATE_IRQCHIPvirt/kvm/kvm_main.c+3 -011 replies
2/24KVM: x86: new irqchip mode KVM_IRQCHIP_INIT_IN_PROGRESSarch/x86/include/asm/kvm_host.h arch/x86/kvm/irq.h arch/x86/kvm/x86.c+24 -62 replies
3/24KVM: x86: check against irqchip_mode in kvm_set_routing_entry()arch/x86/kvm/irq_comm.c+8 -62 replies
4/24KVM: x86: check against irqchip_mode in pic_in_kernel()arch/x86/kvm/irq.h+4 -30 replies
5/24KVM: x86: check against irqchip_mode in ioapic_in_kernel()arch/x86/kvm/ioapic.h+4 -30 replies
6/24KVM: x86: get rid of pic_irqchip()arch/x86/kvm/i8259.c arch/x86/kvm/irq.c arch/x86/kvm/irq.h +2 more+16 -230 replies
7/24KVM: x86: get rid of ioapic_irqchip()arch/x86/kvm/ioapic.c arch/x86/kvm/ioapic.h+2 -70 replies
8/24KVM: x86: use ioapic_in_kernel() to check for ioapic existencearch/x86/kvm/ioapic.c+1 -30 replies
9/24KVM: x86: remove duplicate checks for ioapicarch/x86/kvm/ioapic.c+0 -40 replies
10/24KVM: x86: convert kvm_(set|get)_ioapic() into voidarch/x86/kvm/ioapic.c arch/x86/kvm/ioapic.h arch/x86/kvm/x86.c+6 -80 replies
11/24KVM: x86: don't take kvm->irq_lock when creating IRQCHIParch/x86/kvm/x86.c+0 -20 replies
12/24KVM: x86: push usage of slots_lock downarch/x86/kvm/i8259.c arch/x86/kvm/ioapic.c arch/x86/kvm/x86.c+4 -40 replies
13/24KVM: x86: KVM_IRQCHIP_PIC_MASTER only has 8 pinsarch/x86/kvm/irq_comm.c+6 -90 replies
14/24KVM: x86: remove all-vcpu request from kvm_ioapic_init()arch/x86/kvm/ioapic.c+0 -20 replies
15/24KVM: x86: directly call kvm_make_scan_ioapic_request() in ioapic.carch/x86/kvm/ioapic.c+2 -20 replies
16/24KVM: x86: rename kvm_vcpu_request_scan_ioapic()arch/x86/kvm/ioapic.c include/linux/kvm_host.h virt/kvm/eventfd.c+5 -50 replies
17/24KVM: x86: drop goto label in kvm_set_routing_entry()arch/x86/kvm/irq_comm.c+8 -120 replies
18/24KVM: x86: cleanup return handling in setup_routing_entry()virt/kvm/irqchip.c+5 -60 replies
19/24KVM: x86: simplify pic_unlock()arch/x86/kvm/i8259.c+4 -90 replies
20/24KVM: x86: make kvm_pic_reset() staticarch/x86/kvm/i8259.c arch/x86/kvm/irq.h+1 -30 replies
21/24KVM: x86: drop picdev_in_range()arch/x86/kvm/i8259.c+12 -230 replies
22/24KVM: x86: set data directly in picdev_read()arch/x86/kvm/i8259.c+3 -40 replies
23/24KVM: x86: simplify pic_ioport_read()arch/x86/kvm/i8259.c+3 -60 replies
24/24KVM: x86: use irqchip_kernel() to check for pic+ioapicarch/x86/kvm/irq_comm.c+1 -10 replies

Reviews trailers per patch

3 of 24 patches have a Reviewed-by or Acked-by.

PatchPeter XuRadim Krčmář
1/24R-b
2/24
3/24
4/24
5/24
6/24
7/24
8/24
9/24
10/24
11/24
12/24
13/24
14/24
15/24
16/24
17/24R-b
18/24
19/24R-b
20/24
21/24
22/24
23/24
24/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/24] pic/ioapic/irqchip cleanups + minor fixes

My attempt to further cleanup pic/ioapic checks using irqchip_mode + other cleanups in that area.

The goal is to only check against irqchip_mode and not to rely on vpic/vioapic variables anymore to test for existence of pic/ioapic. This will avoid any possible races when creating the kernel irqchip fails.

v2 -> v3:
- Added memory barriers as requested by Paolo to patch 2-4

David Hildenbrand (24):
KVM: x86: race between KVM_SET_GSI_ROUTING and KVM_CREATE_IRQCHIP
KVM: x86: new irqchip mode KVM_IRQCHIP_INIT_IN_PROGRESS
KVM: x86: check against irqchip_mode in kvm_set_routing_entry()
KVM: x86: check against irqchip_mode in pic_in_kernel()
KVM: x86: check against irqchip_mode in ioapic_in_kernel()
KVM: x86: get rid of pic_irqchip()
KVM: x86: get rid of ioapic_irqchip()
KVM: x86: use ioapic_in_kernel() to check for ioapic existence
KVM: x86: remove duplicate checks for ioapic
KVM: x86: convert kvm_(set|get)_ioapic() into void
KVM: x86: don't take kvm->irq_lock when creating IRQCHIP
KVM: x86: push usage of slots_lock down
KVM: x86: KVM_IRQCHIP_PIC_MASTER only has 8 pins
KVM: x86: remove all-vcpu request from kvm_ioapic_init()
KVM: x86: directly call kvm_make_scan_ioapic_request() in ioapic.c
KVM: x86: rename kvm_vcpu_request_scan_ioapic()
KVM: x86: drop goto label in kvm_set_routing_entry()
KVM: x86: cleanup return handling in setup_routing_entry()
KVM: x86: simplify pic_unlock()
KVM: x86: make kvm_pic_reset() static
KVM: x86: drop picdev_in_range()
KVM: x86: set data directly in picdev_read()
KVM: x86: simplify pic_ioport_read()
KVM: x86: use irqchip_kernel() to check for pic+ioapic

 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/i8259.c            | 72 ++++++++++++++++-------------------------
 arch/x86/kvm/ioapic.c           | 28 ++++++----------
 arch/x86/kvm/ioapic.h           | 16 ++++-----
 arch/x86/kvm/irq.c              |  2 +-
 arch/x86/kvm/irq.h              | 32 +++++++++---------
 arch/x86/kvm/irq_comm.c         | 45 ++++++++++++--------------
 arch/x86/kvm/x86.c              | 45 +++++++++++++-------------
 include/linux/kvm_host.h        |  4 +--
 virt/kvm/eventfd.c              |  4 +--
 virt/kvm/irqchip.c              | 11 +++----
 virt/kvm/kvm_main.c             |  3 ++
 12 files changed, 117 insertions(+), 146 deletions(-)
Signature · 1 line
2.9.3