IOMMU Archive on lore.kernel.org
 help / color / Atom feed
From: John Garry <john.garry@huawei.com>
To: Robin Murphy <robin.murphy@arm.com>, <joro@8bytes.org>,
	<will@kernel.org>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	hch@lst.de
Subject: Re: [PATCH] iommu: Print default strict or lazy mode at init time
Date: Tue, 1 Jun 2021 18:44:00 +0100
Message-ID: <72eb3de9-1d1c-ae46-c5a9-95f26525d435@huawei.com> (raw)
In-Reply-To: <58ea001c-4c37-9c5a-77be-38ac3bea2476@arm.com>

>>
>> pr_info("DMA domain default TLB invalidation policy: %s mode %s\n",
>>                iommu_dma_strict ? "strict" : "lazy",
>>                 (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ?
>>                         "(set via kernel command line)" : "");
>>
>> I think it's worth mentioning "default" somewhere, as not all IOMMUs 
>> or devices will use lazy mode even if it's default.
> 
> But that's part of what I think is misleading - I boot and see that the 
> default is something, so I reboot with iommu.strict to explicitly set it 
> the other way, but now that's the default... huh?
> 
> The way I see it, we're saying what the current IOMMU API policy is - 
> the value of iommu_dma_strict at any given time is fact - but we're not 
> necessarily saying how widely that policy is enforced. We similarly 
> report the type for default domains from global policy even though that 
> may also be overridden per-group by drivers and/or userspace later; 

> we 
> don't say it's the *default* default domain type.

I think that is this is the behavior a user would understand from that 
message.

However from a glance at the intel IOMMU driver, it seems possible to 
change default domain type after iommu_subsys_init().

> 
> However, having now debugged the AMD issue from another thread, I think 
> doing this at subsys_initcall is in fact going to be too early to be 
> meaningful, since it ignores drivers' ability to change the global 
> policy :(

A user may still learn the IOMMU group domain type from sysfs. There is 
no such thing for TLB invalidation mode - how about add a file for this? 
It would be useful.

Thanks,
John
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

      reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 13:37 John Garry
2021-06-01  9:09 ` Robin Murphy
2021-06-01 15:50   ` John Garry
2021-06-01 16:42     ` Robin Murphy
2021-06-01 17:44       ` John Garry [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=72eb3de9-1d1c-ae46-c5a9-95f26525d435@huawei.com \
    --to=john.garry@huawei.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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

IOMMU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iommu/0 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/ https://lore.kernel.org/linux-iommu \
		iommu@lists.linux-foundation.org
	public-inbox-index linux-iommu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linux-foundation.lists.iommu


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git