From nobody Fri Nov 29 18:51:29 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; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1631697222; cv=pass; d=zohomail.com; s=zohoarc; b=XLkKHM383LxdzhL3m8enKwGkkEs03Jp2mb1oYoAnSpY7OWhqUbrdJTP5xp5qGwbPMwtLD8qFZvtUnM38Yp8VAc/0SeO5/Pg1yedBGKF0qZ+T5d+aLwngWdiJrkdV1hpUYoy6M6nMpiYeigI48yvMarWdCQdz1SqRqod0/ocYU3E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631697222; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=32ebYhQya8W1RrUzbbQIk60a77c15WTRh4/23DDxt8s=; b=P1d1QJRVO9O2bF7DhAMSSQ4/axAMNoV5ujhCkiKG/2E1XvmYaNUwFNWD9VWndRarRvJy+kzC/6aId/tTbZNuHKnu9qzpDKJj62DNClCL6h3kfYxF8bIrQNgkS7+CHiDtkgIFWU2OFpx3bu9OoelYDwSb7YK1RYD6xM0JGKtFjjw= ARC-Authentication-Results: i=2; 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; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1631697222312272.2434762169846; Wed, 15 Sep 2021 02:13:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.187389.336231 (Exim 4.92) (envelope-from ) id 1mQQyu-0000t6-FU; Wed, 15 Sep 2021 09:13:28 +0000 Received: by outflank-mailman (output) from mailman id 187389.336231; Wed, 15 Sep 2021 09:13:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQQyu-0000sz-CR; Wed, 15 Sep 2021 09:13:28 +0000 Received: by outflank-mailman (input) for mailman id 187389; Wed, 15 Sep 2021 09:13:27 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mQQyt-0000is-5r for xen-devel@lists.xenproject.org; Wed, 15 Sep 2021 09:13:27 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2b7fb60e-1605-11ec-b4ec-12813bfff9fa; Wed, 15 Sep 2021 09:13:21 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2055.outbound.protection.outlook.com [104.47.14.55]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-32-v3woC4z0MwWLON-TAE0nyA-1; Wed, 15 Sep 2021 11:13:19 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB4605.eurprd04.prod.outlook.com (2603:10a6:803:65::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.18; Wed, 15 Sep 2021 09:13:18 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::4d37:ec64:4e90:b16b%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 09:13:18 +0000 Received: from [10.156.60.236] (37.24.206.209) by AM3PR05CA0147.eurprd05.prod.outlook.com (2603:10a6:207:3::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 09:13:17 +0000 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: 2b7fb60e-1605-11ec-b4ec-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1631697200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=32ebYhQya8W1RrUzbbQIk60a77c15WTRh4/23DDxt8s=; b=GEfoYrpzH6+wUCKjZaLEnGB/YHaK4jHBzfiovhP4TfWQbysmSfZficSntMm4aQEM4XJKKO aHd+mcOJ41EdGVoGkFYKnSaQbQ5BFOdcsFnAWy/Y3wYNQ726309+Wpa1Yb3mc3V38965J6 gnK6hO+uqJ/kUIfG6lxz/6fqq+CELpY= X-MC-Unique: v3woC4z0MwWLON-TAE0nyA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GwRwISbZXLP3toO46IJntMnZTALYvIh2Nj/kLOpH1vKwiqSmrh3NQJonKMwv4QTmJEucidi7aaKQqFlKC7n2adKKQVWLpsW0Y8a4/AhQEtXmBEcMk656rcRKvnvj48F/LBqWI6XLJpk/GVQS5Eyqj2rgizBhyE1o/v9ezqqqKzdIgpu6H4HjCodNdChcWrkyo9oAKylKRo5x6CHEyItfcFKOF7RLR0ZrjjYxzlAsYIxEHkSndiqlsb84FzbASCp9ABL2NeQOTTdHWnQUk7+F1Y6qFdS/noupRXjaHGR8PLZejkZIto1lASP4sfJKGP2cIchQuiWuPZBBSTJ737YVag== 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; bh=32ebYhQya8W1RrUzbbQIk60a77c15WTRh4/23DDxt8s=; b=TJORSQ5y9HVkQeOC/H0aqi91f4KSXzWYzac5VRxRMDr/8J53fJwg+nJp8qwinmlt5m0W241SyYpo5F4qFn1HMpY6bxzq8ULOtNRiHJJSQqbYY9Ba662zYaa+dK0ZbEy+38s/H+Z/LWdkfdICjMjldSPH21t8ebrtiEcIS2zPHRP1SN6di7gcUeOK1r40AQOKuNgs7n3qezb9210s7OO94cN34qCxdF4t7TV3VUkotCO8pTCY3saO7eXqZRmShKNtm4/Hcnyq0vxguUIb4OXZSTJ5348ndN2EoixrFzOTGDx6YC9bxBdcul3+CyFDk3Tz8CeRIOXlEfP6Hw2eS5lF4g== 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 Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=suse.com; Subject: [PATCH 3/4] VT-d: skip IOMMU bitmap cleanup for phantom devices From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Paul Durrant , Kevin Tian References: <6b7fa64a-bd6b-353c-30cb-ec25b850cbed@suse.com> Message-ID: <57c75e32-df31-c886-b2b2-86d0f82a57d0@suse.com> Date: Wed, 15 Sep 2021 11:13:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <6b7fa64a-bd6b-353c-30cb-ec25b850cbed@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AM3PR05CA0147.eurprd05.prod.outlook.com (2603:10a6:207:3::25) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1cf6ae7-7974-45dd-ea38-08d978290e66 X-MS-TrafficTypeDiagnostic: VI1PR04MB4605: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UcUyzyXHSPmodqNl3UsUYxFvt4tIaT11ttbfrzxQS4tdgIIFaK8HCsy60MX/UAEFCrwz4C7PEqJQQjD2BQ3XfwEOIFw8rleTLtZjfABusPXvcSmnzM1xfQKAzDU14/wllmhkYqU2rtONV9D1/fR8bmKDK59aX3eyQ8RPZTXP0z/ZXsfJavh6HLpx+IvM9tIq54djPbREzlKCAMqagv6B4VXlOGddrQ44cstZUy4Xrwakp7kadVN2vxz1DG2cbaS60ucOSMRrRmVoTYSbvBTfxfLK0ChkMJBVA4AkRMhlcBuesC/RiiEK8qy78Fg60yjfU6Y9NUdcR84dB8sgO/4jZOQ1MajonIt6uPwDgoSI5AKkU/4WchOCv7SBlAPt0J967rIZ4LIyL4mIzu4PthyqAhOsBwASa2zLBcw8E9sfgCFzl0oVAzhyNXzxXeiYqIbF+FySm8LXo42xmT/GIpDB8SSFXU2sbfu6qd5sZTt2vHXgIjsgIid3tRhpr9GjrfQZKHYYkKa4xKUM0O3H9n3xNVaYwPtawDWVPa8eo/uB11ggz+nFKEN+balQCzr3gChMBFNWfwhdFz0PXgWGUKchJMfQ++zvLwBx5m7J4QOI+FQXzSi+YnIf2maKXfd35Sv4vJQUWC74VLTQRTF90E0wxnnxF96CJa8KzAJIxNTtGF6y29i3PYv4LepMvIMUqHCErHrwdQIDDg+NWpU5EyMnnFNz0tfH60h3TaGI3BYH52M= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(346002)(136003)(39860400002)(396003)(2616005)(38100700002)(5660300002)(956004)(86362001)(6486002)(478600001)(66946007)(4326008)(316002)(16576012)(6916009)(54906003)(66476007)(66556008)(31696002)(186003)(26005)(8676002)(4744005)(2906002)(8936002)(36756003)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UU4wc2hpT1pyT29STnp2bndUTm9iT0g0SFJGZmoxTGFNWDF3ZzdyZFN6OVNV?= =?utf-8?B?dFA4MCt1bGh5alBxY3dMY1IxNjVXYXFFUFRFUmhPakhxRURuTkRsalp0TE5B?= =?utf-8?B?Mjl2bXZxcGRrR2N5aHNpSmYxeWE5SDFaWmVQR1ovVDgxbmFyMWFvZkxKR052?= =?utf-8?B?MmpoMXlZM2pjR3FKTTNISi9vbUdzRDR1Y0F3elZLNWxtbUpkd24rODAzZHZl?= =?utf-8?B?dThtZnpsYlZsQUJRK2VBazRrd2hrcUw4N1ZvSlVKR1pOaDFIRlplQWY5V2Yy?= =?utf-8?B?cndRa0NGQWV5V0lQazgrdEFYY0tjTlFXeHFNTy9SUE9XTzZ2L1BFTG05bnQy?= =?utf-8?B?N2J2Vk0raXFBUmlXSisvZkVTOHNJWm9MOUtrQjhnSDYzOXM2b0JWSlRselY3?= =?utf-8?B?OHZJay9qRWJ1Ry9VUjZZNXR5UlZ3a2FMTUczcW5rUmQ2U0NFMzd5Y3lGSkJh?= =?utf-8?B?Mm5pVTIyNld2b0FXd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?utf-8?B?UHBKSkZDQ1FkMmpTM2l6c2NwK0dBKyt1Y3JqczRUNURhU08rSDRMMHFrTlIv?= =?utf-8?B?Qko0TWRzZHNaLzVid2JMNG9EVlRJNDc5ZENOSG5RQmlkM2ZMWjNITlppY2dn?= =?utf-8?B?ZFNXazR5TzNvYmloRVFmc2tZT1BSZW55NkpzSGNpMUxXMGhubjZXaVJqZGFW?= =?utf-8?B?V1IwWHRvTzJacUd6Mkt6L0dHazZyejZvQjlzL0dkcUwwdURBKzIrZlZmUDJ1?= =?utf-8?B?UzJNdG9pcEl0VGpIZVVQQXE3UG4weU5UTVpOQ0xncDNIZEh2b0lhaWlVdzBT?= =?utf-8?B?cGRXTnNud2M0VHZubHhZYWcxSyt3TUJxTkVHZlR2K0R6SVMyVDE4QlBOMjRY?= =?utf-8?Q?qeCV2/ADKOEVhDXR/GrKYkasJ1NdKzZjYlceDb9?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1cf6ae7-7974-45dd-ea38-08d978290e66 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 09:13:18.0783 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UKtU3fci0huM32s8PK1/Er8KbcFWG+KyjxkpT3Qo5rSorEgdBFwf4v1xfamLYCyllnDTSNCLx9GaNhZCv2nMmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4605 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1631697224064100001 Content-Type: text/plain; charset="utf-8" Doing the cleanup also for phantom devices is at best redundant with doing it for the corresponding real device. I couldn't force myself into checking all the code paths whether it really is: It seems better to explicitly skip this step in such cases. Signed-off-by: Jan Beulich Reviewed-by: Kevin Tian --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1733,7 +1733,7 @@ static int domain_context_unmap(struct d return -EINVAL; } =20 - if ( ret || QUARANTINE_SKIP(domain) ) + if ( ret || QUARANTINE_SKIP(domain) || pdev->devfn !=3D devfn ) return ret; =20 /*