From nobody Fri Apr 19 10:10:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1652282147; cv=none; d=zohomail.com; s=zohoarc; b=UO3JOEiGUtYHQducHSnWLMSdNhEHOGvGeiM3fWQnnX7myRiVaUXbYwiBI36AASvVjWLZUTQdJMNsRJkoLDNQWR6sJR5rC+GDrbzw/xuj6mNQku5HqsBdPUOa5w8sqROCSgsCagc9XIYwdk+0nVFx1R7ysZVjfQwtgcQxA/IdbSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652282147; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=3AilD0HoD88muXIlHo/rSbFEB1FVURD6nu5T1pqEBTU=; b=lqoZU3xRE/tVotLKfUkk+q6fw8xAILGKrBu0PwXPiiw079qhnMyOOGp05ZQxlUCwuSFeEeg7r1NYpDs9Di7KaqAaD4uAJ5Ou3bGity7W/7gLKUp/pN/NJiNIP2SfcTnpdJcRKbAE1LJVZkuqq3KiDqVIw5es41c/A68iuPZRxwg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1652282147354777.3418667513456; Wed, 11 May 2022 08:15:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.327037.549737 (Exim 4.92) (envelope-from ) id 1noo3U-0006Gw-Bi; Wed, 11 May 2022 15:15:12 +0000 Received: by outflank-mailman (output) from mailman id 327037.549737; Wed, 11 May 2022 15:15:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1noo3U-0006Gp-8G; Wed, 11 May 2022 15:15:12 +0000 Received: by outflank-mailman (input) for mailman id 327037; Wed, 11 May 2022 15:15:11 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1noo3S-0006Gj-Sv for xen-devel@lists.xenproject.org; Wed, 11 May 2022 15:15:11 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 23198c7b-d13d-11ec-8fc4-03012f2f19d4; Wed, 11 May 2022 17:15:07 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 23198c7b-d13d-11ec-8fc4-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1652282107; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0+WTyQ6WE3kGVK9uh25l57/PyAwZp1z/qpa8H5lsp7g=; b=MUsqOP445j2nY+4cL5nIvIlX1+Sxyq/QiQ6/x1ya1aeVUN+yNgb7JTDO 7WcwMH6AutlR5PTycNR1JSxvh5BR+JrvvVW7ckXGeFCaj2/zgw5qV3hk3 iROxTU08dYVWNASDHPyLw6tB8a7Roxte8byMnnKv+NETDxEgmiHacXo8l o=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 70950634 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:IkzVhq9Klyy2KtsOEEhjDrUD6H6TJUtcMsCJ2f8bNWPcYEJGY0x3n WcXUGqBa/eDNDOhLdsiOYiz804GvZOHy4NgSlE5/ng8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ44f5fs7Rh2NQw3IHgW1nlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnbCVVzgvOo/vpNQ+CAJRSTEmM4kfx6CSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFKEWvHwm6DjdBPIvR53rSKTW/95Imjw3g6iiGN6BP 5tEMWQ0MHwsZTVFMX0mKKt9x93vi0nuSDEHqAqsgK0etj27IAtZj+G2bYu9lsaxbdpRtlaVo CTB5WuRKhMQOcGbyDGF2mmxneKJliT+MKoCGbv9+vN0jVm7wm0IFAZQRVa9ueO+iEO1R5RYM UN8x8Y1hfFsrgrxFIC7BkDm5i7f1vIBZzZOO8Ef9j6Lzoj33za6XXMNFC4ZZvh/i9BjEFTGy WS1t9/uADVutpicRnSc6qqYoFuOBMQFEYMRTXRaFFVYurEPtKl210uSFYg7TMZZm/WvQVnNL ya2QD/Sbln5peoCzO2F8F/OmFpATbCZH1dutm07so9Ihz6VhbJJhaT1sTA3Dt4ade51q2VtW 1BewqCjABgmV83lqcB0aLxl8EuVz/iEKibAplVkAoMs8T+gk1b6I90KumkhehozbpxeEdMMX KM0kVkKjKK/wVPwNfMnC25PI5pCIVfc+STNCamPM4smjmlZfw6b5iB+DXN8LEi2+HXAZZoXY M/BGe71VC5yIf0+kFKeGrZGuZd2l39W+I8mbc2ip/hR+eHGNCD9pHZsGAbmU93VG4ve/lqPr 4YEZ5viJtc2eLSWXxQ7OLU7dTgiRUXXz7ivwyCLXoZv+jZbJVw= IronPort-HdrOrdr: A9a23:xedE6a238L0FqAJM3/cZcwqjBL4kLtp133Aq2lEZdPRUGvb3qy nIpoV96faUskd0ZJhOo7C90cW7LU80lqQFhLX5X43SPzUO0VHAROoJgLcKqweQfREWndQ96U 4PScdD4aXLfDpHsfo= X-IronPort-AV: E=Sophos;i="5.91,217,1647316800"; d="scan'208";a="70950634" From: Jane Malalane To: Xen-devel CC: Jane Malalane , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH] x86/hvm: Widen condition for is_hvm_pv_evtchn_vcpu() Date: Wed, 11 May 2022 16:14:23 +0100 Message-ID: <20220511151423.20241-1-jane.malalane@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1652282148704100001 Have is_hvm_pv_evtchn_vcpu() return true for vector callbacks for evtchn delivery set up on a per-vCPU basis via HVMOP_set_evtchn_upcall_vector. is_hvm_pv_evtchn_vcpu() returning true is a condition for setting up physical IRQ to event channel mappings. Signed-off-by: Jane Malalane --- CC: Jan Beulich CC: Andrew Cooper CC: "Roger Pau Monn=C3=A9" CC: Wei Liu --- xen/arch/x86/include/asm/domain.h | 8 +++++++- xen/arch/x86/traps.c | 3 +++ xen/include/public/arch-x86/cpuid.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/d= omain.h index 35898d725f..f044e0a492 100644 --- a/xen/arch/x86/include/asm/domain.h +++ b/xen/arch/x86/include/asm/domain.h @@ -14,8 +14,14 @@ =20 #define has_32bit_shinfo(d) ((d)->arch.has_32bit_shinfo) =20 +/* + * Set to true if either the global vector-type callback or per-vCPU + * LAPIC vectors are used. Assume all vCPUs will use + * HVMOP_set_evtchn_upcall_vector as long as the initial vCPU does. + */ #define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \ - (d)->arch.hvm.irq->callback_via_type =3D=3D HVMIRQ_callback_vector) + ((d)->arch.hvm.irq->callback_via_type =3D=3D HVMIRQ_callback_vecto= r || \ + (d)->vcpu[0]->arch.hvm.evtchn_upcall_vector)) #define is_hvm_pv_evtchn_vcpu(v) (is_hvm_pv_evtchn_domain(v->domain)) #define is_domain_direct_mapped(d) ((void)(d), 0) =20 diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 25bffe47d7..2c51faab2c 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1152,6 +1152,9 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, ui= nt32_t leaf, res->a |=3D XEN_HVM_CPUID_DOMID_PRESENT; res->c =3D d->domain_id; =20 + /* Per-vCPU event channel upcalls are implemented. */ + res->a |=3D XEN_HVM_CPUID_UPCALL_VECTOR; + break; =20 case 5: /* PV-specific parameters */ diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-= x86/cpuid.h index f2b2b3632c..1760e2c405 100644 --- a/xen/include/public/arch-x86/cpuid.h +++ b/xen/include/public/arch-x86/cpuid.h @@ -109,6 +109,8 @@ * field from 8 to 15 bits, allowing to target APIC IDs up 32768. */ #define XEN_HVM_CPUID_EXT_DEST_ID (1u << 5) +/* Per-vCPU event channel upcalls. */ +#define XEN_HVM_CPUID_UPCALL_VECTOR (1u << 6) =20 /* * Leaf 6 (0x40000x05) --=20 2.11.0