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

[PATCH v1 18/28] x86/hvm: add facility to print hardware-assisted vLAPIC info


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Wed, 4 Nov 2026 17:33:35 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7Ofeq2WpHsK3IHZPkWuWlAntiWL+LEDmFt6Pi7PGeq0=; b=RnXuFwjODABjiiC8QuDgrGvaFg/v1y1Y+KwDgGU6Kx6WNCO/qtOPjyf2Pt/Hbg495MK7kgh5v5NQxvGpsZKdlV+FhnUzfeEiSc/xSQR+xv4zowrhZItTBvwT7AXTG+ZmOLpHQ6ETIj6sMubsTNZDjz8/crj8JFlDma+7Df+mcoOL0yt8N85ChKFzil/12Y+135XlW+GvG3FAHiWN5q1p0b3NgtVXxR0CCoGEK1QOkobIx2AxYtrYpn/9rHYe53vUCrPJgViloQaV4SaZslFKJBYKDcFKMGLsjwfHpjCkyNJLm50Gq3SZ5ATTJMHItHwHnc+gC/7IxyTOL3w2huX9zQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uraGYyNY/CYa11E3KRHm4r1ZjdmQxK8xgG0mwAnO2O2cbugLozabF4YM1Z4EVyeV3QNbGJ0KsSUpJ8eGlKMFQq7BbgNaY5xtt2LEF/zKOI2AluOhu4H3D51P2czXi4VfoUIhDYZuV7/0HZhtv8DCM8SW2oUvHQ7r51R5JFPQK+ciEmknaXafOTGX1txYOKNbqu6k98uotEVWv0ed6rpIbHEgxog1whaj1lKsWTiTjgBpJBci8I6Zl0bllnv84xULfKryGxcYfm0WrgSAEjmVizOtYOhnDPr5vaLA19ENeMoNCb13O4JhMA1yCpOokSybqeFVgYou6TfEN+/USoor0g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: andrew.cooper3@xxxxxxxxxx, jason.andryuk@xxxxxxx, jbeulich@xxxxxxxx, roger@xxxxxxxxxxxxxx, teddy.astie@xxxxxxxxxx, dmukhin@xxxxxxx, Denis Mukhin <dmukhin@xxxxxxxx>
  • Delivery-date: Thu, 05 Nov 2026 01:35:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx>

Introduce new method 'dump_posted_intr' in 'hvm_function_table' to enable
hardware-assisted vLAPIC printouts (e.g. performance counters).

Update 'interrupt bindings' keyhandler with a call to the newly introduced
hvm_dump_posted_intr().

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
 xen/arch/x86/include/asm/hvm/hvm.h | 12 ++++++++++++
 xen/arch/x86/irq.c                 | 24 ++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/xen/arch/x86/include/asm/hvm/hvm.h 
b/xen/arch/x86/include/asm/hvm/hvm.h
index 9bf2064925fa..1f0f7749b579 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -217,6 +217,7 @@ struct hvm_function_table {
     void (*update_eoi_exit_bitmap)(struct vcpu *v, uint8_t vector, bool set);
     void (*process_isr)(int isr, struct vcpu *v);
     void (*deliver_posted_intr)(struct vcpu *v, u8 vector);
+    void (*dump_posted_intr)(const struct vcpu *v);
     void (*sync_pir_to_irr)(struct vcpu *v);
     bool (*test_pir)(const struct vcpu *v, uint8_t vector);
     void (*handle_eoi)(uint8_t vector, int isr);
@@ -851,6 +852,12 @@ static inline void hvm_sync_pir_to_irr(struct vcpu *v)
         alternative_vcall(hvm_funcs.sync_pir_to_irr, v);
 }
 
+static inline void hvm_dump_posted_intr(const struct vcpu *v)
+{
+    if ( hvm_funcs.dump_posted_intr )
+        alternative_vcall(hvm_funcs.dump_posted_intr, v);
+}
+
 #else  /* CONFIG_HVM */
 
 #define hvm_enabled false
@@ -958,6 +965,11 @@ static inline void hvm_set_reg(struct vcpu *v, unsigned 
int reg, uint64_t val)
     ASSERT_UNREACHABLE();
 }
 
+static inline void hvm_dump_posted_intr(const struct vcpu *v)
+{
+    ASSERT_UNREACHABLE();
+}
+
 #define is_viridian_domain(d) ((void)(d), false)
 #define is_viridian_vcpu(v) ((void)(v), false)
 #define has_viridian_time_ref_count(d) ((void)(d), false)
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 32a75f77a46d..de79e36fdfe7 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2527,6 +2527,28 @@ void free_domain_pirqs(struct domain *d)
     pcidevs_unlock();
 }
 
+static void dump_posted_intr_info(void)
+{
+    struct domain *d;
+    struct vcpu *v;
+
+    rcu_read_lock(&domlist_read_lock);
+
+    printk("****** Posted Interrupts Statistics ******\n");
+
+    for_each_domain ( d )
+    {
+        printk("\n>>> Domain %d <<<\n", d->domain_id);
+
+        for_each_vcpu ( d, v )
+            hvm_dump_posted_intr(v);
+    }
+
+    printk("******************************************\n");
+
+    rcu_read_unlock(&domlist_read_lock);
+}
+
 static void cf_check dump_irqs(unsigned char key)
 {
     int i, irq, pirq;
@@ -2605,6 +2627,8 @@ static void cf_check dump_irqs(unsigned char key)
             printk("   %#02x -> %ps()\n", i, direct_apic_vector[i]);
 
     dump_ioapic_irq_info();
+
+    dump_posted_intr_info();
 }
 
 static int __init cf_check setup_dump_irqs(void)
-- 
2.55.0




 


Rackspace

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