From patchwork Thu Mar 3 10:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12767303 Return-Path: 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 8551DC433F5 for ; Thu, 3 Mar 2022 10:31:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.282989.481873 (Exim 4.92) (envelope-from ) id 1nPijz-0002qe-9E; Thu, 03 Mar 2022 10:31:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 282989.481873; Thu, 03 Mar 2022 10:31:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPijz-0002qT-4G; Thu, 03 Mar 2022 10:31:23 +0000 Received: by outflank-mailman (input) for mailman id 282989; Thu, 03 Mar 2022 10:31:22 +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 1nPijy-0002Y7-0r for xen-devel@lists.xenproject.org; Thu, 03 Mar 2022 10:31:22 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0b0f3fb7-9add-11ec-8539-5f4723681683; Thu, 03 Mar 2022 11:31:12 +0100 (CET) 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: 0b0f3fb7-9add-11ec-8539-5f4723681683 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646303480; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=j4w1mHcyoEPKLLf5z/FbIGVgRFeXPbopcH1SycomTrg=; b=XLXlOoBaLSMk7gIgP2Opt1/xpQA41D5QYSJzHK2sjQF+jG5CxSLiIyWT Z3mTjA0lYVI9AQLCb6nwMCcMxCAp0+TpaAjwRY0HN0T203ecS4YK+xIQG eWlvYZZlWhbuei5HuEjdHolalwX9vlXATMkBcWs+I6giCXGZypitu3FZ6 U=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 64842697 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:4gsIPaNfR309yBXvrR2bl8FynXyQoLVcMsEvi/4bfWQNrUol3zBTy TNNWWnQbPqMajb3fdxyPYu18hgFu5OBzdJnSAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZi2tUw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zk v8Ksp2TQwcVBpLgoM4vDxB4MDl3FPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgmtg2poQTKm2i 8wxKghzURXDYAJ0Og00EYxigNW5i1C8bGgNwL6SjfVuu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vWwgHllA0j7nfzoGXo9kfLkIjcfnYXGsBBjYVWfl/y8Ew7puxx16 pNwiawq4dXJQmoplWz2/H4EzVR0makq3srluAey1ZFV5EFVbNXpYsDuGtIDZY7Gj7g4oxPKp gjMCjl3ocWTbqmVQGYgoE2q+bcHUjbXy32D3Tqg/blnQS/xxtCvgklLM92pAZ1yHtycegA2w 3+CNUaqFh/dL5nUUtDPpZyfSLOMB20ffvtChPlHb21LtBPB5ryw6SHlYndotvaPKA18A== X-IronPort-AV: E=Sophos;i="5.90,151,1643691600"; d="scan'208";a="64842697" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvbsshMeA32FOsDuLEdH8TdnLsT6voYgbc92js4/WoHCsfwFVsXLGn1T0HwP/jrvSVKKg5ZQUoL/4utZorcOCH2yjClmls1rrSdicLJPTUuyHAEIvdwnb8zPfaaRZ0tdpNuN+XSogU2dNpQk5627OaJLT9jg5aM/9XbismCx7Qmyzr1i9UwCkf0RZ2zfbKiBGpr+bP2R3a/PEqw9CcxqxlyvFyTXYp+WJha+KSWVgd8erKBTZkdIb+R5oau9Je7Sey093JW9Tp/M9R1YAUqzHO7yjKvbc/r6t8L4cX5r8tRL+T8FFHo9PPOxgoPC8mKhbal2kIZvZ2iVIOITw12dWA== 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=O6pl1w/5dSZ6eQnP2uJiXcsjx4tDubo9dhwsrhwqdHk=; b=luM2nQxTpwX96D3hNxm55iI4xnoWxe3nVnBOewqSgjSMecvccfwFb5GsW3GcMT7gdkPdghmyMOENPQ3moXQeLQBRy/MY/IncscvisK/aC5bDksdXkrOMJ/cOrTTW8l8zRyDIshFyMyISCuuONAK6bNt1RwkruX06CKQHvU46VFy2tT4CgRCwyFVC0vdy2Lw60yf1xX1AQ9rYTdVxxzbOsIovbN3uct7qwB+mFrticH/EfQMXwAS1j24BR8VyJaW++s6wPwxRlQl+YNZxxINQycup5SmO+aoLnwIpsAhW9OITWV39r383KVs4FoR2lIZU74teq+ZV8jmsTyDzBhyX9w== 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=O6pl1w/5dSZ6eQnP2uJiXcsjx4tDubo9dhwsrhwqdHk=; b=OIhItNfOaxeAC1vn6B2apHP0uAiieuFXrzgVGi9x+EAfwCCCcYsxK11K6dO2VZ62zSK33SmLH3zfeUGCWXHkBHC4KOvF5zA5BtJyLDRcM7kxYitX9yxTIASYQx4SgFO6Gqy9dfvogetTTv3RleCiNEMP2qLRTXkIqBjmTAtSCYc= From: Roger Pau Monne To: CC: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 1/3] evtchn/hvm: do not allow binding PIRQs unless supported Date: Thu, 3 Mar 2022 11:30:55 +0100 Message-ID: <20220303103057.49181-2-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> X-ClientProxiedBy: LO2P265CA0202.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9e::22) 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: c0bc253a-840d-4dd2-0571-08d9fd00f240 X-MS-TrafficTypeDiagnostic: SN6PR03MB4464:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5FAncAYXKM4YXj77FS7jN6dgvIbrh9AD/VLG4zVzvFnBYJrYuuEWkVXcyGnmP3E6tUWkTx2uTp8JYnc3vIDbagAvFAftrKH1Ysw4PFZiFLxlDxM2RgxbgLDaTWb6fkMutv/ecQnm3zLXHiny5MoevT0a3u0Os6jo7NUmwRXtGSzn0E6zim96kcHgoi94rQYrfmDxM71vObeZI36HYozv+F1xQkQkuDsiVPuvfPp+/wz/fyh4f+GhI6HkkLMOKqekskKOLlUPr23bX/2TOe6hgZDf1EOLzI/fQXDpxkCdSRsp02gKNJgov4mFD0EjMk/jWK9qbWKk52DIaehnjIdM5UHZWqAPB26GyQzHJmgTftfxTexWs1tUziu3cY/lkmV6Lc8qQDDbFz1TFCOhanD/pRbJARcz0i+I5GgN8XBTpBKAheCMnryJiteJy51NGoT+Bt8Xy2WX6Gpm2Mri4CRClvMm76yadlnKl2XgBbZLDP2pR7mn3GTbhrXKTR4MmiYszsgcSuPGgVFgO0euSf1Py+8pvnU2IaxFRgwsnBU3FEgAO82sH9divLxS4xFU8sARrfndJ8RFA5CO3ZBf2T4RqRpNfvmK1cnSeZcRQb5OwcRL3zfZASLcPsLEAe2Fnn8Pum6O/9MTBSEp2DkT2VMp9A== 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)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WZqHqhr5VhXGcth6mO6LIFFR6PrJ?= =?utf-8?q?Yc0NyYY93VUXDncQPkX89A0XziGeyAAZfylJlGwR8gG0gCJnU23486Jy1yjUd3lSq?= =?utf-8?q?aoYgE6ZeSJ2QtEtCY7RkmRFIgtAwdFAOHhZL43FOUGClYydTQ8NW70vcxcVbjLNW1?= =?utf-8?q?h9KRgXL9oAuquRBcsVHfUoirvOcY3/VoEJzD4QmAosXU9OIjOKu/PrGZk8VGw+nbh?= =?utf-8?q?fCh4pd4FuIgqhtOnypU7ycPJbgfzJp0PqM99IEUVRwcbpSjg1i9NAZnqqE6kNmdWP?= =?utf-8?q?aDr0j3hlwPtYy1gvI37RMsY19X07ivqkRHzugY+dJzoqXWU3d4HaSbBwXlEfBB05r?= =?utf-8?q?tG59wNQ9KLgfikbx0PQgRBo699fvguPuvX1KLfbCjDMvZTTeZLNna3Sj1hwZIutit?= =?utf-8?q?6RdORPfPOMQqBLuJz5fp0p89opktaZvRtCCApqPefca+uiBG5ZnH6ZArKrD4m6kja?= =?utf-8?q?PinIB28NhGTyZLSqGeGGQ7h04+3r377VxMk4eqAkb3gRfn868dENJ11muLpon7aDQ?= =?utf-8?q?mYQwoxdbzEAgtZ4QE2YGJ2egL+9k161UZYJK6AsF7LafN/ESZ871RB1gdyE72xusq?= =?utf-8?q?ot9d3BXJNPLEOHjCFHjhqEMhRHpTaxguJsVRAKECemEMcDJKhVfCH3tr7+jKC+kt4?= =?utf-8?q?CyjaJPUHHWwsfcxyWfKo5m0j0AypA+48XSwGLkmEGuWBsbfehh/D+bcv2B6vabKrx?= =?utf-8?q?lwxbZ/5w3l/vy2JrSuQodV9hOome0di2HkaQx/bNHKD7d3JYBGVeXsW4/DNE6dKkZ?= =?utf-8?q?GwroZbTS4J7qhs4wiSbjuUWZN53jPmJagVG115ceO1FhQ29dxDrQ713RnjP6RKgSR?= =?utf-8?q?fwaOuC3O3xeJSB926mhjJTSUwrRhLZ82T7vwuF1CTutvE1rGlE8JdA30/SsC6VI3z?= =?utf-8?q?7h1dnJUb4Bpd0Wv5Fd+EL7GLudHkQ8jrxzK0x7N7UFkkbfJlMv9n5t+Ai91gjrjzX?= =?utf-8?q?p4lcNAapYl6cE4RplJ8DKbFjeCidYm/EjCFYnxh/ZCsIxrEybxVCuQPJ0oWv9jobE?= =?utf-8?q?QS2o1ltSbMM9vZjezE34ROTB+JUslxLLpwfYk7FMAKDAnf7NZcOfK0fmNV2B4hdyg?= =?utf-8?q?dnHyEJ+I8T1vRlne+lgKZzXmAFDouGRcqEe1fYKqELVZ6kUaSbYjYqIs6brSuiS1B?= =?utf-8?q?vnCzK/rmKYqPdthecuZ7LxWNOtq5mygaiJT09oHOXP4PeeQOf3Fe705CUC08fIU33?= =?utf-8?q?oyUXnn5BU0rzi6IXzQ4pQj3ItNkkfOld7TS+6et+pvaA7iM77RmFO8h+ZRXkf+XRX?= =?utf-8?q?IoqBWjTYg3KVX1T1Yl/B/6LbOSl6rLDnU704bNuzVNyx0i3yXUqfBZzjdcgm2U6Hs?= =?utf-8?q?RBxLEEtpmW9kiUVAHUe0FD+dNIT4A0ePXSfcLzuVcEVFRY/yetfoq4xH4rmTVijU2?= =?utf-8?q?rmuKkAQ3TiDiIEZPbWcwRNHh0szhzNCLJ1ckqPt7rX9wvCWzahhHgEt2oaq5ilUDS?= =?utf-8?q?jkOVMp6QOHEeViEZrrzubciHm7EW2VvJZG+pKsfrmAtzz0wJGfIYAbUYSNQRXICk2?= =?utf-8?q?fW8l6obfywutHdtDuTIwhTy8IIHruRcmveAhJsy8HOWqFoiLapMDv8s=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c0bc253a-840d-4dd2-0571-08d9fd00f240 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:15.6994 (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: JL6gh1YGB8/ZLGkmbTlJYdfNWX6b3X2jvPkSI4shp5vhyaqoz7kVrufXHuczds685wEVrewMFMz6Le5VGFe1Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB4464 X-OriginatorOrg: citrix.com HVM (or PVH) domain not having PIRQ support won't be allowed to map PIRQs in the first place, but would still be allowed usage of EVTCHNOP_bind_pirq. Such hypercall won't have any practical effect on the domain, as the event channels would never be bound to PIRQs. Signed-off-by: Roger Pau Monné --- xen/common/event_channel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index ffb042a241..bc4985706a 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -556,6 +556,9 @@ static int evtchn_bind_pirq(evtchn_bind_pirq_t *bind) int port = 0, rc; unsigned int pirq = bind->pirq; + if ( is_hvm_domain(d) && !has_pirq(d) ) + return -ENOSYS; + if ( pirq >= d->nr_pirqs ) return -EINVAL; From patchwork Thu Mar 3 10:30:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12767304 Return-Path: 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 ; 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 ) 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 ) 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 ) 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 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" 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/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YQ0KIrX0uspeahobP3pmIpEc2JTtI0Hq5KR/z2WeG5ft6/BnDUVwNowE4OdnR2pJ8 JT0KhhUMErF3bjvhuvmFK883azPL+GyVG8bkmtnwjzDS+4vXLjIQrnQ5M8e1zA17ixLNaiDO JpCMGEzBPjGSxFLeXMbDMMHp/7r1lf+SB5lpG+z+YNitgA/yyQuieOwYbI5YOeiWsF9jkue4 GXc8AzRABsXKdiewjqt6W+3i6nEmiaTcJIfEvi0++BnhHWXx3cPE1sGWF2ju/67h0WiHdVFJ CQpFjEG9PZoshbxF5+kAkP+8CXsUgMgt8R4Gc4m8Dmv5Ont4EW1XXAbcmRhQ/YkjZpjLdA17 WOhk9TsDD1plbSaT3OB67uZxQ+P1TgpwXwqPnFdE1ZcizX3iMRq10+UEI4/eEKgpoCtQVnNL ya2QD/Sbln5peoCzO2F8F/OmFpATbCZH1dutm07so9Ihz6VhbJJhaT1sTA3Dt4ade51q2VtW lBewaByC8hUUPmweNSlGrllIV1Qz6/t3MfgqVBuBYI90D+m5mSue4tdiBknehs3aJpaJW6yP xKK0e+02HO1FCHwBUOQS9jsY/nGMIC6TYi1PhwqRoAmjmdNmP+vo3g1OB/4M5HFm0kwi6AvU ap3gu73ZUv2/Z9PlWLsL89EiOdD7nlnmQv7GMCqpzz6gOH2TCPEFt843K6mM7lRAFWs+16Or b6y9qKiln1ibQEJSnKPoN5LcAtTdiBT6FKfg5U/S9Nv6zFOQQkJI/TQ3akga8pimaFUnf3P5 XazRglTz1+XuJENAV7ihqxLAF83YatCkA== IronPort-HdrOrdr: A9a23:R5CTkK2IkuJ9mWxwSbs9rAqjBEgkLtp133Aq2lEZdPU0SKGlfg 6V/MjztCWE7Ar5PUtLpTnuAsa9qB/nm6KdgrNhWItKPjOW21dARbsKheffKlXbcBEWndQtt5 uIHZIeNDXxZ2IK8PoT4mODYqodKA/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 To: CC: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu 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> 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: 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+zTtBuXDNrh9BzdUILslfn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piq0i9V071Y6xevnHhMI44SweAYWhzI?= =?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 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é --- xen/arch/x86/hvm/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From patchwork Thu Mar 3 10:30:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12767305 Return-Path: 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 DDFC2C433EF for ; Thu, 3 Mar 2022 10:31:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.282992.481895 (Exim 4.92) (envelope-from ) id 1nPik8-0003YH-SQ; Thu, 03 Mar 2022 10:31:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 282992.481895; Thu, 03 Mar 2022 10:31:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nPik8-0003Y2-NF; Thu, 03 Mar 2022 10:31:32 +0000 Received: by outflank-mailman (input) for mailman id 282992; Thu, 03 Mar 2022 10:31:31 +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 ) id 1nPik7-0003Bk-5v for xen-devel@lists.xenproject.org; Thu, 03 Mar 2022 10:31:31 +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 165bcf86-9add-11ec-8eba-a37418f5ba1a; Thu, 03 Mar 2022 11:31:29 +0100 (CET) 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: 165bcf86-9add-11ec-8eba-a37418f5ba1a DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1646303489; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=mRratOgkzBnDfVL65Q/q6CME3fnvGL4txg0FZdaWXe4=; b=F013AGF+gmXTifXtJbcegSLMmQe4ikfN1Kjs/v90XjG/hgNKoFIT+j31 kQ10u2VXcwtHY0+iusOzvLzGhZNNJ3DOAF41XDsDndb7K8MSZcTf6Zotj j0FrrgXv7kgUbawAeX9ht2Cq8vSgJ0e/WU0TxkKLaiViZ2WA6eLn1PrmK 0=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 65783144 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:NE4+zq8zV1J7QPWF+NyrDrUDqH6TJUtcMsCJ2f8bNWPcYEJGY0x3z WpJXT3TbK3YNzamc950bYzl8EkCuZCHndQxGlBrpHg8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ54f5fs7Rh2NQw2oDiW1rlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnZCiTBwnFfz1o/Q6cSUBHgthfp9q5rCSdBBTseTLp6HHW37lwvEoB0AqJ4wIvO1wBAmi9 9RBdmpLNErawbvrnvTrEYGAhex6RCXvFJkYtXx6iynQEN4tQIzZQrWM7thdtNs1rp4TQqaFP pZFAdZpRDrKWDESAWsqMqgdkOiugXr6XTQBj13A8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru42T4GVcbL5qWkT6e9XS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nk27rT4JiugIlUFSVoMYdft4sZEfxkVIC50NdRiKpLzPKN MeTf002cwmMW9zNxvizypSKZ2XLzkO9y69MwY/Upf/6UkVoJh7p3FosPD30E1wsa7VcKM0lN gsAp4Y5I2mcfVmH56VfN1xOfdfKla9Ny4kY1jiaGgOKsk8SgfwQtjMkfEI2N0= X-IronPort-AV: E=Sophos;i="5.90,151,1643691600"; d="scan'208";a="65783144" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvwK6wCgl47O4ZB2XLNxdx9JFPlHy1IFkjp9jwBm0+U3+DWfhhr6VB39Q47S3klwd3mPn0E6FB20oz53JuUsSH0eD2yWqU4dS/JhsnxZ+pT5SlP+CgcCcwUJSOnAPc7kT6SuUrtyaPt1sJKKYK1MrhB14r6d4NxXUvQQaXqF+sHw79vL3y87hsKsPMQYuLHUhbiQi1OIVdmO7VZz9hmYFH3a3GPOGJ8oG4FjtaYl9I7DzOUXT6QTX70ORO5vgSYEUcKQQobBT/hPxE8lId92rsm4ybmgU8ZvHeojuPsH2jHqAAaznONp3HsG9zRVR3GwZrBpuCrqA0O1lY8lLiucBg== 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=vrDS53nrLLQmuLsxvZpPkLlor7GHN4Niyf5R3N6D0us=; b=ZAOSsL3/k3l1ERY4U5oB/bXhQEHzdIpxYZSdk7ULwgH7LGnQh5uOGM9nt+XcLXHHIuGK6MJUvbbQTCoOZ8Jpho96qpWMsMvxahA3c9YQkp8tUATIXvXtY3epBguvWi7h9kbCOsgkW5+wJbQNEBELV74VsEIf47gW2NjLUa8dKBaO0k95SwocCeVz6LZ3Rvi3T4WqTVkY9ItMuf1Of/DDMY5GizGHLujsm6G3nAuGRi/AdEOO/ydrwzI4Py/GqjZ7VQElA+NNC0jNH67C6WNOGBEWsC+kBHFas+UjrkwVOlNnNnrgj8LYg2XgrilT3ShZ9Rc+5iJT3EJDy+z8vNw4yg== 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=vrDS53nrLLQmuLsxvZpPkLlor7GHN4Niyf5R3N6D0us=; b=vAQqLyZ1ToV1Po65twx8+oUOEBeidXc9YlejWb+JzWt1vUZmgDah3Y7qfHLy76O5I/tn6u6ci/XJ3/SnHsJoo5LassHXsuNU9H3w6yKv1vNP8xZAXNrBb7C1d+8AVLbcVg3AwqRaS4WVzVk/wBK0EnO5SEm3T48Fmw5R1y9qrEw= From: Roger Pau Monne To: CC: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu , Alex Olson , Andrew Cooper Subject: [PATCH 3/3] hvm/pirq: allow control domains usage of PHYSDEVOP_{un,}map_pirq Date: Thu, 3 Mar 2022 11:30:57 +0100 Message-ID: <20220303103057.49181-4-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> X-ClientProxiedBy: LO2P123CA0086.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::19) 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: 5dadd1f2-682e-4a83-83df-08d9fd00f842 X-MS-TrafficTypeDiagnostic: SN6PR03MB4464:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1lzmrsbplqXhBYRiOG9gmuhpcG2y6dd2KTsqWMnnCvkEaavJ7PkR6XGkRLFytaEj7MUEWB3Us1WCDhqBu/5h0qk+CeJfqywGzL0XaN6F4JfPdvitCYXo/HJluCo0nm0wCzORkslH3Tvf/Bto5lSRtKmhRACqpOBqKZNU1g9dRrR6teJRMud0BUTqDGGKmkwJstSYnO6gy88Ym1FcnNC9YzswMoCkNES41K7mq6RFfpbZwG6pQMsICnKEzpoKF4A7aTmGCq5qgfL22qQxp1xV2gLcJqWsgsIdJ/DFI/DvgomGE3oGuDQDDQehbaBzHUic76zWXVH7qye/aNdkwyRuTsbsuQ+f1WpqJHM3OhLzJ6PMUJrZisoGhQXlGhuRdjtaWriAwbWoPE5sR6ZLEzF+uPtywbj9w6kG2jBNdv/lRWJa9bY8CR7CXjdnZernyg1sdjC8T8bbNdBOIYsSkuiw1SvZ/nwL5LAjJpKOmplqN6v0rHIAp2fSFZh/JDvH93x5t47n3QZYwJzqqztxH3BDoa5IvJM6lL1jh59KWMGcQF/vBjeKPNQErahJsGmRpxloD3VUo3BxOj4qFWOBh23u6KSpK35icEIx1pJRtDxd2rk+uqYSHaW6Nfu4fZ77h7zD2bYYlXeR7jySpK6tKsI4Vw== 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)(8936002)(5660300002)(82960400001)(38100700002)(2906002)(26005)(186003)(1076003)(2616005)(6486002)(6506007)(6512007)(6666004)(508600001)(6916009)(54906003)(107886003)(316002)(83380400001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-Mess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keY3Lij8ECxSnf+zWU+F519hdGwswiyU?= =?utf-8?q?R5wCvVcSyqXwvTq93CJ4UI5y2+E4qdeOEt1evFPIsK4gX9j2JFK4ruI/nIXKeWaEO?= =?utf-8?q?gw+qcpzdvip50oBV7033bTklG9xZw79JltY/YMVUmghwlGvVA1IWnBvoVXToLpwr6?= =?utf-8?q?5ZRKN7uC/+XjFN0cmykoLk8XFznaM+oXocewANfMiSb7t/0XPpY9tYPr6n8WrKGLm?= =?utf-8?q?T5A7HgJ7E6pihDTMiI1z3dKe2hVn+K9+6IIMg0T6nXfoPopzjazjB3e0Zl7/CoYYs?= =?utf-8?q?olq807sXko+MyTdSn5OLCCQmFxf9tWYJAtECDJzdaTwx2Tv5jmFULgC1p3Dcz6K/p?= =?utf-8?q?ybQF0pbii0E6MMDWuFqbkLaAEZC1/zSS1OQVuBEiGxWcxoFv43oM1gKBV3tUerMAf?= =?utf-8?q?asAOZDWHAkWldymFgfSyGzcSsYrP5qhxQc2WNYQd+kWfpaXy4X1zhf9A4VuLO6soA?= =?utf-8?q?fQMbwi5pUOpG7whAT/a2olyaAKerExSdR9we/QI9b0YaAjB3YlWXEP0r3jXnAwqHa?= =?utf-8?q?7MlNRXKPWh/E4/0FXXj3RMw8hIZS0n7HxW8o2Xae/l5c+UTeZ1MHWc3UY8pOVsVHc?= =?utf-8?q?joT/pIp8BGhO8j4/dnOQVoyUsMQib6rhXDGOGcN0nKvsJ5xtEm7pRmIyXZHOd86mz?= =?utf-8?q?CNcAgkajFTy6ODKZypCstAfSOwPG2wc3hMT1h4+8E965sHhw4FEypow=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5dadd1f2-682e-4a83-83df-08d9fd00f842 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:25.8928 (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: w2dEKg2fXNMKVhXtDje0QZds7NB37jiiL9Vqt4ay/qKOXzC0v0hlmW06/VLnjlc7fSwqsb56EZtAFi5S924ZEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB4464 X-OriginatorOrg: citrix.com Control domains (including domains having control over a single other guest) need access to PHYSDEVOP_{un,}map_pirq in order to setup bindings of interrupts from devices assigned to the controlled guest. As such relax the check for HVM based guests and allow the usage of the hypercalls for any control domains. Note that further safety checks will be performed in order to assert that the current domain has the right permissions against the target of the hypercall. Reported-by: Alex Olson Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monné --- xen/arch/x86/hvm/hypercall.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c index 030243810e..9128e4d025 100644 --- a/xen/arch/x86/hvm/hypercall.c +++ b/xen/arch/x86/hvm/hypercall.c @@ -87,6 +87,13 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { case PHYSDEVOP_map_pirq: case PHYSDEVOP_unmap_pirq: + /* + * Control domain (and domains controlling others) need to use + * PHYSDEVOP_{un,}map_pirq in order to setup interrupts for passthrough + * devices on behalf of other guests. + */ + if ( is_control_domain(currd) || currd->target ) + break; case PHYSDEVOP_eoi: case PHYSDEVOP_irq_status_query: case PHYSDEVOP_get_free_pirq: