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

[PATCH] x86/Viridian: don't mark IRQ vectors as pending when vLAPIC is disabled


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Nov 2022 13:13:57 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tfkW11X9pDByfM7tL7/0F2TK04AeoKyeauuXX07eoQI=; b=JAh37n2ZUEHxokUli2eKfVW1aaKUsv4rLIh8Z7bvk5lQUO6ynblszCOA4mm/bdlXGSW95CBUCI5V2D5/ZueomBpkz+0OoAlbxDYGtZ2oHxCQAoHk0Q5xGe1dGKalpI1Ilf96HW49+d6tGl1e9dTzrLoOsMZD2Y95OpbbbNdq5OmV9SuH4GNdl7NBvlfPH7IhMxmrw4twYzBZNkxzR6Wd5EFf7GKWGIPhhPbSdeYcNF2rmpgcK4UR0z+KeBRVPcw3kzcyJF3EQHjqkYPPLfbS8rP6nozKFUbGFhklYD4F/9hIo8nN2mya4UVW9oMcpFJbbHdG9DyQ3q7E0xiCZgwjBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MUWmWmKnV+iBVAwjZMHG1XqSqRRB+qdBbn7pKSUs/SBOsmkV5GwXPF/v6nnEFksxQGMAhIHvvjcjYKJNMQiZqSJA3XYRZOlDUZ632sM/gxgVnzZx4Dv7v8jW7nvo/qHx68d3Ow+dVL87yt1vmdsrzVKIu8xsXO63/wVRb7kdcbbcnB4gBMF3QXM0xsGYaJ1FBR5IN2hBFlMwuv8ZkCp70wmV0/UygPi4ZeL6DGNw/y6Ldz8Cz8mDk0Nmc2MO7sXMqN14gEQHP7ztkjsqxKmSw0ZCN+6m+UTJUFovtAd3zam/L+4bK9n2MsWIKrkbm7Oekoa4av0KUIRqCNahPB7ljA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Paul Durrant <paul@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 21 Nov 2022 12:14:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

In software-disabled state an LAPIC does not accept any interrupt
requests and hence no IRR bit would newly become set while in this
state. As a result it is also wrong for us to mark Viridian IPI or timer
vectors as having a pending request when the vLAPIC is in this state.
Such interrupts are simply lost.

Introduce a local variable in send_ipi() to help readability.

Fixes: fda96b7382ea ("viridian: add implementation of the 
HvSendSyntheticClusterIpi hypercall")
Fixes: 26fba3c85571 ("viridian: add implementation of synthetic timers")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -359,7 +359,7 @@ bool viridian_synic_deliver_timer_msg(st
     BUILD_BUG_ON(sizeof(payload) > sizeof(msg->u.payload));
     memcpy(msg->u.payload, &payload, sizeof(payload));
 
-    if ( !vs->masked )
+    if ( !vs->masked && vlapic_enabled(vcpu_vlapic(v)) )
         vlapic_set_irq(vcpu_vlapic(v), vs->vector, 0);
 
     return true;
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -811,7 +811,12 @@ static void send_ipi(struct hypercall_vp
         cpu_raise_softirq_batch_begin();
 
     for_each_vp ( vpmask, vp )
-        vlapic_set_irq(vcpu_vlapic(currd->vcpu[vp]), vector, 0);
+    {
+        struct vlapic *vlapic = vcpu_vlapic(currd->vcpu[vp]);
+
+        if ( vlapic_enabled(vlapic) )
+            vlapic_set_irq(vlapic, vector, 0);
+    }
 
     if ( nr > 1 )
         cpu_raise_softirq_batch_finish();



 


Rackspace

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