Skip to content

RFC decouple vcpu index from apic id

Gleb Natapov kvm 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 posting 2/24 patches 1 replyApplied
  2. v3 RFC Latest4 patches 2 repliesIn review
  3. v2 RFC posting 1/24 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC3 patches6 repliesSuperseded

Changes in v3 from the cover letter

New ioctl is added to specify vcpu_id of bsp vcpu. To maintain backwards compatibility by default vcpu_id == 0 is bsp.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Introduce kvm_vcpu_is_bsp() function.arch/ia64/kvm/kvm-ia64.c arch/ia64/kvm/vcpu.c arch/x86/kvm/i8254.c +8 more+28 -180 replies
2/4Use pointer to vcpu instead of vcpu_id in timer code.arch/x86/kvm/i8254.c arch/x86/kvm/kvm_timer.h arch/x86/kvm/lapic.c +1 more+4 -40 replies
3/4Break dependency between vcpu index in vcpus array and vcpu_id.include/linux/kvm.h include/linux/kvm_host.h virt/kvm/kvm_main.c+33 -212 replies
4/4Use macro to iterate over vcpus.arch/ia64/kvm/kvm-ia64.c arch/powerpc/kvm/powerpc.c arch/s390/kvm/kvm-s390.c +6 more+77 -790 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH RFC v3 0/4] decouple vcpu index from apic id

Currently vcpu_id is used as an index into vcpus array and as apic id on x86. This is incorrect since apic ids not have to be continuous (they can also encode cpu hierarchy information) and may have values bigger then vcpu array in case of x2apic. This series removes use of vcpu_id as vcpus array index. Each architecture may use it how it sees fit. x86 uses it as apic id.

v2:
In this version vcpus[] is managed by generic code.

v3:
New ioctl is added to specify vcpu_id of bsp vcpu. To maintain backwards compatibility by default vcpu_id == 0 is bsp.

Gleb Natapov (4):
Introduce kvm_vcpu_is_bsp() function.
Use pointer to vcpu instead of vcpu_id in timer code. Break dependency between vcpu index in vcpus array and vcpu_id. Use macro to iterate over vcpus.

 arch/ia64/kvm/kvm-ia64.c   |   35 ++++++++++--------------
 arch/ia64/kvm/vcpu.c       |    2 +-
 arch/powerpc/kvm/powerpc.c |   16 +++++++----
 arch/s390/kvm/kvm-s390.c   |   33 +++++++++++------------
 arch/x86/kvm/i8254.c       |   13 +++-----
 arch/x86/kvm/i8259.c       |    6 ++--
 arch/x86/kvm/kvm_timer.h   |    2 +-
 arch/x86/kvm/lapic.c       |    9 +++---
 arch/x86/kvm/mmu.c         |    6 ++--
 arch/x86/kvm/svm.c         |    4 +-
 arch/x86/kvm/timer.c       |    2 +-
 arch/x86/kvm/vmx.c         |    6 ++--
 arch/x86/kvm/x86.c         |   29 ++++++++++----------
 include/linux/kvm.h        |    2 +
 include/linux/kvm_host.h   |   18 ++++++++++++
 virt/kvm/ioapic.c          |    4 ++-
 virt/kvm/irq_comm.c        |    6 +---
 virt/kvm/kvm_main.c        |   63 +++++++++++++++++++++++--------------------
 18 files changed, 138 insertions(+), 118 deletions(-)