Message ID | 20220303103057.49181-3-roger.pau@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <xen-devel-bounces@lists.xenproject.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FE4BC433F5 for <xen-devel@archiver.kernel.org>; Thu, 3 Mar 2022 10:31:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.282991.481884 (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nPik5-0003DX-Iy; Thu, 03 Mar 2022 10:31:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 282991.481884; Thu, 03 Mar 2022 10:31:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <xen-devel-bounces@lists.xenproject.org>) id 1nPik5-0003DN-FB; Thu, 03 Mar 2022 10:31:29 +0000 Received: by outflank-mailman (input) for mailman id 282991; Thu, 03 Mar 2022 10:31:28 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from <SRS0=PW1S=TO=citrix.com=prvs=05474af58=roger.pau@srs-se1.protection.inumbo.net>) id 1nPik4-0003Bk-5l for xen-devel@lists.xenproject.org; Thu, 03 Mar 2022 10:31:28 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1369bc8e-9add-11ec-8eba-a37418f5ba1a; Thu, 03 Mar 2022 11:31:26 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion <xen-devel.lists.xenproject.org> List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xenproject.org> List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help> List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe> Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org> X-Inumbo-ID: 1369bc8e-9add-11ec-8eba-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646303486; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=zp/O3+irhFt1NPeqnpO+/nDma/XFODeRS5LZWsgogwI=; b=HM9jUQzVP7L6Wt1X81H1TQk5pZWMRS5JvW9g+WzAosnFnQTiNa/2ZArq EqTr2FmIBsHdhIpLtuyer4lDDtXlCgKJK1cyRorq8Kf6Zuy26gY0Ky14T pGBUAanfEtmGcQPT+NPw1yltYrC6rKSmH6R3iFX1FOaBA4bNWdM6xTi3G w=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 65783134 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:RCtgeKh7FPKeN0SRFq/KbIEaX161dhAKZh0ujC45NGQN5FlHY01je htvWDqDOqreNmqmc9l3b43j8UMG7J7Xnd4ySgRqrS1mFy4b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M78wIFqtQw24LhWFvW4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tD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XxZ2IK8PoT4mODYqodKA/sytHWuQ/cpU0dMz2Dc8tbnmBE4p7wKDwMeOFBb6BJcq a01458iBeLX28YVci/DmltZZm4mzWa/KiWGCLvHnQcmXGzsQ8= X-IronPort-AV: E=Sophos;i="5.90,151,1643691600"; d="scan'208";a="65783134" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAzU1OLGrGbU02r+zkbGSmgmkO4IaPOqTm48b7ignoYZ9WUSbW4JtPbdNohyil3/Ca4scEL4c+R+WbRAU2/IOKKHTgckn1tlVccjuBgkuJUou9OJfCpgTuy0ywa0xHO10Cy0nq0UtGNvW2q4cCN28iyTnfB5h/ns81oEVrf8N5DxGCPzaranhOZGMDfZfLzwJkpyRRv+DZjJyLKiRwUswltwNvnvqWh2m1Yxpo9WFe+DkiGUefBvhEeBBVy1wVTufzBpVQEQPnX0ELf7hPvRfYw2SF7Lf3Enav+TPpaTi5WTdurk3dvTZviNjxHzdByMNuL6dk6c23kTemz87JitSw== 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=v3ryk5q8FKUxx6AOhcSeGFHahYVASbk58h3VZK2SFNM=; b=Rv2PMRcXhfviph68PBY0QfD9VhCyIsA8v+xlwnazRpw1+9ZTXPO9ObGdSCGeyF0TO5WEic7BgqxXYNb8X/EByQxe4UMXP2wW6+Idq4UJ1BgHeD/+/RHbJcsSA3B6TX1S4Dguq7rZlvz5Oen/JAc0FimyWq2gLP5Fgbp8w1mjqWKTwQ//c63cL/YZ0/FPIGUjThk5Y69pswBTperEeL8FrGW2e3+qROWp7/KIEdnvZprTDG55I6gBxJAkATYgEcu1hDNrsJljczLuFe/MbFUQZJ9CtXPLcI0wf5BeSNu+BfsZdAc+oBxMJH9UJNHa+wXApY4J42FW3PQ6+DZhuVLymg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v3ryk5q8FKUxx6AOhcSeGFHahYVASbk58h3VZK2SFNM=; b=HcFahv03F3OQhK7/7B9fk2QHciWsx2lCojHIJIx4Dv9OB/erMfuSUJLF2PdOH70msHGY/Rn3XYR6hYaVGPIlJnvhRnrlS/H+yagmNcWqiXGelpidpDvL7sPyiuLGzbt81xfDOTe76Tjn40LeIZ2C29+ah1NuyoGUSdSunzM/F/w= From: Roger Pau Monne <roger.pau@citrix.com> To: <xen-devel@lists.xenproject.org> CC: Roger Pau Monne <roger.pau@citrix.com>, Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org> Subject: [PATCH 2/3] hvm/irq: tighten check in hvm_domain_use_pirq Date: Thu, 3 Mar 2022 11:30:56 +0100 Message-ID: <20220303103057.49181-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220303103057.49181-1-roger.pau@citrix.com> References: <20220303103057.49181-1-roger.pau@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0186.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::30) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d902a93-6ceb-4873-254e-08d9fd00f54c X-MS-TrafficTypeDiagnostic: SN6PR03MB4464:EE_ X-Microsoft-Antispam-PRVS: <SN6PR03MB4464C02A2E278AFF5C8946748F049@SN6PR03MB4464.namprd03.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0xocbL/xjY/nhk6kA7lKa434DJyTRbC/lFj6NtumvLVYaER8L8fd/DmDt+kcMYafJYhaVUMQIIf3IVQHvbHXw/VKZCbLvltCRUWWsE/WCvMt/WZJnehEoz2Iyhrsc0VJvtylkuds9SOcdj92qXvwAQ5+8ZlhWeRk65DgVelMqkPJW3qBF5Thvdjdm37uohVYr+qP3TFNtcM/v3XCr5GRLS/7Wo4rgKh4hRgvJmROdeqhlQpEH7HV9YT9LvNOH5CkLS3U26GYQMhgNa0O8TcQk4nS4T0FFrq37BjxRNXB6terqIUWH/09RdT1jlDXQeOnsCm/+40krTdacpJnL2MlgLd5piZuz5lmNKbJ5UcHFIQkHBntx0RPVlMWQmr6tUKGKbRbsgWVsUZNMB58cCn9hYNXJw4HmSTtJ8VvXhjDcx1rLnNhuu4vuol9vhvIJbZ6ST1QvejB4JIQ+3jZyIOOF/eiXfpT+u8YX+hVWSUVhHX+JxbtzCaRzCwZoyZnbcNd8lbxAsJtjW/8TFqGQtMktQr7Q4N6i1Un1HpywKMQhDh+u7BPD5iTYMSDpWfXQXjawJTyhufeyy4/Xaj1rgqZVeJlL5dS99opUFrt1WKj80MurPRyHWYYIQSI1f20eZj2MJ63lVL1dX1xsaQxLDokNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66556008)(66946007)(66476007)(8676002)(4326008)(86362001)(4744005)(8936002)(5660300002)(82960400001)(38100700002)(2906002)(26005)(186003)(1076003)(2616005)(6486002)(6506007)(6512007)(6666004)(508600001)(6916009)(54906003)(316002)(83380400001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pWfCozNlCYp1lPYH12N1W3ZzjpoP?= =?utf-8?q?Dx//2ABRtLbF8SZ01v+5DNMMbhtgsS1nZoJWPtLrGhxawFrQ2FqCI/8dhWL1gVhuO?= =?utf-8?q?JUApvA8AAtzU+nw0ruECNO6dK1lj2yy9C8TKM+QYTD6AzCBowggKV6g8aUAvxTQvL?= =?utf-8?q?W7GOsLtrLp5tqdoabJolT9BYIo7OepVZTj0odxiVzKsGWmlfryC8AWQiN2X9ppQsJ?= =?utf-8?q?M6CLxLW/3bmAygVc9cBN+i5mol4f84hJMos/1NE35Wkq2Gn6SPBnc0CPrSF8xkPlH?= =?utf-8?q?cjUtMhTf3DqEyZALC4eH/SgChhWjGBq2C7fh0HnmpSlG37jkTVlGJWsWiVTMM+gFl?= =?utf-8?q?BEB09v148vdSEEVBAWWl/3HHrPy+FFEBh1DDbTL0v4U1fEmBpvUkEKPwvAAG8uJot?= =?utf-8?q?7gY2s8DJqzG/nmMpAk0wvYWL+lwoyBylPaUH42kriR/5i7Xt+566XCTJbn4GQNziH?= =?utf-8?q?Maywy8KuKOm07fkIhvsPaQb896pRvWZEKBLFa1xxDz5CVr9h8PN/UXe6dKYGEBf3d?= =?utf-8?q?eud/zO99f5hW9+alsBLry6ZN01ovmj0g/bvg522SZOyTDoROj+sGUbPB0Z+V/z64x?= =?utf-8?q?1OOMLljj24gcCL+zTtBuXDNrh9BzdUILslfnyum1veHPDBUZQcvwTR4Ec0S93H0fs?= =?utf-8?q?ONIaSHSx6p/vX+e+1wSgTJxjqmd23O2Cyp9QI05kIHqkhP0oaPpRLh9vxCG264Z+1?= =?utf-8?q?DrOQbSoWsV5D3Oyj3kVDTNSup91MTH3wYuh7Y0pb8IKhtHgrT7vpHBbwWji7r7/AY?= =?utf-8?q?yMoo2ZdlhnewdlXnpZK5NUnyKZMZ56CVehELfBoscXSJxctU2g5IZxYWae+Bpvl4f?= =?utf-8?q?hpQWvRJRVwSp4QxHvYuseY0LswqCG+1IfItNZvNZTaGIVWVLYaIjcJvLnn6l2OFwN?= =?utf-8?q?bMsQx8mZHFzwB+3RzJ302Gclt/erzQNF3B6GmqXQMZob4VKS13vvQ5Q7W1fP0P0Z2?= =?utf-8?q?JeHiXGCe/2kK+LhJsMHARtGGvjY9GDt9IsMbIlg05+XtKqUTnDKQIK63WhQ5MaTGY?= =?utf-8?q?qKG2u7pCOpdrVfO+4zbd6PI0N/S/rRqunf/P4/OKkQvD7cNlCxyhwNq3O+L5A6lJ+?= =?utf-8?q?fW7H1hfU457vPHSA6Zw6gfqYQU3mgoUDbLiYPMFNWcMkDH2QchxlGZMgZ9tqu7x/P?= =?utf-8?q?iorLXfzbkR+415m5D1YtXLnsUEGgkJNiu5+ivlx+XOZlH5NULGxNPEbB2qklS4iMi?= =?utf-8?q?WIzuyU58dMsnG/SD3VXkBGP5Tq4Acxb+HoFG3DJ8vRDJsQNqrqh4+8j4h75I00ZUf?= =?utf-8?q?2pgakCGG3qqL37vTTskezi6v4wOtvEjzCJpexgu0yPmAJ0uaz44cEbxClrc4u2gWx?= =?utf-8?q?+UiEGyjRb/BNjH4ZlBUOgknKPw92nAXDJMktM1RbdsUt69U/eNbs81ZcGw76GXgV/?= =?utf-8?q?MBUDflpZWBmsy8IhkwbNX2668kwNmuGG+0aoVOwA19LGDbv/+7NTF1s2GAR8BZu1c?= =?utf-8?q?mnejE7ronrBJtQJmAaqZrpWWPfscgNFOHzpiq0i9V071Y6xevnHhMI44SweAYWhzI?= =?utf-8?q?rm55EBFxugfrLEzYtSF0DAHubmBM5zfwmgZ8Dsyon1mgqKH0U5DclaU=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7d902a93-6ceb-4873-254e-08d9fd00f54c X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 10:31:20.8121 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SZdQjcYZIL1ZyviVvfT5MDCPUDMfxJKqdnGeMSmLnY6efb7tS08PAkMqrr5AEiNbBsQo6HFupxnwICa7jq7Vog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB4464 X-OriginatorOrg: citrix.com |
Series |
x86/hvm: PIRQ related cleanup and a fix
|
expand
|
On 03.03.2022 11:30, Roger Pau Monne wrote: > hvm_domain_use_pirq checking whether the passed domain is an HVM > guests is pointless, as all calls originate from HVM only paths. > Instead check whether the domain has PIRQ support in order to avoid > further checks. I agree with this, but I wonder ... > --- a/xen/arch/x86/hvm/irq.c > +++ b/xen/arch/x86/hvm/irq.c > @@ -30,7 +30,7 @@ > > bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq) > { > - return is_hvm_domain(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND; > + return has_pirq(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND; ... whether there can be a non-NULL pirq in the first place for a !has_pirq() domain. Judging from e.g. hvm_inject_msi() it looks like this might be possible, but perhaps wrongly so? Jan
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c index 5a7f39b54f..7c5dfd3c3a 100644 --- a/xen/arch/x86/hvm/irq.c +++ b/xen/arch/x86/hvm/irq.c @@ -30,7 +30,7 @@ bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq) { - return is_hvm_domain(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND; + return has_pirq(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND; } /* Must be called with hvm_domain->irq_lock hold */
hvm_domain_use_pirq checking whether the passed domain is an HVM guests is pointless, as all calls originate from HVM only paths. Instead check whether the domain has PIRQ support in order to avoid further checks. No functional change intended. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- xen/arch/x86/hvm/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)