Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp20164ybt; Tue, 30 Jun 2020 13:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaIbxgn9DK8Ilz41c/qwNAfyJwJ1Tpc5EclKZBtM4g0krfePiyPSiilraqk35uCW4QWiIj X-Received: by 2002:a50:f702:: with SMTP id g2mr25413760edn.348.1593550271422; Tue, 30 Jun 2020 13:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593550271; cv=none; d=google.com; s=arc-20160816; b=eHjgjMsGDmotFQl63SRAZncctACLpN1PFXYosKnjqlZpj984AvkJoiUtMhc58VUmcR idcukAPff4+xzVhKKbBoDtvGBhvOk6dQTmSG1ujb/7vHUnsO7myCA8Oh8hg7KQQpyBEt 1cISkHf712zSus1kgr1Ej2L+d96tSjEPx9XrRhRvpD6YoxH0hpz8azLVBrG8mOCwIEbF iz8yeRI3sSky//fciGW8CbwHTeTfZfdkiqGSvq55l2JFnxT6pK5o8d7T7H1mbaiYV9Br bpMh1kC8NguCPevhQHbOUclBTCmrygukeO9iT5Q35YBPpT1tAldwXoWX0rIVZ0II+1zP as4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=1CsZ1TFe37oE1fHjSd3wd2qJTX4hKSoPxrx7QcLazak=; b=OTxBfr0elKaTUPOOTd85JNZRzTkJl//p2gJ7DED2Z00gOT2v3ZwD4LZKV9wdytvOM8 I8M0cpyy4U5CEZlEF1CINXJT4Qhbl6ZzYZ285lUSUUMjahe+ZU80UtqMvYp44BvLdIY5 MxvQlH3ywP0SwJfOnfEOMuubspz0WpGAYxOTRcI8M3c1pjNxyH941NHP268InlOZzxpw uMg/Dp0sXvataVy9jnK9r40eBm7YxkV+/OY9l03LPGHH8/cNhI2gNJCd3zy2M9Wv3yl1 emvfDTkwtwsVH4/k7K+/yYewDXaACv55v2HmkOG+uqqOsErIMNPJ28kJeX7Hde8Kz8xM ZfwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be28si2285397edb.373.2020.06.30.13.50.48; Tue, 30 Jun 2020 13:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbgF3TXF (ORCPT + 99 others); Tue, 30 Jun 2020 15:23:05 -0400 Received: from winnie.ispras.ru ([83.149.199.91]:14590 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726283AbgF3TXE (ORCPT ); Tue, 30 Jun 2020 15:23:04 -0400 Received: from monopod.intra.ispras.ru (monopod.intra.ispras.ru [10.10.3.121]) by smtp.ispras.ru (Postfix) with ESMTP id D8065201D0; Tue, 30 Jun 2020 22:22:55 +0300 (MSK) Date: Tue, 30 Jun 2020 22:22:55 +0300 (MSK) From: Alexander Monakov To: Suravee Suthikulpanit cc: linux-kernel@vger.kernel.org, Joerg Roedel , iommu@lists.linux-foundation.org Subject: Re: [PATCH] iommu/amd: Fix event counter availability check In-Reply-To: Message-ID: References: <20200529200738.1923-1-amonakov@ispras.ru> <56761139-f794-39b1-4dfa-dfc05fbe5f60@amd.com> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Jun 2020, Suravee Suthikulpanit wrote: > > > On 6/1/20 4:01 PM, Alexander Monakov wrote: > > > > On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: > > > > > > > > > > Moving init_iommu_perf_ctr just after iommu_flush_all_caches > > > > > > resolves the issue. This is the earliest point in amd_iommu_init_pci > > > > > > where the call succeeds on my laptop. > > > > > According to your description, it should just need to be anywhere > > > > > after the pci_enable_device() is called for the IOMMU device, isn't > > > > > it? So, on your system, what if we just move the init_iommu_perf_ctr() > > > > > here: > > > > No, this doesn't work, as I already said in the paragraph you are > > > > responding to. See my last sentence in the quoted part. > > > > > > > > So the implication is init_device_table_dma together with subsequent > > > > cache flush is also setting up something that is necessary for counters > > > > to be writable. > > > > > > > > Alexander > > > > > > > Instead of blindly moving the code around to a spot that would just work, > > > I am trying to understand what might be required here. In this case, > > > the init_device_table_dma()should not be needed. I suspect it's the IOMMU > > > invalidate all command that's also needed here. > > > > > > I'm also checking with the HW and BIOS team. Meanwhile, could you please > > > give the following change a try: > > Hello. Can you give any update please? > > > > Alexander > > > > Sorry for late reply. I have a reproducer and working with the HW team to > understand the issue. > I should be able to provide update with solution by the end of this week. Hi, can you share any information (two more weeks have passed)? Alexander