From nobody Fri Nov 29 18:41:00 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=1629360257; cv=pass; d=zohomail.com; s=zohoarc; b=bwlBqs3Mj37/sv8W7AyirEzmLj8f6SpAdaDoiXb7p7hoRYtv1xGyq+2k0B3/m5Pz5PVNKeHHzIvIsnlC09BcwEd600UuB8U8e8eeoqxXQJLGaUDoKIEqvYBYgXvx+Pw/PlKjQ335Bw17z1MmWwPWR8p3ZUVzN2UH/NGbMEsi7Ao= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629360257; 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=xCCpoNqhblmLpk0P7zYov9YQAq2XJomF6+kzvqV+EAA=; b=edCb+upynpd89XdZMAAVfHXKtP8pmn21x5y20UUPArwAGmctgGEOG+GGY1O8Z2eVyaWxMK57Trm7jFjy99bj39Bfkrzelx6tLsxnvMre5FL05aYKNhJUaIhNR/hp48NWlRqHIfGMvtsH4sv+wutjuhH1oDNpsG+1eYy2KoYMb3M= 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 1629360257969611.4747530465147; Thu, 19 Aug 2021 01:04:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.168418.307486 (Exim 4.92) (envelope-from ) id 1mGd1i-0003u4-Or; Thu, 19 Aug 2021 08:03:50 +0000 Received: by outflank-mailman (output) from mailman id 168418.307486; Thu, 19 Aug 2021 08:03:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGd1i-0003tx-Ky; Thu, 19 Aug 2021 08:03:50 +0000 Received: by outflank-mailman (input) for mailman id 168418; Thu, 19 Aug 2021 08:03:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mGd1h-0003tr-5V for xen-devel@lists.xenproject.org; Thu, 19 Aug 2021 08:03:49 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.109.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 35de9a45-1f79-42e4-8a84-1b4400548e04; Thu, 19 Aug 2021 08:03:48 +0000 (UTC) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2052.outbound.protection.outlook.com [104.47.8.52]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-3-bI1m8SIhMK-cITQ9NWBlcg-1; Thu, 19 Aug 2021 10:03:45 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR0401MB2335.eurprd04.prod.outlook.com (2603:10a6:800:2e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.22; Thu, 19 Aug 2021 08:03:44 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea%5]) with mapi id 15.20.4415.024; Thu, 19 Aug 2021 08:03:44 +0000 Received: from [10.156.60.236] (37.24.206.209) by PR3P189CA0006.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:52::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Thu, 19 Aug 2021 08:03:43 +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: 35de9a45-1f79-42e4-8a84-1b4400548e04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1629360227; 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; bh=xCCpoNqhblmLpk0P7zYov9YQAq2XJomF6+kzvqV+EAA=; b=GL5mRaHRMErMrqae1dSPbZPwmNlF6EWv2JGsvCVMigBpPGzTSeGZjXKkyifBUgnngEfJB4 CWYbcsKwBhToYg3/Kv3INVq8gInNYzM393r4+olwhDzp8ZOsdgfu20dDWrnl+8OOZWF56r AgYckny32gt2J99YXPflQMqEgtl5HmA= X-MC-Unique: bI1m8SIhMK-cITQ9NWBlcg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TrpKyplUGLwW4IGb+qCgpP12qf3oSDpQC9t3QpU1RcifQUzxVlxeqDxUne1w2DM2aZlB2uBxK6WFj5ay07sqVVkVqe0bBYlHyvPm3NXzjZQJ+TE+o0d07s0Ybw09xpSfXy+F2A3K2YriEGrhvCLma5DlgvmZOHY7/1E4oeAVfbPQGuYz1crIYGADv7jaoGNPLAoehf6KQROMtIp2ueGm4wnrlhTJcXMIHnQtWxfbcrepkGdOYWs9ZuXn63RvogyXrQliSSv0xZFPbgFRafg6dkS3krvH2gvJQi/Lef41VGdkB4adKp5Oi4NNknACTQDKp6ZJqgA4KQBgcEbSDwqDOQ== 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-SenderADCheck; bh=xCCpoNqhblmLpk0P7zYov9YQAq2XJomF6+kzvqV+EAA=; b=HqVilDbFu1zKbSHQ3LqzsTsy9tu3csndVTtp6Clf2t5oJK6IlYQzU16XwdAKBlEJdEEvmQrWwICK6p8kBaMYQj+CfL6WmYVekuq1MvsONElk4IXpi+HoGvthJ7xbyb7uqKmCyI9V2MrwKYhrCZOFwTkSuYnX+dvIWaYog9W+q8fiNDsKztJxMYeNjczHw2d+NdYrVD/PEM+Qo+UUxls25YxZPTdzMQtutEVgBgzyuhW48LnmYzWBO3tV5jANEy7qyiOv6ZSMJ3tfJgEWNYfGjwi3cRi7Dg8vXte9NbxdfIzDcpwhfvxwYeMgtEHDotOkzI/MyzPJkCKR1tGbwXzfJQ== 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: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com; To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Paul Durrant From: Jan Beulich Subject: [PATCH] AMD/IOMMU: don't leave page table mapped when unmapping ... Message-ID: Date: Thu, 19 Aug 2021 10:03:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PR3P189CA0006.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:52::11) 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: 14c024e9-3636-40e2-7028-08d962e7dd48 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2335: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OxZr8tdSu2N1yi8JJsGLQQLi8pc5+EpD9fa96fDaPxXdzZpRVgjDH+I9ln3YO8j9ohbtvEXNdBxR93yrd17ROsb5GA2sbe2MzDnMDuTEMK6n487a0pJUyQ5FZlFCsJgRoq0AUdJp9IVlsnMOnr5EezNXFMw0TVc14NbmLWVTztgTqU+KyHbRX81hO6GXSdWrm2vxXvbwCkw5kgxcmH/lOhk99Imrb+/ke71IonjKX22b7ZNLsUFsjSfFZKjnG6zYlmY7dKdLNMznOnnr23AnIMk1r3Ie2ysQjI3NeEo2hDHO8ZvzWRA59WC28+cWzp7P7nWlR5Heci1AHWKPfgnpb0FvjoqQmv3NENRdSMVgZAJdmnxXp4Fz6FkFb8rrDeOiaeGIXKI/L5dX4hJGt7AYIH8/EYj9dpPlvxHBdNl8VBFeSBNvbCDqg+Ev6aQMGZmcG+kXDSfkIPtBMm2zmeNp/sxQQIcSwpQSgWQ+fZ/5mqUs9Mz+dabdngXFtgGdhDgCsjQRFnxQbgaul/x1C91OcMQjAQnsczwpB8Sn4g2wL7Bz8k9DLVRHxIokTm97/cDfGnhybx/na/skbBdMiEO6FhOwXnrIvSeeonbQCZmJHS5IidQH0g4tCDN8zXHMWt7LRtzmbwL87iM6ovWJ3s76eLyoi+1b6qmvDFxxIVpOzkwpWV8nJPjQAzFLjOBe2L7c9CBTulWftoDwB01eJvl2NAReM8fbyQbFLX/+9tmTyR4= 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)(136003)(39850400004)(346002)(396003)(376002)(16576012)(66946007)(38100700002)(26005)(8676002)(66556008)(31686004)(66476007)(8936002)(478600001)(5660300002)(316002)(186003)(6486002)(4326008)(86362001)(6916009)(31696002)(956004)(2616005)(54906003)(36756003)(2906002)(4744005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WFpKMjRYSHZ3TlFkdTQ4cktucEpYTFZkcHpRSml5ZzZIcXpSaGhTbHlPQlQ5?= =?utf-8?B?M3R3SnpEZlBFU3JyODM3K2J2MHNGbXVienJjandqT1kzdkRqYkJCb3hXa3I0?= =?utf-8?B?VlpRcVk4ZGNtNWNJMWhYZ1hVSkk0bmxKVDFDZ1R4ZXdmNHI0bndrcnc2THYr?= =?utf-8?B?SHVUNUJCQWNCdUZsYlRRWHBOWEUzWUd3ZXJLQzc0V2kxVmh2bVQyQzJIWWxL?= =?utf-8?B?dDFXZmwrZEhnVllYbFpKZ0htS1dHbGM3bjlFa1RIMkVQZUIyMGZMRnJmcEhI?= =?utf-8?B?NGVqSXFLTWdmeFJGNWtyVVF0OThHWmMxQ0RQOEdsWUdQZjl2REp3R2lEK1ZN?= =?utf-8?B?bzROcWwvM3g4cC9mOHVaNUVWSnQzeGxGdUQ1QjFoU0FIRXc3WTAvK2RxNVAy?= =?utf-8?B?TUlMSlM2eHdOTEltdGlCVDJJMkdGZ2ZOSVR2OC9GMEw1Rk5JYTNXc1JjcW5l?= =?utf-8?B?UXpFb0RHSmZRSWdwRFpzZUljLzBEYXcvSFMzSWJlRkVDWHNUT0V1a25oL0JG?= =?utf-8?B?NjBNMXRRaTlsMHVZOHBOUXNmQ0Y0czlYcUFQenhmR3paU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ydmdGMFFLd1M0eHZaRUhpZVg0N0lYandG?= =?utf-8?B?VXgrSVBrc3JNRHR0eHRuZU1uZ1c0aE13azl1bGdiNW55VFAvcXdOczRCcGx6?= =?utf-8?B?WDZqcDBOeFRGMkNxMUsrbUxQUEhDWjdENk0rVngrem5DNENPMUkrUUxZMUdk?= =?utf-8?B?dm94ZlVlTUtVd3BRRXk5Rkl4bkIrNHhmK3dtcUlqaW9tVy9QSllGTjloUXU4?= =?utf-8?B?NFB1dmluMmNpeWVOdzhzZkRIT2VCdkROd2p1SFB2OUFJOTloTkJ0aXBOSG9Y?= =?utf-8?Q?43nckYPykLxFPa+mchR4djpyVvlYumCRdDGLNHb?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14c024e9-3636-40e2-7028-08d962e7dd48 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2021 08:03:44.0164 (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: NnpXdDEvqa4ivyLASxyNrn95r/KNj2FJPAFquPOTAnhaO+XNDDZQpv1YlUn9Muaud4jffd/tYqhP+PtWIYeoWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2335 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1629360259671100001 Content-Type: text/plain; charset="utf-8" ... an already not mapped page. With all other exit paths doing the unmap, I have no idea how I managed to miss that aspect at the time. Fixes: ad591454f069 ("AMD/IOMMU: don't needlessly trigger errors/crashes wh= en unmapping a page") Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant --- a/xen/drivers/passthrough/amd/iommu_map.c 2021-07-22 08:07:12.501229386= +0200 +++ b/xen/drivers/passthrough/amd/iommu_map.c 2021-07-22 08:08:02.360893418= +0200 @@ -243,7 +243,10 @@ static int iommu_pde_from_dfn(struct dom else if ( !pde->pr ) { if ( !map ) + { + unmap_domain_page(next_table_vaddr); return 0; + } =20 if ( next_table_mfn =3D=3D 0 ) {