From: "Yang, Shunyong" <shunyong.yang@hxt-semitech.com>
To: "joro@8bytes.org" <joro@8bytes.org>, "olof@lixom.net" <olof@lixom.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>
Subject: Re: [PATCH 1/2] iommu: Add config option to set passthrough as default
Date: Thu, 12 Jul 2018 02:04:41 +0000 [thread overview]
Message-ID: <1531361076.3757.5.camel@hxt-semitech.com> (raw)
In-Reply-To: <20180711205936.18614-1-olof@lixom.net>
Hi, Olof,
Tired of changing command line. I like this patch.
Thanks.
Shunyong.
On Wed, 2018-07-11 at 13:59 -0700, Olof Johansson wrote:
> This allows the default behavior to be controlled by a kernel config
> option instead of changing the commandline for the kernel to include
> "iommu.passthrough=on" on machines where this is desired.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
> drivers/iommu/Kconfig | 10 ++++++++++
> drivers/iommu/iommu.c | 4 ++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
> index 689ffe538370..a9bb1a5b5e43 100644
> --- a/drivers/iommu/Kconfig
> +++ b/drivers/iommu/Kconfig
> @@ -60,6 +60,16 @@ config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
>
> endmenu
>
> +config IOMMU_DEFAULT_PASSTHROUGH
> + bool "IOMMU passthrough by default"
> + depends on IOMMU_API
> + help
> + Enable passthrough by default (removing the need to pass
> in
> + iommu.passthrough=on through command line). If this is
> enabled,
> + you can still disable with iommu.passthrough=off
> +
> + If unsure, say N here.
> +
> config IOMMU_IOVA
> tristate
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 63b37563db7e..ab8fc54467e0 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -36,7 +36,11 @@
>
> static struct kset *iommu_group_kset;
> static DEFINE_IDA(iommu_group_ida);
> +#ifdef CONFIG_IOMMU_DEFAULT_PASSTHROUGH
> +static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_IDENTITY;
> +#else
> static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA;
> +#endif
>
> struct iommu_callback_data {
> const struct iommu_ops *ops;
next prev parent reply other threads:[~2018-07-12 2:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 20:59 Olof Johansson
2018-07-11 20:59 ` [PATCH 2/2] iommu: add sysfs attribyte for domain type Olof Johansson
2018-07-12 2:04 ` Yang, Shunyong [this message]
2018-07-20 12:16 ` [PATCH 1/2] iommu: Add config option to set passthrough as default Joerg Roedel
2018-07-20 17:37 ` Olof Johansson
2018-07-20 18:02 ` [PATCH] " Olof Johansson
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=1531361076.3757.5.camel@hxt-semitech.com \
--to=shunyong.yang@hxt-semitech.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
/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
Powered by JetHome