From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933464AbcFOU1b (ORCPT ); Wed, 15 Jun 2016 16:27:31 -0400 Received: from mail-bn1on0065.outbound.protection.outlook.com ([157.56.110.65]:14321 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752958AbcFOU1L (ORCPT ); Wed, 15 Jun 2016 16:27:11 -0400 X-Greylist: delayed 3636 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Jun 2016 16:27:11 EDT From: "Vesely, Jan" To: "joro@8bytes.org" CC: "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: Re: [PATCH 2/2] iommu/amd: Destroy api_lock mutex when freeing domain Thread-Topic: [PATCH 2/2] iommu/amd: Destroy api_lock mutex when freeing domain Thread-Index: AQHRs4wm2oGHldyw5E2eKYXo1jpFBZ/qkrr8gABjvwA= Date: Wed, 15 Jun 2016 17:53:15 +0000 Message-ID: <1466013192.3265.74.camel@amd.com> References: <1463854264-26445-1-git-send-email-jan.vesely@rutgers.edu> <1463854264-26445-2-git-send-email-jan.vesely@rutgers.edu> <1465487321.7114.0.camel@amd.com> <20160615115406.GF26566@8bytes.org> In-Reply-To: <20160615115406.GF26566@8bytes.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jan.Vesely@amd.com; x-originating-ip: [165.230.225.50] x-ms-office365-filtering-correlation-id: e92d5efb-2bb8-45c0-9b94-08d39545ed93 x-microsoft-exchange-diagnostics: 1;BLUPR12MB0467;5:Q75/LkTXrb5lIHnvGyEzHMCafBTz+FCOowNPR5sEJgC01isqcC01A6O/PBpjAeX4U0D0tFHCq+XY/x6oNUBEG02+5QHXT9P3yg5fl9qRIgzzUU1dxGYP6Oi6uPOSLxDOB+MZM4/73CutjpiIozPebQ==;24:KgXpE1Nn2//LXBbmSNU768GDXwrRZcdHz9DCHPh27UQvxLLhq9iqoDXq1qiVOILqTiwzl8SoHUW2e2RFURYS0T1ZO3xV/PJTpMdGFshrIDg=;7:535F5rZtgGm8m7kC+gkq7qCv+IidtLigZTmNq7HKQx+3D23equL2Gc1tv8EYDzN6/8icWSBcLn2I1Ky2DKaAq7cHmpOiu8wxG3Qk9oOk1XnKN6+MuHVRFRKVPcxw3UUcc+iRseWYfGLLhzckSRHQOV1aoO8EPWfC3VcVxvF6JkXkzC9bUV+IMeRXGrisuzeKpTJ/mvNShFppgHLehhywMQ==;20:wZOJkLUPW4e7L8ELlGGfciYaLdN9JFtDHA9drwDTEIIPSyaxCVBECvWVFis5ePtU9d5VE/5oR4R+xN4hsIe8edeFk89SuYSIbF5x+ROLF+0CM3kBFnM4PpRykMxJt3E1x3cM93QG5C7eHOzbZOBvkY8kfCt9fr7zzfrR79nz9jzmJJs3qrUM6H6RB8IkQWniQEKEmNrifIzC5KhYYoyoh/U9BbJ/PTkxCh7BWJyws3XScmNFrJ0Ga6tJ08yl2oZU x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0467; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:BLUPR12MB0467;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0467; x-forefront-prvs: 09749A275C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377424004)(189002)(24454002)(199003)(106356001)(50986999)(10400500002)(8676002)(106116001)(81166006)(99286002)(1730700003)(81156014)(2906002)(3846002)(4326007)(19580405001)(19580395003)(8936002)(5002640100001)(2351001)(66066001)(97736004)(2501003)(54356999)(76176999)(87936001)(110136002)(189998001)(101416001)(103116003)(92566002)(15975445007)(3280700002)(5004730100002)(5640700001)(86362001)(68736007)(5008740100001)(2900100001)(3660700001)(2950100001)(36756003)(105586002)(586003)(77096005)(6116002)(102836003)(93886004)(122556002)(33646002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR12MB0467;H:BLUPR12MB0466.namprd12.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <0A36D5F7E6B1BD459574C42442437B94@namprd12.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2016 17:53:15.8027 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0467 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u5FKRbDL028827 On Wed, 2016-06-15 at 13:54 +0200, joro@8bytes.org wrote: > On Thu, Jun 09, 2016 at 03:48:44PM +0000, Vesely, Jan wrote: > > On Sat, 2016-05-21 at 14:11 -0400, Jan Vesely wrote: > > > From: Jan Vesely > > > > > > Signed-off-by: Jan Vesely > > > --- > > >  drivers/iommu/amd_iommu.c | 1 + > > >  1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/iommu/amd_iommu.c > > > b/drivers/iommu/amd_iommu.c > > > index 17c76f2..4ff5e40 100644 > > > --- a/drivers/iommu/amd_iommu.c > > > +++ b/drivers/iommu/amd_iommu.c > > > @@ -3016,6 +3016,7 @@ static void protection_domain_free(struct > > > protection_domain *domain) > > >   > > >   del_domain_from_list(domain); > > >   > > > + mutex_destroy(&domain->api_lock); > > >   if (domain->id) > > >   domain_id_free(domain->id); > > >   > > > > ping > > Your patches lack commit messages, please add a more detailed > description of what you are fixing and why. Please also add 'Fixes:' > tags when resubmitting. The changes itself look good to me. There are no specific bugs/oopses that these patches fix (that I'm aware of). Both were found while I was familiarizing myself with the code looking for memory corruption (which turned out to be [0]). Either issue would be very difficult to hit in the wild and mutex_destroy is empty unless you compile using CONFIG_DEBUG_MUTEXES. Jan [0] https://lkml.org/lkml/2016/3/7/1087 > > > Joerg >