Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5959016pxb; Mon, 14 Feb 2022 11:42:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuN0XYamn0D/mFJRTJirDlv3fv36FHu1qEGPn3p4gjitadf2z6ea8GbgRtk74264YV/A9n X-Received: by 2002:a17:902:ccc1:: with SMTP id z1mr560076ple.107.1644867768103; Mon, 14 Feb 2022 11:42:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644867768; cv=none; d=google.com; s=arc-20160816; b=wtXJXoxn4dJNuBrw1vj4tDqyAcngzITU3QcS2VMmX3dWj0mEgjad3i/XeWhT3lotjR 92CqKOxV1IiL9WMwaexZhdwsn0SxZiB1/jdYcLoVqVqRR7RxR/wGlrB7NehOH/mOt5+L ENkPtuQQnLhSdHmrEHXrZIC8uiZGhDjYgHeW2d5iFmUKSf6F3+eB4782aGyuUCRpFmc5 bHoOBQyakYAogg4x+EWNFeEspwXTzcLrX4DApPvow3r99AiI/bcg6VSBJrlu6/+aDz2a ktuFLvZfGn5qo90mSGbjHTBmuBPEMbCbn4Ojlr9L14xRhh2seexpuFFDuIXXn0XC4GUF Mmig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=N7iMcp5T4oMsxLAGid6yk1Yt3N61Lrwl2usJvQy5qpY=; b=K/ymEtW1BqCO8oA4iBckaXkIDUJ79otXuIXGrYMUDmVi7OYLzoobs6upqH02kEpIUQ g0m78NptOoRsfkZwnps4lT3WM1WcmCf9slhjFrSFoKrKKycj1uhLHg5xAKvhTAKTsFco x6pswcL28/7o3+bRUkqsBMR2CxT+h/KsUVR7H9idBhDQ5Cktdve74rq71xAf0keQUtpD cTWKr3qhexe+dKYD7qlqM8J2dwWQLpZgfwAmnMI+F6bn7/SB86Fm8K1owC6seJoPGhJo 1Tdrv8SfG78IQUAIOguygfWDarkzSARYlJ7+lFrpGifdSmZqTnd93fEkyyCGpOIo1f0r HwLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s6si638819pgc.134.2022.02.14.11.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:42:48 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB9E8DBD1B; Mon, 14 Feb 2022 11:27:56 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350149AbiBNLxE (ORCPT + 99 others); Mon, 14 Feb 2022 06:53:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235729AbiBNLxD (ORCPT ); Mon, 14 Feb 2022 06:53:03 -0500 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15478C35 for ; Mon, 14 Feb 2022 03:52:56 -0800 (PST) Received: by theia.8bytes.org (Postfix, from userid 1000) id BE7412FB; Mon, 14 Feb 2022 12:52:54 +0100 (CET) Date: Mon, 14 Feb 2022 12:52:53 +0100 From: Joerg Roedel To: Suravee Suthikulpanit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, daniel.m.jordan@oracle.com, Jon.Grimm@amd.com, wei.huang2@amd.com, terry.bowman@amd.com Subject: Re: [PATCH] iommu/amd: Fix I/O page table memory leak Message-ID: References: <20220210154745.11524-1-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220210154745.11524-1-suravee.suthikulpanit@amd.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 09:47:45AM -0600, Suravee Suthikulpanit wrote: > The current logic updates the I/O page table mode for the domain > before calling the logic to free memory used for the page table. > This results in IOMMU page table memory leak, and can be observed > when launching VM w/ pass-through devices. > > Fix by freeing the memory used for page table before updating the mode. > > Cc: Joerg Roedel > Reported-by: Daniel Jordan > Tested-by: Daniel Jordan > Signed-off-by: Suravee Suthikulpanit > Fixes: e42ba0633064 ("iommu/amd: Restructure code for freeing page table") > Link: https://lore.kernel.org/all/20220118194720.urjgi73b7c3tq2o6@oracle.com/ > --- > drivers/iommu/amd/io_pgtable.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) Applied, thanks.