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

[PATCH 1/3] xen/vioapic: add support for the extended destination ID field


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 20 Jan 2022 16:23:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/dvTLYhjmAw3K+JdKd8oL5ONXrixpcBGkdbNVDU5IWY=; b=G+qDYhx2sR69CCmyHuDenOx4UEtx6K7WxYiup0H2cqH2sF6UIS7SfKCuc2RjW7xDhuBLXzGQDlU704ZQhLqEqeTzwiz7U6VcUzhx4Cjd0MmcredyGPfkVi++/urHYJSYIZ/dsTn5pYUr0Fw09U3k3EcVLiX9X7CxeFCmlln3kvx/90xKeyqrY37PywPGikfZSz/DhC6G918e5m1IoL8U0Ira0Vhg1IDujeZW7uArOGhuyeN2tXbtHDdr/C5IzB4aq2Pkh6zFU3WRL/BIhU2M1XbloM2VywcRzYUvHaV+V3nZDWSUInI97S2YjZbNV98J6HWpb5eVmYGkj/nmUQQ0tg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZK9nOco/EilnsHlZ055r9UYH/ckG0bR/a7JcIKinyLXSZYCDKYH4A10x/XSdmpkRPlfghbloRaKVeKLH9xXKzfjSRmHHNnFA5Ddo9F1Rn/1soJ1tuSsiuZj7g59SEPpTUHp1ZQeTuXkwallVwigSB55bsDHa3ZHd/Z/B+0LjnhtWtFj8GZ+B54ydnsLAcFax8jtbIW1b7GNa+A0iHrR0kLp68uS0KSid1fNi45+waeo3P5OmFiynbGxy60qSyJYs8mM/XO5wixha0CJieBnFSnCBKCw931ITCYIyEONfq3q0ocFpN5uG7q6JS4wK16+qp4j6JEqG+Yv1OjBu0l450w==
  • Authentication-results: esa3.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>
  • Delivery-date: Thu, 20 Jan 2022 15:24:40 +0000
  • Ironport-data: A9a23:vYHpMao+aVcVkXexPOaUgY2efjxeBmL5YhIvgKrLsJaIsI4StFCzt garIBmEP6yCZmr9e95+aIjg/EIEuZOAxtZjGwJlqiswFiMapJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlZT4vE2xbuKU5NTsY0idfic5Dndx4f5fs7Rh2NQw2ILhW1nlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnaezRS0GF/T8o8ImcEgbPT0lOY4e3rCSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFJkYtXx6iynQEN4tQIzZQrWM7thdtNs1rp4UQa6PP JNDAdZpRD7lehtFJnwyNKovge2r3VL7ajdVpk3A8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru/W70HxUbP9y30iee/zSngeqntTP2XsceGaO18tZugUaP3SoDBRsOT1y5rPKlzEmkVLpix 1c8o3R06/JorQryE4e7D0bQTGO4UgA0YNlcOcITsTG27JH3skW3GjMAbWZnZ4lz3CMpfgAC2 liMltLvIDVgtryJVH6QnoupQSOO1Ts9djFbO3JdJecRy5y6+dxo0EqTJjp2OP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OEQbqBJa6 Z0q/A37AaISDAyVICWF3MFV+/Mq5nik4/nWwcPA1oC5BOVhT2lxbbmG1zAty1uHg9n8PMHyy zoggb57qKsv7WSzQLd7Xba69BzlMH6wtVOKcSQgow+KynqiCyveIN9Mofy9gwdkaWK0hIHgd PMqxAvM4Ba7G7QRHi8pV/X1wzpwF8Vmgnf4G7dpUGmjd3yRTo8BcYEr5leaAHl500pu8w5+L 5X3kqC3qAnQy/orWDY3ZzlRhtqnk27rT4JiugIlUFSVoMYdft4sZEfxkVIC50NdRiKp7zPKN MeTP002cwmMm9zNxvizytSKZ2XLzgO9y69Mwk/Upf/6UkSoJh7p3Fos/D30E1wsK7VcKM0lN gsBJ4Y4I2mfvVmHZ6VO91xM/dfcla9OS4kEFjiaGgPR5t3c04klfbMkcAIDaeRCds18Kc=
  • Ironport-sdr: VG2yeJKpVZABsNV9wVachVRT8Z0y2CdCerJHEI39cBDaZwJLrXAew0sEJOmP+J3hGdwAqHxRop TzbNpHsXs1Kgc9dKKt4ciswtN4huoOLCxKtgEWuB1alDtnndS4/kkhbtAfjFp4O266DnBaqQ8H tQFfWSv8I/PcMNCMxGZbUfHbEPXcTbT8U+pis1D4Z0eNIehYtfNGIogF2YA8txpvqB0M1SrfJt t+m9baKw1gC/vt9Q/p0iymRV76tUD+G3LGBambvLRN+W1ZkzHpdobnqaCLMnfV7pBmridQ9GDK g9vDGzCTNR6DoZavo98M0O3T
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Such field uses bits 55:48, but for the purposes the register will be
used use bits 55:49 instead. Bit 48 is used to signal an RTE entry is
in remappable format which is not supported by the vIO-APIC.

Use the extended destination ID to store the high bits from the
destination ID, thus expanding the size of the destination ID field to
15 bits, allowing an IO-APIC to target APIC IDs up to 32768.

Note this is already supported by QEMU/KVM and HyperV.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vioapic.c             | 3 ++-
 xen/include/public/arch-x86/hvm/save.h | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index 553c0f76ef..1f2305c232 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -412,7 +412,8 @@ static void ioapic_inj_irq(
 
 static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
 {
-    uint16_t dest = vioapic->redirtbl[pin].fields.dest_id;
+    uint16_t dest = vioapic->redirtbl[pin].fields.dest_id |
+                    (vioapic->redirtbl[pin].fields.ext_dest_id << 8);
     uint8_t dest_mode = vioapic->redirtbl[pin].fields.dest_mode;
     uint8_t delivery_mode = vioapic->redirtbl[pin].fields.delivery_mode;
     uint8_t vector = vioapic->redirtbl[pin].fields.vector;
diff --git a/xen/include/public/arch-x86/hvm/save.h 
b/xen/include/public/arch-x86/hvm/save.h
index 773a380bc2..14a5d94588 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -376,7 +376,9 @@ union vioapic_redir_entry
         uint8_t trig_mode:1;
         uint8_t mask:1;
         uint8_t reserve:7;
-        uint8_t reserved[4];
+        uint8_t reserved[3];
+        uint8_t :1;
+        uint8_t ext_dest_id:7;
         uint8_t dest_id;
     } fields;
 };
-- 
2.34.1




 


Rackspace

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