From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Will Deacon <will.deacon@arm.com>, Robin Murphy <robin.murphy@arm.com>
Cc: linux-ia64 <linux-ia64@vger.kernel.org>,
Sebastian Ott <sebott@linux.ibm.com>,
linux-doc <linux-doc@vger.kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Paul Mackerras <paulus@samba.org>,
"H . Peter Anvin" <hpa@zytor.com>,
linux-s390 <linux-s390@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
Joerg Roedel <joro@8bytes.org>, x86 <x86@kernel.org>,
Ingo Molnar <mingo@redhat.com>, Fenghua Yu <fenghua.yu@intel.com>,
John Garry <john.garry@huawei.com>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
Gerald Schaefer <gerald.schaefer@de.ibm.com>,
Tony Luck <tony.luck@intel.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
iommu <iommu@lists.linux-foundation.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v5 1/6] iommu: add generic boot option iommu.dma_mode
Date: Wed, 17 Apr 2019 10:36:58 +0800 [thread overview]
Message-ID: <5CB6914A.8050308@huawei.com> (raw)
In-Reply-To: <20190416152100.GB4187@fuggles.cambridge.arm.com>
On 2019/4/16 23:21, Will Deacon wrote:
> On Fri, Apr 12, 2019 at 02:11:31PM +0100, Robin Murphy wrote:
>> On 12/04/2019 11:26, John Garry wrote:
>>> On 09/04/2019 13:53, Zhen Lei wrote:
>>>> +static int __init iommu_dma_mode_setup(char *str)
>>>> +{
>>>> + if (!str)
>>>> + goto fail;
>>>> +
>>>> + if (!strncmp(str, "passthrough", 11))
>>>> + iommu_default_dma_mode = IOMMU_DMA_MODE_PASSTHROUGH;
>>>> + else if (!strncmp(str, "lazy", 4))
>>>> + iommu_default_dma_mode = IOMMU_DMA_MODE_LAZY;
>>>> + else if (!strncmp(str, "strict", 6))
>>>> + iommu_default_dma_mode = IOMMU_DMA_MODE_STRICT;
>>>> + else
>>>> + goto fail;
>>>> +
>>>> + pr_info("Force dma mode to be %d\n", iommu_default_dma_mode);
>>>
>>> What happens if the cmdline option iommu.dma_mode is passed multiple
>>> times? We get mutliple - possibily conflicting - prints, right?
>>
>> Indeed; we ended up removing such prints for the existing options here,
>> specifically because multiple messages seemed more likely to be confusing
>> than useful.
I originally intended to be compatible with X86 printing.
} else if (!strncmp(str, "strict", 6)) {
pr_info("Disable batched IOTLB flush\n");
intel_iommu_strict = 1;
}
>>
>>> And do we need to have backwards compatibility, such that the setting
>>> for iommu.strict or iommu.passthrough trumps iommu.dma_mode, regardless
>>> of order?
>>
>> As above I think it would be preferable to just keep using the existing
>> options anyway. The current behaviour works out as:
>>
>> iommu.passthrough | Y | N
>> iommu.strict | x | Y N
>> ------------------|-------------|---------|--------
>> MODE | PASSTHROUGH | STRICT | LAZY
>>
>> which seems intuitive enough that a specific dma_mode option doesn't add
>> much value, and would more likely just overcomplicate things for users as
>> well as our implementation.
>
> Agreed. We can't remove the existing options, and they do the job perfectly
> well so I don't see the need to add more options on top.
OK, I will remove the iommu.dma_mode option in the next version. Thanks for you three.
I didn't want to add it at first, but later found that the boot options on
each ARCH are different, then want to normalize it.
In addition, do we need to compatible the build option name IOMMU_DEFAULT_PASSTHROUGH? or
change it to IOMMU_DEFAULT_DMA_MODE_PASSTHROUGH or IOMMU_DEFAULT_MODE_PASSTHROUGH?
>
> Will
>
> .
>
--
Thanks!
BestRegards
next prev parent reply other threads:[~2019-04-17 2:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 12:53 [PATCH v5 0/6] add generic boot option for IOMMU dma mode Zhen Lei
2019-04-09 12:53 ` [PATCH v5 1/6] iommu: add generic boot option iommu.dma_mode Zhen Lei
2019-04-12 10:26 ` John Garry
2019-04-12 13:11 ` Robin Murphy
2019-04-16 15:21 ` Will Deacon
2019-04-17 2:36 ` Leizhen (ThunderTown) [this message]
2019-04-12 11:16 ` Joerg Roedel
2019-04-23 2:45 ` Leizhen (ThunderTown)
2019-04-09 12:53 ` [PATCH v5 2/6] iommu: add build options corresponding to iommu.dma_mode Zhen Lei
2019-04-09 12:53 ` [PATCH v5 3/6] iommu: add iommu_default_dma_mode_get/set() helper Zhen Lei
2019-04-09 12:53 ` [PATCH v5 4/6] s390/pci: add support for generic boot option iommu.dma_mode Zhen Lei
2019-04-10 11:46 ` Sebastian Ott
2019-04-09 12:53 ` [PATCH v5 5/6] powernv/iommu: " Zhen Lei
2019-04-09 12:53 ` [PATCH v5 6/6] x86/iommu: " Zhen Lei
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=5CB6914A.8050308@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dwmw2@infradead.org \
--cc=fenghua.yu@intel.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=guohanjun@huawei.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jean-philippe.brucker@arm.com \
--cc=john.garry@huawei.com \
--cc=joro@8bytes.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=robin.murphy@arm.com \
--cc=schwidefsky@de.ibm.com \
--cc=sebott@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=will.deacon@arm.com \
--cc=x86@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).