[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 00/12] x86/intr: introduce EOI callbacks and fix vPT


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 20 Apr 2021 16:07:11 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JFnIPLZp4CjpVGUwuH9aTepqLh3vMemrkEdRAigo64s=; b=RXJSXdr2uwam5W1W3HLCXeYv55OgpS1E4b5DlhDtxM1xifz5DYuWyTGTO4jg3snC5EeFxKHAR3l65XejUX7VLCIgg/f56eHjzTjDlOZsjCLTjOCxb4b5NynHv1pt1MwPc22SuJaKuExipW2uIg536fj3nZhs7zarEsnSVs4jmUkKFFaFBzqEPFDsURWQF+jzb5pGBiycrRIT9FmCx3K4NFaQISvPmHbXHp98vtob5ab12vM1VR9hdI8KbR8cN8PdmbiHTdZvoIoNWkcSvzKA/3OQOFNsLIOk6YDwP7XzmnFN3Gcdce1JrUBc96YwF1DGB0dKOEwW1zWS/p9uAizy/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n14RFeUvxFSsSrphFcQzMx6gpW6tpStheCYzPvUCEFlOJIZ+o41qn3+ayXXmTHRVDgTlL5fjrRUTJKZYNbyZhOQHOKleW/e08mNCfC8bbFd7IKW9dWkyUD9KhMlY/MXG9w5dQvaEgPnc/BogwJlXKVJl1fcztVmUnxOF+18VBDuhvmL6qD/oBlXBfQ+p3OaUcoVj8ndwPymADsi4KS43lAiTnGxbbnUMQRk8alQA5xxYbcHNmUD6OZa1b5GLHK3J5dGXU8t9dm0+5vO02O3DneAykwSKudXpsZjB7ZoyC37SAQVTUWJawE0e3vbgS1cndHYSeSZUDUGBIIMdpKtZ3A==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 20 Apr 2021 14:08:58 +0000
  • Ironport-hdrordr: A9a23:/4pBxa6gP7QOfTZllwPXwRKBI+orLtY04lQ7vn1ZYQBJc8Ceis CllOka0xixszoKRHQ8g7m7VZWoa3Xa6JJz/M0tLa6vNTOW3VeAAaNDyc/ZwzPmEzDj7eI178 1dWoV3FdGYNzdHpOng5g3QKbgd6f2m1IztuuvE1XdqSmhRGsNdxiN0EBySHEEzZCQuP/oEPa GR7MZGuDasEE5/BqiGL0IIQvTZoJnznI/mCCRsOzcc9AKMgTm0gYSKcCSw4xF2aVJy6IZny0 fpuUjT5qKvs/a0oyWsrVP73tBtt/bKjvdGDMyIoMAJJjvrkRbAXvUdZ5Sy+AobjcvqxFE2kM TdgxpIBbUO11rhOlubjDGo+w783C0g43XvoGXo/kfLkIjCax8RT+9i7LgpFifx2g4bk/xXlJ 9v5Sa/saFaCBvR9R6Nn+TgZlVRuWef5UY5nfV7tQ05baIuLIV/gKY4501vHJIJDEvBmfsaOd grNs3a6fpMGGnqCUzxjy1qyNyoaHw5Ag2LdEgEotCUyDhbhhlCvjIl+PA=
  • Ironport-sdr: K2T9K8F8cEa6HWoi6mCjj3UGvwMpPSZr/0Qp96odeh1MbcL3VifGlwZI3bB9O9y0lvV7/04uVl epFV7aO0X8RBd+XK8MyUJOao4FN8g/10j8VapIaYXhXz1CtmcbcknbyQLNsM1CrMxLXfGtW/OR MW4ZBIX9jClyg6N3FQN+nPO4JY/45xLcH1aWKvDInZr4OAodgh/MpII93NKXoNT85igetrhmO3 KGdTA/LFSLVgHcF9hkdiXNkIJiDo7Km6GC6Vv97VcvoAYzlUQDykUGl2VTWs9804ib3BjaBMAo nhE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hello,

The following series introduces EOI callbacks and switches a number of
subsystems to use them. The first one is vmsi and dpci, which are quite
straight forward to switch since they used to open code hooks in the EOI
handlers.

Finally HVM virtual timers are also switched to a different model where
EOI callbacks are used instead of checking at every return to guest
whether a timer interrupt is being injected. Note that such change also
fixes a bug in virtual periodic timers that prevented injecting to a vCPU
different than the one where the timer is assigned (and that would
currently match the i8259 target).

Those changes are paired together so that practical applications of
having EOI callbacks can be seen in action.

Note that further cleanup can be done, but I think the series is already
big enough and provides a clear benefit.

A couple of notes from the testing performed:
 - PVH dom0.
 - Windows guest, limited to 2% capacity to test delay for missed ticks
   mode - time is consistent in the guest.
 - Windows guest migration.
 - PCI passthrough to a guest.

Thanks, Roger.

Roger Pau Monne (12):
  x86/rtc: drop code related to strict mode
  x86/vlapic: introduce an EOI callback mechanism
  x86/vmsi: use the newly introduced EOI callbacks
  x86/vioapic: switch to use the EOI callback mechanism
  x86/hvm: allowing registering EOI callbacks for GSIs
  x86/dpci: move code
  x86/dpci: switch to use a GSI EOI callback
  x86/vpt: switch interrupt injection model
  x86/irq: remove unused parameter from hvm_isa_irq_assert
  x86/irq: drop return value from hvm_ioapic_assert
  x86/vpt: remove vPT timers per-vCPU lists
  x86/vpt: introduce a per-vPT lock

 xen/arch/x86/domain.c             |   4 +-
 xen/arch/x86/emul-i8254.c         |   1 +
 xen/arch/x86/hvm/dm.c             |   2 +-
 xen/arch/x86/hvm/hpet.c           |   8 +-
 xen/arch/x86/hvm/hvm.c            |  23 +-
 xen/arch/x86/hvm/irq.c            |  93 +++++-
 xen/arch/x86/hvm/pmtimer.c        |   2 +-
 xen/arch/x86/hvm/rtc.c            |  30 +-
 xen/arch/x86/hvm/svm/intr.c       |   3 -
 xen/arch/x86/hvm/vioapic.c        | 144 ++++++---
 xen/arch/x86/hvm/vlapic.c         |  72 ++++-
 xen/arch/x86/hvm/vmsi.c           |  35 +-
 xen/arch/x86/hvm/vmx/intr.c       |  59 ----
 xen/arch/x86/hvm/vpic.c           |   8 +-
 xen/arch/x86/hvm/vpt.c            | 514 +++++++++---------------------
 xen/drivers/passthrough/x86/hvm.c | 223 ++++++++-----
 xen/include/asm-x86/hvm/io.h      |   3 +-
 xen/include/asm-x86/hvm/irq.h     |  28 +-
 xen/include/asm-x86/hvm/vcpu.h    |   4 -
 xen/include/asm-x86/hvm/vlapic.h  |  19 +-
 xen/include/asm-x86/hvm/vpt.h     |  32 +-
 21 files changed, 630 insertions(+), 677 deletions(-)

-- 
2.30.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.