Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp630932ybl; Fri, 24 Jan 2020 06:45:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxrq9wj1S2SphaLV0E/CS/6n/kS5QZhdbFdp6vv9Cr3uAsPDBwtYukbkBMVpryr+O8v9Kco X-Received: by 2002:a9d:6510:: with SMTP id i16mr2809308otl.142.1579877142324; Fri, 24 Jan 2020 06:45:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579877142; cv=none; d=google.com; s=arc-20160816; b=xWRs2lw1OaoWLm3JMKhhvSk9v0JKxcF2UpC7uvrlH3bGxhLws4B8PTHWN8pmGy1U7T F2Ap17l7e58e/eKWQNiZShM+c4UOu2ZUfvl2jqWkC7Y9N5ErH8ZTqbv4kASL5GL4O2h5 o/q6RQFG2Iwu/+FKNHcGlpW31Ba+1FTG7CEVq/1oT5ApG1OBsmGGUa3P1n0ehdQ5PXDP aw76J7u7rJI4Zz5QlVd+hrHLl5MdKX9stH3vFTR15anI0I/IprgYk+F6yzdFPmlageVj cygMyY24sy0MHi6CtsEMGM+ktp6hUjCB9Ih+v2c0D7poO0/m80aOAQQ9Cxd+ZaJd55vS 4iVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FpmOuwt4STIa6tJfMGrABiCnfkVXVSIVreVA+YsZLUs=; b=CksYeQt8c8xQxJUhW95IN8eU90KBzVOE69UmZIXUC6WSGh6l51YF9MiRblDmqwATtt raY0+hvTfVi97GyJajKLlEMpBz1myAK7u6cL841Al9JvDqrbQeMaViwKjN6xaSJKXlwv VX1eJJunDm/lItOytTJerihy+nM7vjbUoiy5VJV2Bw/AQk+O7kVTB/fNZJAX4JcyiLsO hz2VmMjiGAtAZlzOi5b8KdFKV6kx8Ac55RfNFodHsyt9OsXGYKuZMiwif+MxUB8V3UY3 BGOWcMFo/nejIsuY1KbeNrSCDe1vZ11XATjr64kQS0mKFuWlLB6H1okC8c6AkkheUdU/ ncLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si2921335otk.185.2020.01.24.06.45.30; Fri, 24 Jan 2020 06:45:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391283AbgAXO3S (ORCPT + 99 others); Fri, 24 Jan 2020 09:29:18 -0500 Received: from 8bytes.org ([81.169.241.247]:60796 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391259AbgAXO3M (ORCPT ); Fri, 24 Jan 2020 09:29:12 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 44E89AA1; Fri, 24 Jan 2020 15:29:10 +0100 (CET) Date: Fri, 24 Jan 2020 15:29:07 +0100 From: Joerg Roedel To: Shuah Khan Cc: suravee.suthikulpanit@amd.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iommu: amd: Fix IOMMU perf counter clobbering during init Message-ID: <20200124142907.GA27081@8bytes.org> References: <20200123223214.2566-1-skhan@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200123223214.2566-1-skhan@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 23, 2020 at 03:32:14PM -0700, Shuah Khan wrote: > init_iommu_perf_ctr() clobbers the register when it checks write access > to IOMMU perf counters and fails to restore when they are writable. > > Add save and restore to fix it. > > Signed-off-by: Shuah Khan > --- > Changes since v1: > -- Fix bug in sucessful return path. Add a return instead of > fall through to pc_false error case > > drivers/iommu/amd_iommu_init.c | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) Applied for v5.5, thanks.