IOMMU Archive on
 help / color / Atom feed
From: Alexander Monakov <>
To: Shuah Khan <>
Subject: Re: [PATCH] iommu/amd: Fix event counter availability check
Date: Wed, 3 Jun 2020 09:54:42 +0300 (MSK)
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, 2 Jun 2020, Shuah Khan wrote:

> I changed the logic to read config to get max banks and counters
> before checking if counters are writable and tried writing to all.
> The result is the same and all of them aren't writable. However,
> when disable the writable check and assume they are, I can run

This is similar to what I did. I also noticed that counters can
be successfully used with perf if the initial check is ignored.
I was considering sending a patch to remove the check and adjust
the event counting logic to use counters as read-only, but after
a bit more investigation I've noticed how late pci_enable_device
is done, and came up with this patch. It's a path of less resistance:
I'd expect maintainers to be more averse to removing the check
rather than fixing it so it works as intended (even though I think
the check should not be there in the first place).


The ability to modify the counters is needed only for sampling the
events (getting an interrupt when a counter overflows). There's no
code to do that for these AMD IOMMU counters. A solution I would
prefer is to not write to those counters at all. It would simplify or
even remove a bunch of code. I can submit a corresponding patch if
there's general agreement this path is ok.

What do you think?

iommu mailing list

  reply index

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 20:07 Alexander Monakov
2020-05-31  7:22 ` Alexander Monakov
2020-06-01  2:48   ` Paul Menzel
2021-02-21 13:44     ` Paul Menzel
2020-06-02 23:51   ` Shuah Khan
2020-06-03  6:54     ` Alexander Monakov [this message]
2021-02-26 21:44       ` Paul Menzel
2021-02-26 21:55         ` Shuah Khan
2020-06-01  7:37 ` Suravee Suthikulpanit
2020-06-01  9:01   ` Alexander Monakov
2020-06-01 15:10     ` Suravee Suthikulpanit
2020-06-01 16:09       ` Alexander Monakov
2020-06-15 20:48       ` Alexander Monakov
2020-06-16  9:35         ` Suravee Suthikulpanit
2020-06-30 19:22           ` Alexander Monakov
2020-09-17 17:55           ` Alexander Monakov
2021-02-21 13:49             ` Paul Menzel
2021-02-22 17:59               ` Suravee Suthikulpanit
2021-02-24 20:35                 ` Paul Menzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IOMMU Archive on

Archives are clonable:
	git clone --mirror linux-iommu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iommu linux-iommu/ \
	public-inbox-index linux-iommu

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone